pipx
pipx copied to clipboard
fix: install specified version of `--preinstall` dependency instead of latest version
- [x] I have added a news fragment under
changelog.d/(if the patch affects the end users)
Summary of changes
Fixes #1377
chrysle found the problem -- commands/install.py calls package_name_from_spec when it shouldn't. I removed that call and passed the dependencies unmodified to venv.upgrade_package_no_metadata.
Test plan
I added this test case to tests/test_install.py:
def test_preinstall_specific_version(pipx_temp_env, caplog):
assert not run_pipx_cli(["install", "--preinstall", "black==22.8.0", "nox"])
assert "black==22.8.0" in caplog.text
Tested by running
pipx install --preinstall black==22.8.0 nox
How about running pipx.package_specifier.parse_specifier_for_install over the deps instead?
How about running
pipx.package_specifier.parse_specifier_for_installover the deps instead?
Thanks, I added that.
My bad, I've just seen the function is already called in pipx.venv.install_package. Could you revert the change?
@davidpeckham https://github.com/pypa/pipx/pull/1379/commits/7339ae01045f2bece87dd7641305fa3db9b694c2 seems to be empty...
@chrysle I think that last commit fixed it.
Thanks!