Skip to main content

Python package version checker/updater

Check or update the version number defined in a Python source file such as __init__.py

Sub-commands

  • check - Verify that the __version__ in PY_FILE matches the one embedded in GIT_TAG_REF.
  • update - Append a timestamped dev version component formatted as .devYYYYmmddHHMMSS to the __version__ string in PY_FILE.

Usage:

pyverno check PY_FILE GIT_TAG_REF

pyverno update PY_FILE

Conventions

  • The version must be assigned to a variable named __version__ in the provided PY_FILE. The assignment must be at the beginning of the line and have single-character string delimiters, e.g. __version__ = "X.Y.Z".
  • GIT_TAG_REF is formatted as refs/tags/vX.Y.Z. This implies that git version tags should have the format vX.Y.Z, where the X.Y.Z portion uses whatever version number format makes sense for the project.

pyverno is not opinionated about version number formats. The only restriction is that a version number may not contain quote characters of the same style used to delimit the version string. Exmaples of valid version numbers: 1.0.0, 2025-05-22, 20250522

Purpose

pyverno was developed to automate a version check or update during trusted publishing to PyPI. The check command is useful when publishing a new final release, and the update command is useful to create a reasonably unique version number when publishing to https://test.pypi.org.

Publishing new versions to PyPI

Push a new tag to Github using the format vX.Y.Z where X.Y.Z matches the version in pyverno.py.

A new version is published to https://test.pypi.org/p/pyverno on every push to the main branch.

Publishing is automated with Github Actions.

Release files for pyverno 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyverno 1.0.0
File Size Uploaded
pyverno-1.0.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyverno 1.0.0
File Interpreter ABI Platform
pyverno-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.6 kB

Release files / pyverno-1.0.0.tar.gz

Download URL pyverno-1.0.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
903c10c3c403f26a9c4d0072f03a61f066d53ad33511f502a24363fd88a565af
BLAKE2b-256 checksum
How to use checksums
9413bde04e8e3f82c8987a9b9e1799d4384bb656b0b71175d66663a4e1bf8020
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2025.

Transparency log

Release files / pyverno-1.0.0-py3-none-any.whl

Download URL pyverno-1.0.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c544e13650734cab7fbaa44b79972b8190992c724d11ed64e5eeccf8a089d2c3
BLAKE2b-256 checksum
How to use checksums
ad978dc58bca83f9f6e4da788c7d424882c7f8c697bcfa0f87ad91c8a055feba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 22, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page