Skip to main content

Python package version checker/updater

Project description

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.

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

pyverno-1.0.0.tar.gz (10.7 kB view details)

Uploaded Source

Built Distribution

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

pyverno-1.0.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pyverno-1.0.0.tar.gz.

File metadata

  • Download URL: pyverno-1.0.0.tar.gz
  • Upload date:
  • Size: 10.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyverno-1.0.0.tar.gz
Algorithm Hash digest
SHA256 903c10c3c403f26a9c4d0072f03a61f066d53ad33511f502a24363fd88a565af
MD5 2f5e4a3eb460836e09a8b05cbe0c1586
BLAKE2b-256 9413bde04e8e3f82c8987a9b9e1799d4384bb656b0b71175d66663a4e1bf8020

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyverno-1.0.0.tar.gz:

Publisher: pypi.yml on dimagi/pyverno

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

File details

Details for the file pyverno-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pyverno-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyverno-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c544e13650734cab7fbaa44b79972b8190992c724d11ed64e5eeccf8a089d2c3
MD5 f0c97c58a7ee387ab9b488c8f66b4847
BLAKE2b-256 ad978dc58bca83f9f6e4da788c7d424882c7f8c697bcfa0f87ad91c8a055feba

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyverno-1.0.0-py3-none-any.whl:

Publisher: pypi.yml on dimagi/pyverno

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