A versatile tool for effortlessly updating pip requirements while keeping your requirements.txt file in sync with the latest package versions. No more tedious manual package-by-package upgrades; this tool handles it for you and updates your requirements.txt file accordingly.
This command-line tool allows you to interactively (or non-interactively) upgrade packages from your requirements file. It also enables you to update the pinned version in your requirements file(s). If no requirements are specified, the tool will attempt to detect the requirements file(s) in the current directory.
pip install pip-ascent
Note: This package installs the following dependencies: 'docopt', 'packaging', 'requests', 'terminaltables', 'colorclass'
. To avoid installing these dependencies in your project, you can install pip-ascent
in your system rather than your virtual environment. If you install it in your system and need to upgrade it, run pip install -U pip-ascent
.
pip-ascent [<requirements_file>] ... [--prerelease] [-pk=<package>...] [--dry-run] [--check-greater-equal] [--skip-virtualenv-check] [--skip-package-installation] [--use-default-index]
Activate your virtual environment (important because it will also install the new versions of upgraded packages in the current virtual environment).
Change directory into your project. Then:
$ pip-ascent
Arguments:
requirements_file
: Specifies the requirement file or uses a wildcard path to multiple files.--prerelease
: Includes prerelease versions for upgrades when querying PyPI repositories.-pk <package>
: Pre-selects packages for an upgrade, bypassing any prompts. You can also utilize regular expressions to filter packages for upgrading.--dry-run
: Simulates the upgrade but does not perform the actual upgrade.--check-greater-equal
: Also checks packages with minimum version pinning (package>=version).--skip-package-installation
: Upgrades the version in requirement files only; it does not install the new package.--skip-virtualenv-check
: Disables virtual environment check, permitting the installation of new packages outside the virtual environment.--use-default-index
: Skips searching for a custom index URL in pip configuration file(s).
Examples:
-
pip-ascent
: Automatically discovers the requirements file. -
pip-ascent requirements.txt
-
pip-ascent requirements/dev.txt requirements/production.txt
-
pip-ascent requirements.txt -pk django -pk celery
-
pip-ascent requirements.txt -pk all
-
pip-ascent requirements.txt --dry-run
: Runs everything as a simulation (does not perform the actual upgrade)
Leave a ⭐ if you find this project cool.
MIT
Note: This package is just starting out feel free to make contributions.