Skip to main content

python-update-checker

Python-update-checker (puc) checks or updates pinned dependencies in pyproject.toml, requirements.txt or uv.lock files.

If you are developing an application you should pin all dependencies. When developing a library, only development dependencies should be pinned.

See [https://github.com/astral-sh/uv/issues/6794] for a discussion about different pinning strategies.

Quickstart

# update dependencies in pyproject.toml to the latest version
uvx --from python-update-checker puc --exclude-newer="7 days" update pyproject.toml
# install updated dependencies in virtual environment
uv sync

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 legacy dependency format [tool.uv.dev-dependencies] 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
  • can ignore 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
$ # update the project environment after upgrading pyproject.toml
$ uv sync

$ # 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
puc INFO: update requirements file requirements.txt
puc INFO: updating 'Django==5.2.0' --> 5.2.13
puc 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 directory of the pyproject.toml file, especially if your project relies on a project directory (for example to define additional package indexes in pyproject.toml).

After updating versions in pyproject.toml, run uv lock --upgrade to update the transitive dependencies in uv.lock and uv sync to update your virtual environment.

Pinned dependencies are packages with == or === constraints and no wildcards in the version.

Installation

  1. Install python uv
  2. Install puc with uv pip install python-update-checker or run with uvx --from python-update-checker puc ...

Architecture

Dependencies are

  • uv: The uv binary must be available for the script to call.
    puc uses echo "package" | uv pip compile - to get latest package versions.
    puc uses uv add "package==<version>" to update pyproject.toml dependencies and uv lock --upgrade-package to update uv.lock dependencies.

  • packaging: Parses dependencies with the packaging.requirements.Requirement class.

puc needs Python >= 3.11 since it uses the tomllib Python module.

Updating minimum version requirements

Dependencies like requests>=1.12 or django>5 specify a minimum version requirement.

Minimum requirements are necessary to work with different versioned dependencies, since different distributions package different versions of those dependencies. Minimum requirements change when the project uses a feature that is only available in newer versions of a dependency. This cannot be determined automatically by puc. So minimum version requirements should be updated manually.

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 --constraints option instead.
  • No support for updating non-pinned dependencies.

Metadata

Release files for python-update-checker 1.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for python-update-checker 1.5.0
File Size Uploaded Provenance Actions
python_update_checker-1.5.0.tar.gz 24.4 kB Without provenance Details for python_update_checker-1.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for python-update-checker 1.5.0
File Interpreter ABI Platform Actions
python_update_checker-1.5.0-py3-none-any.whl Python 3 none any Details for python_update_checker-1.5.0-py3-none-any.whl

Total release size: 39.3 kB

Release files / python_update_checker-1.5.0.tar.gz

Download URL python_update_checker-1.5.0.tar.gz
Size 24.4 kB
Tags Source
SHA-256 checksum
How to use checksums
12c39d4e15ac10d0816dc5a0d5acf6b1db7fcf33ff891664fc0852ae88ae8c07
BLAKE2b-256 checksum
How to use checksums
623bd8b0a3218141eb9ab8a7a428b5b32e0597dea65e78c058f9dabf393bae48
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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}

Release files / python_update_checker-1.5.0-py3-none-any.whl

Download URL python_update_checker-1.5.0-py3-none-any.whl
Size 14.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8b04cc82020b6b4492971061638834ba35c681e95354ed745ef58eb0c067bb2
BLAKE2b-256 checksum
How to use checksums
0d2a296c44ab1de0cb7baaea1ef2225e3df4a4620abfe8c473bb14c00f3afa14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","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}

Security for python-update-checker 1.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page