Related
#415 Arguments are not quoted when calling pytest
This is a second instance of the unquoted-command-string defect tracked in #415. #415 covers the pytest runner path (pytest_runner.py:38); this story covers the editable-install path (pip install -e ) that breaks azdev extension add. The systemic fix jiasli recommends in #415; passing an argv sequence to subprocess instead of formatting a command string, would resolve both. Filing separately so the editable-install call sites and a whitespace-path regression test are tracked explicitly; suggest closing together or linking as duplicates of one fix.
Repro
- Clone
azure-cli-extensions under a path containing a space (common with OneDrive).
azdev setup -r <repo>
azdev extension add ssh
Actual
... pip install -e C:\...\Azure Powershell\...\src\ssh --config-settings editable_mode=compat ... exit code 1
ERROR: Invalid requirement: '-': Expected package name at the start of dependency specifier
Root cause (unquoted {} for path):
# azdev/operations/extensions/__init__.py:76
pip_cmd('install -e {} {}'.format(path, _PIP_EDITABLE_OPTS), ...)
Affected call sites (same pattern)
azdev/operations/extensions/__init__.py:76
azdev/operations/setup.py:54, 95, 99, 105, 110, 134
azdev/operations/code_gen.py:303
Proposed fix
Adopt #415's systemic approach: pass an argv sequence to subprocess (or, minimally, quote the path) across all editable-install sites; add a regression test installing from a temp path with a space.
Acceptance criteria
azdev extension add <name> succeeds from a whitespace path on Windows + POSIX.
All listed call sites use the quoted/argv form.
Regression test covers a whitespace path.
Related
#415 Arguments are not quoted when calling pytest
This is a second instance of the unquoted-command-string defect tracked in #415. #415 covers the pytest runner path (pytest_runner.py:38); this story covers the editable-install path (pip install -e ) that breaks azdev extension add. The systemic fix jiasli recommends in #415; passing an argv sequence to subprocess instead of formatting a command string, would resolve both. Filing separately so the editable-install call sites and a whitespace-path regression test are tracked explicitly; suggest closing together or linking as duplicates of one fix.
Repro
azure-cli-extensionsunder a path containing a space (common with OneDrive).azdev setup -r <repo>azdev extension add sshActual
Root cause (unquoted {} for path):
Affected call sites (same pattern)
Proposed fix
Adopt #415's systemic approach: pass an argv sequence to subprocess (or, minimally, quote the path) across all editable-install sites; add a regression test installing from a temp path with a space.
Acceptance criteria