pip-update-requirements
Update the packages in a requirements.txt file.
Installation
pip install pur
Usage
Give pur your requirements.txt file and it updates all your packages to the latest versions.
For example, given a requirements.txt file:
flask==0.9 sqlalchemy==0.9.10 alembic==0.8.4
Running pur on that file updates the packages to current latest versions:
$ pur -r requirements.txt Updated flask: 0.9 -> 1.0.2 Updated sqlalchemy: 0.9.10 -> 1.2.8 Updated alembic: 0.8.4 -> 0.9.9 All requirements up-to-date.
Pur never modifies your environment or installed packages, it only modifies your requirements.txt file.
You can also use Pur directly from Python:
$ python
Python 3.6.1
>>> from pur import update_requirements
>>> print([x[0]['message'] for x in update_requirements(input_file='requirements.txt').values()])
['Updated flask: 0.9 -> 1.0.2', 'Updated sqlalchemy: 0.9.10 -> 1.2.8', 'Updated alembic: 0.8.4 -> 0.9.9']
>>> print(open('requirements.txt').read())
flask==1.0.2
sqlalchemy==1.2.8
alembic==0.9.9
Options
- -r, --requirement PATH
The requirements.txt file to update; Defaults to using requirements.txt from the current directory if it exist.
- -o, --output PATH
Output updated packages to this file; Defaults to overwriting the input requirements.txt file.
- -i, --interactive
Interactively prompts before updating each package.
- -f, --force
Force updating packages even when a package has no version specified in the input requirements.txt file.
- -d, --dry-run
Output changes to STDOUT instead of overwriting the requirements.txt file.
- -n, --no-recursive
Prevents updating nested requirements files.
- -s, --skip TEXT
Comma separated list of packages to skip updating.
- --index-url TEXT
Base URL of the Python Package Index. Can be provided multiple times for extra index urls.
- --verify PATH
Path to PEM-encoded CA certificate bundle. If provided, overrides the default.
- --only TEXT
Comma separated list of packages. Only these packages will be updated.
- -m, --minor TEXT
Comma separated list of packages to only update minor versions, never major. Use “*” to limit every package to minor version updates.
- -p, --patch TEXT
Comma separated list of packages to only update patch versions, never major or minor. Use “*” to limit every package to patch version updates.
- --pre TEXT
Comma separated list of packages to allow updating to pre-release versions. Use “*” to allow all packages to be updated to pre-release versions. By default packages are only updated to stable versions.
- -z, --nonzero-exit-code
Exit with status 10 when all packages up-to-date, 11 when some packages were updated. Defaults to exit status zero on success and non-zero on failure.
- --version
Show the version and exit.
- --help
Show this message and exit.
Contributing
Before contributing a pull request, make sure tests pass:
virtualenv venv . venv/bin/activate pip install tox tox
Many thanks to all contributors!
Metadata
Release files for pur 5.4.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pur-5.4.3.tar.gz | 1.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pur-5.4.3-py2-none-any.whl | Python 2 | none | any | Details |
Total release size: 2.2 MB
Release files / pur-5.4.3.tar.gz
| Download URL | pur-5.4.3.tar.gz |
|---|---|
| Size | 1.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79a6ceb08a9295a9507b0aacc90c7044a6175c0e1857ecfacde0859a95da7e07
|
|
BLAKE2b-256 checksum How to use checksums |
a20c443f857651de2c2f2d0be6e9ffe28afc0e4bbe3b9a952f315d529498a54f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|
Release files / pur-5.4.3-py2-none-any.whl
| Download URL | pur-5.4.3-py2-none-any.whl |
|---|---|
| Size | 1.2 MB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
7b81ec2dc9cd30550b9e6d27c677f4d443e7d2f0d07386c50d0721b6d903935d
|
|
BLAKE2b-256 checksum How to use checksums |
20a0854f3d3b8af05aeaed06911788b69d9ca6192ce60d9e0e1ab4c01684885f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9
|