Skip to content

Add Distribution.editable and top-level editable() - #538

Open
apoorva-01 wants to merge 1 commit into
python:mainfrom
apoorva-01:feature/editable
Open

apoorva-01 wants to merge 1 commit into
python:mainfrom
apoorva-01:feature/editable

Conversation

@apoorva-01

Copy link
Copy Markdown

Closes #510

Adds Distribution.editable plus a top-level editable(), 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.

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.
@apoorva-01

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant