-
Notifications
You must be signed in to change notification settings - Fork 476
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
When I use pipx --preinstall to install a specific version of a dependency before installing the main package, pipx installs the latest version of the dependency instead.
How to reproduce
Ask pipx to install a dependency with a specific version before installing the main package:
% pipx install --preinstall virtualenv==20.25.3 tox --verbose
pipx >(setup:924): pipx version is 1.5.0
pipx >(setup:925): Default python interpreter is '/Library/Frameworks/Python.framework/Versions/3.11/bin/python3'
pipx >(package_name_from_spec:379): Determined package name: tox
pipx >(package_name_from_spec:380): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:174): running /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m venv --without-pip /Users/foo/.local/pipx/venvs/tox
pipx >(run_subprocess:174): running <checking pip's availability>
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python --version
pipx >(package_name_from_spec:379): Determined package name: virtualenv
pipx >(package_name_from_spec:380): Package name determined in 0.0s
upgrading virtualenv...
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python -m pip --no-input install --upgrade virtualenv
Looking in indexes: https://nexusrepo.app.mycompany.net/repository/pypilocal/simple/
Collecting virtualenv
ERROR: HTTP error 403 while getting https://nexusrepo.app.mycompany.net/repository/pypilocal/packages/virtualenv/20.26.0/virtualenv-20.26.0-py3-none-any.whl#sha256=0846377ea76e818daaa3e00a4365c018bc3ac9760cbb3544de542885aad61fb3 (from https://nexusrepo.app.mycompany.net/repository/pypilocal/simple/virtualenv/) (requires-python:>=3.7)
ERROR: Could not install requirement virtualenv from https://nexusrepo.app.mycompany.net/repository/pypilocal/packages/virtualenv/20.26.0/virtualenv-20.26.0-py3-none-any.whl#sha256=0846377ea76e818daaa3e00a4365c018bc3ac9760cbb3544de542885aad61fb3 because of HTTP error 403 Client Error: Requested item is quarantined, please visit https://nexusiq.app.mycompany.net/ui/links/repository/da36ea0ecef64a9199ff614f6d56291c/result to investigate the reason(s) for url: https://nexusrepo.app.mycompany.net/repository/pypilocal/packages/virtualenv/20.26.0/virtualenv-20.26.0-py3-none-any.whl for URL https://nexusrepo.app.mycompany.net/repository/pypilocal/packages/virtualenv/20.26.0/virtualenv-20.26.0-py3-none-any.whl#sha256=0846377ea76e818daaa3e00a4365c018bc3ac9760cbb3544de542885aad61fb3 (from https://nexusrepo.app.mycompany.net/repository/pypilocal/simple/virtualenv/) (requires-python:>=3.7)
pipx >(rmdir:55): removing directory /Users/foo/.local/pipx/venvs/tox
'/Users/foo/.local/pipx/venvs/tox/bin/python -m pip --no-input install --upgrade virtualenv' failed
Notice that pipx tried to install the latest virtualenv (20.26.0). I use a local PyPI mirror that quarantined 20.26.0, so it failed to install.
Expected behavior
I expected pipx to install virtualenv==20.25.3 instead of the latest version.
Note that pipx install --pip-args='virtualenv==20.25.3' tox --verbose
correctly installs the specified version before installing the main package.
% pipx install --pip-args='virtualenv==20.25.3' tox --verbose
pipx >(setup:924): pipx version is 1.5.0
pipx >(setup:925): Default python interpreter is '/Library/Frameworks/Python.framework/Versions/3.11/bin/python3'
pipx >(package_name_from_spec:379): Determined package name: tox
pipx >(package_name_from_spec:380): Package name determined in 0.0s
creating virtual environment...
pipx >(run_subprocess:174): running /Library/Frameworks/Python.framework/Versions/3.11/bin/python3 -m venv --without-pip /Users/foo/.local/pipx/venvs/tox
pipx >(run_subprocess:174): running <checking pip's availability>
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/shared/bin/python -c import sysconfig; print(sysconfig.get_path('purelib'))
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python --version
pipx >(_parsed_package_to_package_or_url:137): cleaned package spec: tox
installing tox...
pipx >(run_subprocess:174): running /Users/foo/.local/pipx/venvs/tox/bin/python -m pip --no-input install virtualenv==20.25.3 tox
pipx >(run_subprocess:174): running <fetch_info_in_venv commands>
pipx >(get_venv_metadata_for_package:348): get_venv_metadata_for_package: 60ms
pipx >(_parsed_package_to_package_or_url:137): cleaned package spec: tox
installed package tox 4.14.2, installed using Python 3.11.6
These apps are now globally available
- tox
done! ✨ 🌟 ✨
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working