pipupgrade
pipupgrade is a command-line interface (CLI) tool for upgrading Python packages across various environments. It supports requirements.txt files and Pipfiles, leveraging semantic versioning to intelligently manage updates and prevent unintended breaking changes. The current version is 1.12.0, released in February 2022, indicating a maintenance-focused release cadence.
Warnings
- breaking Using the `--latest` flag or specifying `--upgrade-type major` will force upgrades to the absolute latest version, which may introduce incompatible changes in your dependencies, as `pipupgrade`'s default behavior is to avoid major version bumps to prevent breaking changes.
- gotcha `pipupgrade` is designed as a command-line utility and does not expose a public Python API for programmatic imports or use. Attempting to import it as a library will not work as expected.
- gotcha While the project's GitHub README previously stated compatibility with Python 2.7+ and Python 3.4+, the last release was in early 2022. Newer Python versions (e.g., Python 3.9+) or recent `pip` changes might not be fully tested or supported, potentially leading to unexpected behavior.
- gotcha Running `pipupgrade` directly in a global Python environment (outside a virtual environment) can lead to unintended modifications of system-wide packages. Although `pipupgrade` aims to discover multiple environments, it is best practice to activate the specific virtual environment you intend to manage before running the tool, or use `--pip-path` for explicit control.
Install
-
pip install pipupgrade
Quickstart
pipupgrade --check # This command checks for outdated packages without performing upgrades. pipupgrade # This command upgrades all detected outdated packages, avoiding major version bumps by default.