Skip to content

Conversation

@j-krl
Copy link

@j-krl j-krl commented Nov 17, 2025

Summary of changes

Resolves #1572

  • Adds the --upgrade option to inject and install, mirroring the pip install option.
  • Adds --upgrade-strategy to upgrade as well as all subcommands where --upgrade has been added above. Upgrade strategy options are the same as pip's where eager upgrades all dependencies of the main package regardless of the upgrade being required, and only-if-needed upgrades only dependencies that require an upgrade.

Motivation

Provides a way to conditionally upgrade only if the currently installed version does not match the passed spec. Currently, pipx upgrade upgrades to the latest available version and does not allow an installation spec. pipx install --upgrade allows this flexibility. This also adds parity with underlying pip commands which is a usability benefit.

For example, if I have black v24.1.0 installed and I want to upgrade to no higher than the latest minor version of v24 I can now run pipx install --upgrade 'black<25', which was not possible previously.

Test plan

PENDING

j-krl and others added 2 commits November 16, 2025 23:16
- Adds the `--upgrade` option to `inject` and `install`, mirroring the
  pip install option
- Adds `--upgrade-strategy` to `upgrade` as well as all subcommands
  where `--upgrade` has been added
@j-krl
Copy link
Author

j-krl commented Nov 17, 2025

Maintainers: This PR is not fully complete as tests & docs have not been updated. Seeking approval on my general approach and that this feature is still desired before implementing remaining requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pipx install --update

1 participant