No project description provided
Project description
python-update-checker
Python-update-checker (puc) checks or updates pinned dependencies
in pyproject.toml, requirements.txt or uv.lock files.
See https://github.com/astral-sh/uv/issues/6794 for a discussion about different pinning strategies.
Features
- updates pinned dependencies, ignores unpinned dependencies
- supports pyproject.toml, uv.lock and requirements.txt formats
- supports
[project.dependencies],[project.optional-dependencies]and[dependency-groups]in pyproject.toml - supports recursive references (-r) in requirements.txt formats
- can run in check only mode, ie. it checks if updates are available
- limit updates to specific packages
- limit updates with package version constraints (ie. "django<6")
- limit updates to versions that were uploaded prior to a given date
- (limited) support for environment markers, ie.
"pywin32==311; os_name=='nt'" - runs on Linux, MacOS and Windows platforms
Examples
$ # check all pinned packages for updates in pyproject.toml
$ puc check pyproject.toml
puc INFO: check pyproject file pyproject.toml
puc WARNING: found update 'ty==0.0.29' --> 0.0.32
$ # update all pinned packages in pyproject.toml
$ # limit updates to versions that are at least 7 days old
$ puc --exclude-newer="7 days" update pyproject.toml
puc INFO: update pyproject file pyproject.toml
puc INFO: updating 'ty==0.0.29' --> 0.0.31
puc INFO: Wrote 1 updated package version(s) to pyproject.toml
$ # check all pinned packages for updates in requirements.txt
$ puc check requirements.txt
puc INFO: check requirements file requirements.txt
puc WARNING: found update 'argcomplete==3.6.1' --> 3.6.3
puc WARNING: found update 'Django==5.2.0' --> 6.0.4
$ # update only the django package version in requirements.txt
$ # limit updates to django versions less than 6
$ puc --package="Django" --constraints="Django<6" update requirements.txt
INFO: update requirements file requirements.txt
INFO: updating 'Django==5.2.0' --> 5.2.13
INFO: Wrote 1 updated package version(s) to requirements.txt
Script behaviour
The exit code of puc check is non-zero when updates are available.
Checking a pyproject.toml or uv.lockfile with puc should be done
from the project of the pyproject.toml file,
especially if your project relies on a project directory (for example to define additional packages index in pyproject.toml).
After updating versions in pyproject.toml, run uv lock --upgrade to update
the transitive dependencies in uv.lock.
Pinned dependencies are packages with == or === constraints and no wildcards in the version.
Installation
- Install python uv
- Install puc with
uv pip install python-update-checker.
Architecture
Dependencies are
-
uv: The uv binary must be available for the script to call.
puc usesecho "package" | uv pip compile -to get latest package versions.
puc usesuv add "package==<version>"to update pyproject.toml dependencies. -
packaging: Parses dependencies with the packaging.requirements.Requirement class.
puc needs Python >= 3.11 since it uses the tomllib Python module.
puc consists of a single python script. The script uses inline script metadata to be executed directly with uv run --script.
This enables simple packaging and installation.
Limitations
- No support for custom dependency formats in pyproject.toml
(eg.
[tool.poetry.dependencies]). - puc has limited support for environment markers.
- Constraint references (
-c) inside requirements.txt are not supported.
Use the--constraintsoption instead.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_update_checker-0.5.tar.gz.
File metadata
- Download URL: python_update_checker-0.5.tar.gz
- Upload date:
- Size: 20.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6e397b11a6c29db94f8bfa95b86cbde4d288f576c454c222f23c9d57d031bbd8
|
|
| MD5 |
94cbb467b057e5cbdad54dc6dc4d562c
|
|
| BLAKE2b-256 |
d13330a4051fabd757096bcf1dfd08564638dc2d7a0b8732e386fb5534170ff4
|
File details
Details for the file python_update_checker-0.5-py3-none-any.whl.
File metadata
- Download URL: python_update_checker-0.5-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b746ab80b9a8dfbf5990413566039e26fa539daf41ae498548d9f01842418dd2
|
|
| MD5 |
f1c0e7553ec89c0ed67ff57658b9c619
|
|
| BLAKE2b-256 |
b22742b664a296ffe4e11fa45fccfc310854140817f0a05abb853ebcc624527e
|