Quote paths in editable installs#551
Open
aryasadeghi1 wants to merge 3 commits into
Open
Conversation
) Paths containing spaces (e.g. OneDrive folders) broke 'pip install -e <path>' and the pytest runner because the path was interpolated unquoted into the command string. Add a platform-aware quote_arg helper (subprocess.list2cmdline on Windows, shlex.quote on POSIX) and apply it at all editable-install call sites and the pytest runner. Adds regression tests covering whitespace paths.
… editable installs and pytest runner
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.
Fix: editable installs and pytest runner fail on paths with spaces (#550, #415)
Problem
Paths containing spaces (common with OneDrive) broke commands because the path was
interpolated unquoted into the command string:
pip install -e <path>->azdev extension add,azdev setup, code-gen (azdev editable installs fail on paths with spaces (unquoted pip install -e <path>) #550)log_path/ test paths (Arguments are not quoted when callingpytest#415)Fix
quote_arghelper inazdev/utilities/command.pysubprocess.list2cmdline(string passed verbatim to CreateProcess)shlex.quote(matches theshlex.splitdone by the runners)extensions/__init__.py,setup.py, andcode_gen.py, plustesttool/pytest_runner.py.Tests
test_editable_install_quoting.pycovers whitespace paths on Windows + POSIXand verifies
add_extensionemits a quoted path.Closes #550, closes #415.