How to run command with dynamic sub command #3157
-
|
Hi folks, i tried to install the specific gdal version, depending on the installed os gdal binaries. But tox will escape the command like: py311-django41: commands_pre[0]> pip install 'gdal==`gdal-config --version`.*'
ERROR: Invalid requirement: 'gdal==`gdal-config --version`.*'
Why does tox surround the package with ' chars? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
currently i developed a workaround for me: run echo "gdal==`gdal-config --version`.*" >> requirements-gdal.txtin front of the tox command and add the requirements-gdal.txt to the deps: for my ci jobs this worked. But the initial question is not answered. |
Beta Was this translation helpful? Give feedback.
-
|
Tox does not support shell command substitution (backticks or Your workaround of writing a requirements file is a valid approach. Alternatively:
|
Beta Was this translation helpful? Give feedback.
Tox does not support shell command substitution (backticks or
$(...)) — commands are not run through a shell by default. Tox passes arguments directly to the executable.Your workaround of writing a requirements file is a valid approach. Alternatively:
commands_pre = bash -c 'pip install gdal==$(gdal-config --version).*'(and addbashtoallowlist_externals)