An intelligent, feature-rich CLI tool to manage and upgrade Python packages with a clean, modern interface and a powerful dependency safety-net.
- 🛡️ Atomic Upgrades with Rollback: If an upgrade fails for any reason (e.g., compilation error, network issue), the tool automatically reverts the package to its previous stable version. This ensures your environment is never left in a broken state.
- 🔎 Intelligent Dependency Analysis: Performs a pre-flight check using
pipto detect and warn you about potential dependency conflicts before you upgrade. - ⚡ Concurrent & Fast: Upgrades packages in parallel using a configurable number of workers, dramatically reducing the time you spend waiting.
- 📊 Rich & Interactive UI: Uses
richto display outdated packages in a clean, readable table with clear progress bars and status updates. - 🎯 Selective Upgrades: Upgrade all packages at once, or specify exactly which packages to include or exclude from an upgrade operation.
- ⛑️ Safety First: Includes a
--dry-runmode to see what would be upgraded without making any changes to your environment. - 🤖 Automation Friendly: A
--yesflag allows for non-interactive use in automated scripts and CI/CD pipelines.
The tool is available on PyPI. Install it with pip:
pip install ultimate-python-upgraderOnce installed, the py-upgrade command will be available.
1. Check for outdated packages and upgrade all interactively
py-upgrade2. Upgrade specific packages
py-upgrade requests numpy3. Upgrade all packages except a few
py-upgrade --exclude black ruff4. Perform a dry run to see what needs upgrading
py-upgrade --dry-run5. Run non-interactively for automation
py-upgrade --yes6. Increase concurrency for faster upgrades
py-upgrade --workers 20Contributions are welcome! This project uses black for formatting and ruff for linting.
To get started with development:
- Clone the repository.
- Create a virtual environment:
python -m venv .venv - Activate it:
source .venv/bin/activate(or.\venv\Scripts\activateon Windows) - Install the project in editable mode with all development dependencies:
pip install -e ".[test,dev]" - Run tests with
pytest.
Please feel free to submit a pull request for any improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.