Skip to main content

No project description provided

Project description

https://github.com/tillahoffmann/wizard-version/actions/workflows/main.yml/badge.svg https://badge.fury.io/py/version-wizard.svg

The version wizard extracts version information from a git tag and includes it in your python package so you don’t have to worry about commit messages like Bump version to 0.8.1 anymore. Here’s how to use the wizard:

  1. Install by running pip install version-wizard.

  2. Add include VERSION to your MANIFEST.in file (or create one by running echo "include VERSION" > MANIFEST.in).

  3. Update your setup.py as shown below.

  4. Push semantic versioning tags to your GitHub branch, e.g, 0.8.1.

# setup.py
from setuptools import setup, ...
from version_wizard import from_github_tag

setup(
    version=from_github_tag(),
    ...
)

Behind the scenes

The call to from_github_tag will do one of two things:

  1. If the VERSION file exists, it simply returns its contents. This is the typical behavior when your installing the package from pypi, for example.

  2. If the VERSION file does not exist, it will try to extract the version from the GITHUB_REF environment variable and write it to the VERSION file.

Because the MANIFEST.in includes VERSION, the VERSION file will be included in any distribution, e.g., when you run python setup.py sdist. The correct version is thus automatically packaged with your distribution elminiating any possible inconsistencies.

Interface

..automodule:: version_wizard
  :members:

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

version-wizard-0.1.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file version-wizard-0.1.2.tar.gz.

File metadata

  • Download URL: version-wizard-0.1.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for version-wizard-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c060b50944ae87130648cf0b21f1869ef171fe69041c025b88ef493d248d2247
MD5 f78604660a25e6ff9bc80618781ee5bd
BLAKE2b-256 f89eb4b11f1c9598bcee377ae0cea2b33d1fdd30be75fac8e256d3dd4c8b264e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page