Skip to main content

Bump Python package dependencies in pyproject.toml

Project description

bump-dependencies

Bump your Python package dependencies

Update dependency specifiers in pyproject.toml to latest versions


Supported Python Versions


About:

bump_dependencies is a Python CLI program that generates a new packaging configuration file (pyproject.toml) file with updated package dependencies.

Requirements:

  • Python 3.10+

Installation:

Install from PyPI:

pip install bump-dependencies

CLI Options:

usage: bump_dependencies [-h] [--dry-run] [--path PATH]

options:
  -h, --help   show this help message and exit
  --dry-run    don't write changes to pyproject.toml
  --path PATH  path to pyproject.toml (defaults to current directory)

Usage:

Install from PyPI with pipx, Run:

pipx install bump-dependencies
bump_dependencies

Clone Repo, Create/Activate Virtual Environment, Install from Source, Run:

git clone git@github.com:cgoldberg/bump-dependencies.git
cd ./bump-dependencies
python3 -m venv venv
source venv/bin/activate
pip install .
bump_dependencies

Example:

If your pyproject.toml contains this:

[project]
... some metadata ...
dependencies = ["matplotlib~=3.9", "requests==2.29.0"]

[project.optional-dependencies]
socks = ["PySocks>=1.5.6"]

[dependency-groups]
dev = ["black==23.9.1", "ruff==0.9.5"]
test = ["pytest>8", "pytest-mock>=3.11"]

It will update dependency specifiers to the latest versions available on PyPI:

[project]
... some metadata ...
dependencies = ["matplotlib~=3.10.3", "requests==2.32.4"]

[project.optional-dependencies]
socks = ["PySocks>=1.7.1"]

[dependency-groups]
dev = ["black==25.1.0", "ruff==0.12.1"]
test = ["pytest>8.4.1", "pytest-mock>=3.14.1"]

Which sections of pyproject.toml will be updated?

It will update dependency specifiers listed in various sections of pyproject.toml:

  • dependencies list from [project] section
  • dependency lists from [project.optional-dependencies] section
  • dependency lists from [dependency-groups] section

Which dependency specifiers will be updated?

  • will only update dependency specifiers with version identifier containing comparison operator: ==, ===, ~=, >, >=
    • example:
      • foo==1.0.0
      • foo~=1.0
      • foo>=1
  • will not update dependency specifiers with version identifier containing comparison operator: <, <=, !=
    • example:
      • foo<2.0
      • foo>=1,<2
      • foo > 1.0, != 1.0.1
  • will not update unversioned dependency specifiers
    • example:
      • foo
      • foo[bar]
  • will not update direct reference dependency specifiers
    • example:
      • foo @ https://github.com/foo/foo/archive/1.0.0.zip
      • foo @ file:///builds/foo-1.0.0-py3-none-any.whl

Supported comparison operators in version identifiers:

  • == : version matching
  • === : arbitrary equality
  • ~= : compatible release
  • > : exclusive ordered comparison
  • >= : inclusive ordered comparison

Unsupported comparison operators in version identifiers:

  • < : exclusive ordered comparison
  • <= : inclusive ordered comparison
  • != : version exclusion

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

bump_dependencies-0.1.3.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

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

bump_dependencies-0.1.3-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file bump_dependencies-0.1.3.tar.gz.

File metadata

  • Download URL: bump_dependencies-0.1.3.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for bump_dependencies-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8fe4519ab6270c47743c7e0a64034417673b2064fd34109bdf8df31716f12b05
MD5 93fc03abea45536cdb97ea0b3584d7b7
BLAKE2b-256 b7258f39fccd7021f7eddca9733038472f6713b30beddda2752345286ffa0f5a

See more details on using hashes here.

File details

Details for the file bump_dependencies-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for bump_dependencies-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b5ad8edc1e111c6e6570206e66bf60ee3ac7264a85fe83dab5657b53fe21aa6a
MD5 cf5856141aaaa356f07aa61371971d81
BLAKE2b-256 e0ab0f26e2eac87b2a12a1ae28e2bc40e6b2ea3bb7dcf7bcae8d625380bb5dcf

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