Skip to main content

pyupcheck

Check if upgrading a Python dependency will break your code.

$ pyupcheck check-all

Found 12 dependencies to check

flask 2.3.3 -> 3.1.3  OK (15 usages safe)
requests 2.28.0 -> 2.34.2  2 BREAKING
  x src/api.py:23  resp = requests.get(url, verify=False)
    Removed: `verify` parameter no longer accepted
django 4.2.0 -> 5.0.6  1 deprecated
  ! core/models.py:8  from django.utils import timezone
    Deprecated: use datetime.timezone instead

2 breaking | 1 deprecated across 12 packages

Install

pip install pyupcheck

Commands

check - check one package

pyupcheck check flask 3.0.0        # against specific version
pyupcheck check flask              # against latest

check-all - check every dependency

Reads requirements.txt and pyproject.toml (PEP 621 and Poetry), checks every dependency against its latest version.

pyupcheck check-all
pyupcheck check-all --format html -o report.html

outdated - list stale dependencies

pyupcheck outdated

Flags major version bumps separately since they carry the most risk.

diff - changelog diff between versions

See breaking/deprecated changes between any two versions without scanning code:

pyupcheck diff django 4.2.0 5.0.0

scan - list your usages of a package

pyupcheck scan requests

versions and cache-clear

pyupcheck versions flask
pyupcheck cache-clear

Output formats

pyupcheck check flask -f json          # machine-readable
pyupcheck check flask -f md -o r.md   # markdown report
pyupcheck check flask -f html -o r.html # styled HTML report

CI integration

Exit code is 1 when the --fail-on condition is met:

pyupcheck check-all --fail-on breaking     # default
pyupcheck check-all --fail-on deprecated   # stricter
pyupcheck check-all --fail-on any          # strictest
pyupcheck check-all --fail-on never        # report only

GitHub Actions example:

- name: Check dependency upgrades
  run: |
    pip install pyupcheck
    pyupcheck check-all --fail-on breaking --quiet

Pre-commit hook (.pre-commit-config.yaml):

- repo: local
  hooks:
    - id: pyupcheck
      name: pyupcheck
      entry: pyupcheck check-all --quiet
      language: system
      pass_filenames: false

Configuration

pyproject.toml:

[tool.pyupcheck]
exclude = ["migrations", "legacy"]
ignore = ["internal-package"]
fail_on = "breaking"
min_severity = "deprecated"
cache = true

Or .pyupcheckignore:

migrations/          # trailing slash = directory
legacy/
internal-package     # no slash = package to skip

Features

  • AST-based scanning: imports, from-imports, aliases, attribute chains, calls
  • Jupyter notebook (.ipynb) scanning, magics stripped automatically
  • Changelog sources: GitHub releases, raw changelog files, PyPI descriptions
  • 24h response cache (--no-cache to bypass, cache-clear to wipe)
  • Severity filtering with --min-severity
  • Quiet mode (-q) for hooks and scripts

Limitations

  • Changelog parsing relies on maintainers writing structured changelogs
  • Dynamic attribute access (getattr(pkg, name)) is not detected
  • GitHub API is rate limited to 60 req/hr unauthenticated; pass --github-token or set GITHUB_TOKEN for higher limits

Contributing

Contributions are welcome. Here is how to get started:

git clone https://github.com/AgbaDev/pyupcheck.git
cd pyupcheck
pip install -e ".[dev]"

Things that would genuinely improve the tool:

  • Better changelog parsing for packages that use unconventional formats (e.g. Sphinx-based changelogs, HISTORY files)
  • Support for setup.cfg and setup.py dependency parsing
  • Detection of dynamic attribute access patterns (getattr, __import__)
  • pip-tools and conda lockfile support
  • A --watch mode that monitors your lockfile for changes and alerts on risky upgrades
  • Test coverage

To contribute, open an issue describing what you want to work on, then submit a pull request. Please include a short test or example showing the bug or feature.

If you find a package whose changelog pyupcheck fails to parse correctly, open an issue with the package name and version range. That is the most common and most impactful thing to fix.

License

MIT

Download files

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

Source Distribution

pyupcheck-0.3.3.tar.gz (23.6 kB view details)

Uploaded Source

Built Distribution

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

pyupcheck-0.3.3-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file pyupcheck-0.3.3.tar.gz.

File metadata

  • Download URL: pyupcheck-0.3.3.tar.gz
  • Upload date:
  • Size: 23.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for pyupcheck-0.3.3.tar.gz
Algorithm Hash digest
SHA256 9603047b102c406ea0ed0e857f18610abdacca435c1ed7acbd8c66bc0864d0a0
MD5 e7e664387e7af068be1e85f62cb4ced2
BLAKE2b-256 8115a46fc7a8bb589d182dceb642c20d27933b2d90c7b3fd87641390496b5d59

See more details on using hashes here.

File details

Details for the file pyupcheck-0.3.3-py3-none-any.whl.

File metadata

  • Download URL: pyupcheck-0.3.3-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.12.3

File hashes

Hashes for pyupcheck-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 951265c3d7ba6afac4150f30e4774160ce4a0fbfeca92f31f9cfe4f50197a309
MD5 d561a9d0dca2e8fb34b9393ae61b8433
BLAKE2b-256 1928ff28431928995951065d02b5816145417b24e986261752403a439db92d5d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page