Skip to main content

An interactive pip requirements upgrader. It also updates the version in your requirements.txt file.

Project description

pip-upgrader CI PyPI License

An interactive pip requirements upgrader. Because upgrading requirements, package by package, is a pain in the ass. It also updates the version in your requirements.txt and pyproject.toml files.

Purpose

This cli tool helps you interactively(or not) upgrade packages from requirements files, pyproject.toml (PEP 621), or Poetry projects, and also update the pinned version in-place.

If no requirements are given, the command attempts to detect requirements file(s) and pyproject.toml in the current directory.

Quick preview:

image

Installation

uv tool install pip-upgrader

or with pip:

pip install pip-upgrader

Requires Python 3.10+

To avoid installing all these dependencies in your project, you can install pip-upgrader as a tool (via uv tool install) or in your system Python, rather than your virtualenv.

Usage

CD into your project. Then:

$ pip-upgrade

This will update the pinned versions in your requirements files. You then install yourself with uv sync, pip install -r requirements.txt, or whatever you use.

Arguments:

requirements_file(s)          The requirement FILE, WILDCARD PATH to multiple files, or pyproject.toml. (positional arguments)
--prerelease                  Include prerelease versions for upgrade, when querying pypi repositories.
-p <package>                  Pre-choose which packages to upgrade. Skips any prompt.
--dry-run                     Simulates the upgrade, but does not execute the actual upgrade.
--skip-greater-equal          Skip packages with >= pins (by default both == and >= are checked).
--use-default-index           Skip searching for custom index-url in pip configuration file(s).
--timeout <seconds>           Set a custom timeout for PyPI requests (default: 15 seconds).

Examples:

pip-upgrade             # auto discovers requirements file(s) and pyproject.toml
pip-upgrade requirements.txt
pip-upgrade pyproject.toml
pip-upgrade requirements/dev.txt requirements/production.txt

# skip prompt and manually choose some/all packages for upgrade
pip-upgrade requirements.txt -p django -p celery
pip-upgrade requirements.txt -p all

# upgrade dependencies in pyproject.toml (PEP 621)
pip-upgrade pyproject.toml -p all

# upgrade dependencies in a Poetry project
pip-upgrade pyproject.toml -p all

# include pre-release versions
pip-upgrade --prerelease

# skip packages pinned with >= (only upgrade == pins)
pip-upgrade --skip-greater-equal

# set a custom timeout for PyPI requests
pip-upgrade --timeout 30

Supported Formats

  • requirements.txt (and .pip, .in variants) — == and >= pins
  • pyproject.toml (PEP 621)[project.dependencies] and [project.optional-dependencies]
  • pyproject.toml (Poetry)[tool.poetry.dependencies] and [tool.poetry.group.*.dependencies]
    • String format: Django = "==1.10", requests = ">=2.25.0,<3.0.0"
    • Dict format: django-rest-auth = {version = "==0.9.0", extras = ["with_social"]}
    • Only == and >= pins are upgraded (caret ^, tilde ~, and wildcard * pins are skipped)

Development

This project uses uv for dependency management:

uv sync --extra test --extra dev   # install all dependencies
uv run pytest                      # run tests
uv run ruff check .                # lint
uv run ruff format --check .       # check formatting

Releasing

Releases are published to PyPI automatically via GitHub Actions when a version tag is pushed:

git tag v2.1.0
git push origin v2.1.0

This triggers the publish.yml workflow which builds and publishes to PyPI using trusted publishers (OIDC).

Project details


Download files

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

Source Distribution

pip_upgrader-2.1.0.tar.gz (420.9 kB view details)

Uploaded Source

Built Distribution

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

pip_upgrader-2.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file pip_upgrader-2.1.0.tar.gz.

File metadata

  • Download URL: pip_upgrader-2.1.0.tar.gz
  • Upload date:
  • Size: 420.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pip_upgrader-2.1.0.tar.gz
Algorithm Hash digest
SHA256 39a883480ea19e747256c1f83552bc239becc173e1376e465cd945b365359ea0
MD5 8b6987e9a06628a86ee2487d7725ef3b
BLAKE2b-256 5e9f76dbc1488b9cbd51cd0655026d65b6dba1de481aaf5ff46cf66cee4094fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_upgrader-2.1.0.tar.gz:

Publisher: publish.yml on simion/pip-upgrader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pip_upgrader-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: pip_upgrader-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pip_upgrader-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e92fce13f316117361c717120f0714127a08b0d51e4d35f286a7d860d211fcd
MD5 74db2b06f2f486e88ec287c7b5052604
BLAKE2b-256 e16181fbffa9cf342bdf56a3697813a14b33100a9bdf89e455dccc514b7bb85a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pip_upgrader-2.1.0-py3-none-any.whl:

Publisher: publish.yml on simion/pip-upgrader

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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