- What does each color symbolize?
- How do I upgrade
pip
itself? - How do I upgrade
pipupgrade
itself? - How do I upgrade a Python Project?
- How do I update a requirements.txt file?
- How do I perform a dry run?
- How do I view a dependency graph?
- How do I upgrade only selected packages?
pipupgrade
uses Semantic Versioning to detect packages
that require an upgrade. When you run pipupgrade
, it displays the list of packages
that requires an upgrade in the following format:
Each color denotes the following information:
- Red - Packages highlighted in red are upgrades that can potentially be a breaking change.
This means that upgrading this package could most likely cause packages dependent on it to break as well.
By default,
pipupgrade
does not upgrade these packages unless you pass in the--latest
flag or--upgrade-type major
. - Yellow - Packages highlighted in yellow are upgrades that don't necessarily break a change but
provides a novel feature upgrade. Upgrading such packages could provide new features. By default,
pipupgrade
upgrades these packages. You can also selectively upgrade such packages by passing the flag
--upgrade-type minor
. - Green - Packages highlighted in green are patched upgrades. Upgrading such packages will most likely not break any changes and are safe to update. By default,
pipupgrade
upgrades these packages. You can also selectively upgrade such packages by passing the flag
--upgrade-type patch
.
$ pipupgrade --pip
Use the --pip
flag to ensure your pip
is up-to-date. You can also set the
environment variable PIPUPGRADE_PIP
to true
. pipupgrade
would then
attempt to upgrade all pip executables it's able to discover and upgrade
them parallely. If you wish to upgrade a specific pip
executable, use the
--pip-path
flag. For example, if you'd like to upgrade pip3
executable only,
the command then would be
$ pipupgrade --pip --pip-path pip3
The --pip
flag enures to upgrade pip before it attempts to upgrade all other
packages.
$ pipupgrade --self
Use the --self
flag to ensure your pipupgrade
is up-to-date. pipupgrade
will then attempt to upgrade itself and exit execution.
$ pipupgrade --project "<PATH_TO_PYTHON_PROJECT>"
The --project
flag attempts to discover and update requirements*.txt
files
within the entire project directory. It also discovers Pipfile
and if found, attempts to updates Pipfile
and Pipfile.lock
.
In order to discover requirement files recursively, use the --force
flag
or set the environment variable PIPUPGRADE_FORCE
to true
.
$ pipupgrade --project "<PATH_TO_PYTHON_PROJECT>" --force
$ pipupgrade --requirements "<PATH_TO_REQUIREMENTS_FILE>"
$ pipupgrade --check
Use the --check
flag to perform a dry run. You can also set the
environment variable PIPUPGRADE_DRY_RUN
to true
.
$ pipupgrade --format tree
The dependency graph also highlights any conflicting dependencies.
You can also set the environment variable PIPUPGRADE_DISPLAY_FORMAT
to tree
.
If you avoid using the --latest
flag, the tree format ensures to avoid
child dependencies that break changes.
$ pipupgrade "<PACKAGE_1>" "<PACKAGE_2>"
$ pipupgrade --ignore "<PACKAGE_1>" --ignore "<PACKAGE_2>"