Skip to main content

A simple tool to automatically write git tag name to version field of python setup files.

Project description

py_version_from_tag

py_version_from_tag is a simple CLI tool that will obtain the tag name of the current commit, extract version from it and write it to python setup file.

This can be very useful in automatic build processes, so you don't need to manually update version string in setup files when you have already written it as a tag name.

Usage

Prerequisites:

  • Your working directory should be placed on a valid git repository

  • The current commit (HEAD) should be tagged

    python -m pip install py_version_from_tag -p {path to pyproject.toml} python -m pip py_version_from_tag

Alternatively, if the current commit is not tagged, but you want to use the latest commit as version, you can use the -l switch, like this:

python -m pip py_version_from_tag -l

Notes

  • Currently, only pyproject.toml file is supported as a setup file
  • Tag name should contain a valid version information, for example: "v3.1.2", "1.2.3", "v4.5.6_alpha" are all examples of valid tag version names

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

py_version_from_tag-1.0.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

py_version_from_tag-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: py_version_from_tag-1.0.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.1

File hashes

Hashes for py_version_from_tag-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d49c90731cf1e8f0eeecb3c5a77d8f773198db0bc863b6a03f7e149af02f73d8
MD5 02452acdff75aae44f2bc147ecaf2dfa
BLAKE2b-256 f3a59e00fe012a3d1d8833cc025c465093ee05b414460f689f86987cfaa26487

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for py_version_from_tag-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6bf911e3697f13b62b0e17a19da9dc070f584415020f81c7bc0a2362790d1f0
MD5 cd014911e35465fc7751d4deff727dec
BLAKE2b-256 0ac607ec26d22228a431a990c3aee6dbe2938f55734df35552e9dd3ea350aa5d

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