Skip to content

tdiprima/pyupgradecheck

Repository files navigation

🐍 pyupgradecheck

PyPI CI

💡 Check your Python packages before you upgrade. Find out which of your dependencies are ready for your next Python version — and which ones might ruin your day.

🚀 Installation

pip install pyupgradecheck

⚡️ Quickstart

# Test all installed packages
pyupgradecheck 3.14

Example Output:

requests 2.32.3: supported (PyPI requires_python: >=3.7)
some-old-lib 1.2.0: incompatible (PyPI requires_python: <3.10)

⚙️ CLI Options Explained

🧩 --packages / -p

Manually specify one or more packages to check instead of scanning everything installed.

pyupgradecheck 3.14 --packages requests pandas httpx
# or short form:
pyupgradecheck 3.14 -p requests pandas httpx

Useful when you just want to sanity-check a few libs before doing a full environment sweep.

📦 --requirements / -r

Check packages listed in a requirements.txt file.

pyupgradecheck 3.14 --requirements requirements.txt
# or short form:
pyupgradecheck 3.14 -r requirements.txt

Great for CI pipelines or testing a project's dependency file without needing a full virtualenv.

💾 --json

Emit results in JSON instead of human-readable text.

pyupgradecheck 3.14 --json > compat-report.json

Perfect for CI/CD jobs or when you want to post-process results with another tool.

🧠 --strict

Be extra cautious — only marks a package as supported if both PyPI metadata (requires_python) and package classifiers agree on the target Python version.

pyupgradecheck 3.14 --strict

This reduces false positives from packages that claim support but might not actually work yet. If either data source disagrees or is missing, the status will be "unknown".

⚗️ Combo Examples

# Check just a few packages, strict mode, JSON output
pyupgradecheck 3.14 -p fastapi uvicorn pydantic --strict --json

# Check all from requirements.txt, strict mode
pyupgradecheck 3.14 -r requirements.txt --strict

💬 CLI Help

pyupgradecheck --help

🤔 Why pyupgradecheck?

Because upgrading Python shouldn't be a trust fall.
Quickly see which of your installed packages can handle your target Python version — before you break your dev environment or CI build.

⚠️ Disclaimer

pyupgradecheck checks declared compatibility, not guaranteed runtime behavior.

It uses metadata from PyPI (requires_python) and package classifiers to estimate whether a library supports your target Python version.

That means:

  • Some packages may say they support Python 3.13+, but still fail at runtime.
  • C-extension builds, dependency pins, or missing wheels might break your install.
  • Metadata may lag behind reality (maintainers forget to update it).

Always test your environment in a virtualenv before upgrading production systems. This tool gives you a heads-up, not a promise. 😅

❤️ Contributing

Pull requests welcome 💖
Run tests with:

pytest

🧩 Perfect for

  • 🧪 CI/CD pipelines
  • 🐍 Devs upgrading their local environments
  • 🧠 Maintainers checking project compatibility

About

Check if your installed packages are compatible with future Python versions

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages