Fix pip.install editable validation for Windows drive-letter paths#69765
Open
ggiesen wants to merge 1 commit into
Open
Fix pip.install editable validation for Windows drive-letter paths#69765ggiesen wants to merge 1 commit into
ggiesen wants to merge 1 commit into
Conversation
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
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.
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:/fooorC:\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-pathon Windows raisedCommandExecutionError: 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?
changelog/55097.fixed.md)New tests in
tests/pytests/unit/modules/test_pip.py:test_install_editable_local_windows_path_55097- parametrized overC:\local-file-pathandC:/local-file-path; assertsinstall()does not raise and issues the expected--editablecommand with no#egg=.test_install_editable_without_egg_still_fails_55097- confirms a remotegit+httpseditable with no#egg=still raisesCommandExecutionError.test_install_editable_posix_local_path_55097- confirms a POSIX absolute editable path is still accepted without an#egg=.Commits signed with GPG?
No