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. Since puc updates pinned dependencies, it is mostly suitable when developing applications.

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 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.

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_update_checker-1.3.0.tar.gz (22.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_update_checker-1.3.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file python_update_checker-1.3.0.tar.gz.

File metadata

  • Download URL: python_update_checker-1.3.0.tar.gz
  • Upload date:
  • Size: 22.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for python_update_checker-1.3.0.tar.gz
Algorithm Hash digest
SHA256 7711df1e97bb2a066c6108f94e896a1262b0d9dbb340925c43f2c9b3889b1ca0
MD5 414440e3092833b72af91c8f8d721361
BLAKE2b-256 6911d639e253b62b7f03782cdd1bb7749363e49fc8d9c8f24db19ba53991d47c

See more details on using hashes here.

File details

Details for the file python_update_checker-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: python_update_checker-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","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

Hashes for python_update_checker-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 11e1c0d0bbb2028914f2d6a67ef52a6a9d7b912a7b84f5deed3e2f3a4481c59d
MD5 42c21cb91367e56bfad652985653790d
BLAKE2b-256 d1314fb468a52d954f5c0af9754d3aa0cd1ca23b22bb3681c2f4b0cb4c8b081e

See more details on using hashes here.

Release history Release notifications | RSS feed

1.4.0

2 files

This release

1.3.0 This release

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7

2 files

0.6

2 files

0.5

2 files

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