Add Distribution.editable and top-level editable()#538
Open
apoorva-01 wants to merge 1 commit into
Open
Conversation
Reads dir_info.editable from the PEP 610 direct_url.json, defaulting to False when there's no origin or it wasn't installed from a local directory.
Author
|
went with the "both" you mentioned, editable(name) just delegates to Distribution.editable (same as version/metadata). property reads origin.dir_info.editable, defaults False when there's no origin/dir_info. two calls for you: name (editable vs is_editable for a bool?), and both vs just one, happy to drop either. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #510
Adds
Distribution.editableplus a top-leveleditable(), basically what you sketched in the issue. the property does the null-safe origin.dir_info.editable walk (defaults to False per PEP 610), and editable() just returns distribution(name).editable, same as version()/metadata().tests cover editable via dir_info, not-editable (origin's there but it's archive_info, no dir_info), and no origin at all. heads up: the existing DistInfoPkgEditable fixture is actually an archive install despite the name, so i added a real dir_info one for the positive case. newsfragment in, full suite + mypy + ruff green.
happy to rename or drop either half if you'd rather go one way.