Skip to content

Preserve editable flag of path sources in all_dependencies_complex - #2449

Open
kfields wants to merge 1 commit into
pypa:masterfrom
kfields:fix-sources-editable
Open

kfields wants to merge 1 commit into
pypa:masterfrom
kfields:fix-sources-editable

Conversation

@kfields

@kfields kfields commented Sep 28, 2026

Copy link
Copy Markdown

all_dependencies_complex rebuilt each external dependency from its string form, dropping the editable flag set by path sources, so they were installed non-editable. Reuse the original Dependency objects for strings that pass through resolve_extras unchanged.

Fixes #2448

all_dependencies_complex rebuilt each external dependency from its
string form, dropping the editable flag set by path sources, so they
were installed non-editable. Reuse the original Dependency objects for
strings that pass through resolve_extras unchanged.

Fixes pypa#2448
@cjames23

Copy link
Copy Markdown
Member

This regresses path sources that are requested with extras, which might have been a latent bug hidden by the bug you are fixing. Path sources now go through the editable branch in virtual.py:289, which passes only dependency.path to the installer. So canary[foo] gets installed as -e /path/canary and foo's dependencies are never installed.

Keeping the extras on the editable path fixes it:

extras = f"[{','.join(sorted(dependency.extras))}]" if dependency.extras else ""
user_editable_dependencies.append(f"{dependency.path}{extras}")

If you would not mind making that change as well to ensure that things work as intended

Also, environments created before this change stay non-editable, because the dependency hash doesn't include editable. That might be worth mentioning in the changelog.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sources: path sources are installed non-editable (editable flag dropped in all_dependencies_complex)

2 participants