Skip to main content

Check and normalize PEP 440 version strings in pyproject.toml

Project description

pep440check

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

A utility to check if version strings in pyproject.toml's project.version are PEP 440 compliant and suggest normalized forms if they are not. Optionally, it can rewrite the file with the normalized version.

Basic usage

pep440check [-h] [-w] [-V] [path]
  • path: path to pyproject.toml (defaults to current directory's pyproject.toml if omitted)
  • -w, --write: write normalized version back to file
  • -h, --help: show help message and exit
  • -V, --version: show program's version number and exit

Exit codes

  • 0: Version is already PEP 440 compliant (displays "OK")
  • 1: Version needs normalization or error occurred

Output examples

When version is already normalized:

$ pep440check
Target: /path/to/pyproject.toml
OK: 0.0.1a1

When version needs normalization:

$ pep440check
Target: /path/to/pyproject.toml
Original version: 1.0.0-rc1
Suggested normalized version: 1.0.0rc1

Writing normalized version:

$ pep440check -w
Target: /path/to/pyproject.toml
Normalized version: 1.0.0-rc1 -> 1.0.0rc1

Installation and Usage

uv add pep440check --dev
uv run pep440check [args]

or

uvx pep440check [args]

or

uv tool install pep440check
pep440check [args]

Development

git clone https://github.com/heiwa4126/pep440check.git
cd pep440check
uv sync

Run tests:

uv run poe test

Run linter and formatter:

uv run poe check

Type checking:

uv run poe mypy

Build package:

uv run poe build

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

pep440check-0.0.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

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

pep440check-0.0.3-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pep440check-0.0.3.tar.gz.

File metadata

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

File hashes

Hashes for pep440check-0.0.3.tar.gz
Algorithm Hash digest
SHA256 40c7cb795c93287c9d665782cdc0d83743a6da93ca319b55283b1e90bd4c23cf
MD5 f0f5867764918e4344258c6a792d81e0
BLAKE2b-256 903d27fb3e7413d5c48130c509af7602bebf25578070857b86f1e82b37943d4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep440check-0.0.3.tar.gz:

Publisher: publish-pypi.yml on heiwa4126/pep440check

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

File details

Details for the file pep440check-0.0.3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for pep440check-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5908c9a04addfc03835274ac60d5c6e20d611751a0ba60d05788ba23f2b1c122
MD5 8acb9dd9e1f387aa588d474d36ae6ded
BLAKE2b-256 6ae5d84869d2a22ffa784c1f95effde10181f1e2a4a4092e8388fbcca993bcb4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pep440check-0.0.3-py3-none-any.whl:

Publisher: publish-pypi.yml on heiwa4126/pep440check

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