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 written in Python. 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.1.tar.gz (5.6 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.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bumpuv-0.0.1.tar.gz
  • Upload date:
  • Size: 5.6 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.1.tar.gz
Algorithm Hash digest
SHA256 515de1655c2f3ea97dd6e26a71ea2da7d4d48fb67308f736394b7006a7d1dfdc
MD5 c766935643f5efcd56306cf200ab4a64
BLAKE2b-256 3660da3ac1980bb237a6c8208046c4fdd1448143de6e5552e23774b8a853e399

See more details on using hashes here.

Provenance

The following attestation bundles were made for bumpuv-0.0.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: bumpuv-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 6.6 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5b9a27316cee62797e137b1e54d13f2e025a4cf91008ccf4ba4a2488c9201ee
MD5 419b82e9e5b6808e382ff4fbbf2bd244
BLAKE2b-256 ef78030144a4fa9af55694d20e94013dcf20730cebed82f3c3a39902e781d77c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bumpuv-0.0.1-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