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.2.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.2-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyupcheck-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ecd0e4be16b5229774bd0643262a157a42db2b13a574668aa567ad19bcc3a9de
MD5 2a2c58695a5a9e495087c48919030b65
BLAKE2b-256 4d7929c65928cc75a5713bd2929e112aa57925a565efc192f0a187ae240a07c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyupcheck-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 24.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5543a42d28e3eb35601bfba77b06b66145ce6dcdf0eb42cd9180d4d7dce8f6d4
MD5 c7782e149bf17aa77c979ec94d04fb23
BLAKE2b-256 e150e1c2e8728f1434ae8387a35e05d62a6595761361c4bbf04cb36ed1fdb3a3

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