Skip to main content

Version bumping tool for Python projects using pyproject.toml, similar to npm version

Project description

bumpuv

PyPI - Version PyPI - Python Version Last Commit License: MIT

English | 日本語

A CLI tool similar to npm version and uv version --bump written in Python. uv version --bump with added git processing. Reference: npm-version

Performs npm version-like operations on pyproject.toml files for Astral uv (and poetry, etc. PEP 621 compliant tools). Primarily used for triggering GitHub Actions.

Installation and Usage

# Using uv
uv add bumpuv --dev
uv run bumpuv <options>

# Or
uvx bumpuv <options>

# Or
uv tool install bumpuv
bumpuv <options>

# Using pip
pip install bumpuv
bumpuv <options>

# Using poetry
poetry add --group dev bumpuv
poetry run bumpuv <options>

Usage

bumpuv [<newversion> | major | minor | patch | bump] [-n|--dry-run] [-h|--help]

Version Update Types

  • major: Increment major version by 1 (1.2.3 → 2.0.0)
  • minor: Increment minor version by 1 (1.2.3 → 1.3.0)
  • patch: Increment patch version by 1 (1.2.3 → 1.2.4)
  • bump: Default. Same as patch for normal versions, increment number by 1 for pre-release versions (1.2.3a1 → 1.2.3a2)
  • <newversion>: Explicit version specification (converted to PEP 440 compliant format)

Options

  • -n, --dry-run: Show what would be done without making changes. No prior commit required
  • -h, --help: Show help message

Examples

Basic Usage

# Increment patch version (1.0.0 → 1.0.1)
bumpuv patch

# Increment minor version (1.0.1 → 1.1.0)
bumpuv minor

# Increment major version (1.1.0 → 2.0.0)
bumpuv major

# Default behavior (same as bump)
bumpuv

Explicit Version Specification

# Set to specific version
bumpuv 1.5.0

# Set to pre-release version
bumpuv 2.0.0a1

# Release candidate
bumpuv 1.0.0rc1

Pre-release Version Management

# Increment pre-release number (1.0.0a1 → 1.0.0a2)
bumpuv bump

# From pre-release to stable (explicit specification)
bumpuv 1.0.0

Dry-run Mode

# Check changes (no actual changes made)
bumpuv patch -n
bumpuv minor --dry-run

Output Examples

$ bumpuv patch
Updated: /path/to/project/pyproject.toml
Version: 1.0.0 → 1.0.1
Commit: 1.0.1
Tag: v1.0.1

$ bumpuv 2.0.0a1
Updated: /path/to/project/pyproject.toml
Version: 1.0.1 → 2.0.0a1
Commit: 2.0.0a1
Tag: test-2.0.0a1

Specification

Basic Behavior

  • Default is equivalent to bumpuv bump
  • PEP 440 compliant version management
  • Same version and downgrades are not allowed
    • Downgrade example: 1.0.0 > 1.0.0a1
  • Switching between pre-release and normal versions requires explicit version specification
    • Example: 1.0.01.1.0a1 requires bumpuv 1.1.0a1
    • Example: 1.0.0a11.0.0 requires bumpuv 1.0.0

Git Integration

  • Important: All changes must be committed beforehand
  • After updating pyproject.toml in current directory, automatically commits and creates tags
    • Commit message: New version number
    • Tag: v{version} for normal versions, test-{version} for pre-release versions
  • Does not perform git push. You must manually run git push and git push --tags

Error Conditions

  • pyproject.toml does not exist in current directory
  • project.version does not exist or is not PEP 440 compliant
  • Not a git repository
  • Uncommitted changes exist (warning only in dry-run mode)

Limitations

  • Configuration files not supported
  • Monorepo support not implemented

Similar Tools

Development

Setup

uv sync

Task Execution

# Run tests
poe test

# Lint
poe check

# Type check
poe mypy

# Run all checks & build & smoke test
poe build

Development Requirements

  • uv
  • Python == 3.12, 3.10 (for test)

License

MIT

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

bumpuv-0.0.4.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

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

bumpuv-0.0.4-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file bumpuv-0.0.4.tar.gz.

File metadata

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

File hashes

Hashes for bumpuv-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ae98067d3a985ee2b2803b97328850ad5a31a19f70efb0a0d28379de979d5449
MD5 b23e18eaa8060afb2c4e6cb101b65741
BLAKE2b-256 39ee61598aeea54a90b68fc086981ae5d54c1ac93c7b857a16b6ddaa7e1ab931

See more details on using hashes here.

Provenance

The following attestation bundles were made for bumpuv-0.0.4.tar.gz:

Publisher: publish-pypi.yml on heiwa4126/bumpuv

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

File details

Details for the file bumpuv-0.0.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for bumpuv-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc386a9bc455a39a6ecdc4e25de2e243d630d3aca0a46872fdfcb779bf5455dd
MD5 09e2d0b764c2f724982a06fb5571f9f4
BLAKE2b-256 054be5e35f8a6320d394e734b8b395a3813cff809ebf24574176e0298863b5fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for bumpuv-0.0.4-py3-none-any.whl:

Publisher: publish-pypi.yml on heiwa4126/bumpuv

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