Skip to content

Fix pip.install editable validation for Windows drive-letter paths#69765

Open
ggiesen wants to merge 1 commit into
saltstack:3006.xfrom
ggiesen:fix-55097
Open

Fix pip.install editable validation for Windows drive-letter paths#69765
ggiesen wants to merge 1 commit into
saltstack:3006.xfrom
ggiesen:fix-55097

Conversation

@ggiesen

@ggiesen ggiesen commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Broadens the local-editable path detection in salt.modules.pip.install() so that Windows absolute paths (a drive letter followed by : and a path separator, e.g. C:/foo or C:\foo) are recognized as local editable installs and are not forced to carry an #egg= fragment.

What issues does this PR fix or reference?

Fixes #55097

Previous Behavior

pip.install editable=C:/local-file-path on Windows raised CommandExecutionError: You must specify an egg for this editable. The local-editable check only accepted ., file:// URLs, and POSIX absolute paths (leading /), so a Windows drive-letter path fell through to the remote-VCS #egg= requirement.

New Behavior

A Windows drive-letter path is treated as a local editable install and no #egg= fragment is required, matching the existing behaviour for POSIX absolute paths. Remote VCS editables (e.g. git+https://...) without an #egg= fragment still raise, because a multi-character URL scheme cannot match the single-letter drive-prefix pattern.

Merge requirements satisfied?

  • Docs: n/a (no user-facing docs change)
  • Changelog entry added (changelog/55097.fixed.md)
  • Tests written and described below

New tests in tests/pytests/unit/modules/test_pip.py:

  • test_install_editable_local_windows_path_55097 - parametrized over C:\local-file-path and C:/local-file-path; asserts install() does not raise and issues the expected --editable command with no #egg=.
  • test_install_editable_without_egg_still_fails_55097 - confirms a remote git+https editable with no #egg= still raises CommandExecutionError.
  • test_install_editable_posix_local_path_55097 - confirms a POSIX absolute editable path is still accepted without an #egg=.

Commits signed with GPG?

No

The local-editable check in pip.install() only treated "." , file:// URLs,
and POSIX absolute paths as local. A Windows absolute path such as
C:/local-file-path or C:\local-file-path matched none of these and fell
through to the VCS #egg= requirement, raising "You must specify an egg for
this editable" for a valid local editable install.

Broaden the guard to also accept a drive-letter prefix followed by a path
separator. A multi-char URL scheme cannot match the single-letter drive
pattern, so remote VCS editables still require an #egg= fragment.

Fixes saltstack#55097
@ggiesen ggiesen requested a review from a team as a code owner July 10, 2026 17:55
@charzl charzl self-assigned this Jul 10, 2026
@dwoz dwoz added the test:full Run the full test suite label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants