Skip to main content

A biased Git versioning tool for Python project.

Project description

Git Versioning for Python Project

A biased git versioning tool. It versions as following:

  • On v* tag: version as tag if not sticky

    i.e. 0.1.0

  • On main or master branch: version as rc

    i.e. 0.1.0-rc{BUILD_NUMBER}+{GIT_COMMIT_SHORT_SHA}

  • Others: version as dev

    i.e. 0.1.0-dev{BUILD_NUMBER}+{GIT_COMMIT_SHORT_SHA}

If env VERSIONING_GIT_BRANCH is set, it will be used instead of git branch --show-current.

Usage

It currently support setuptools, hatch and poetry.

setuptools

setuptools.setup(
  version="0.1.0",
  setup_requires=["gitv"]
)

hatch

[build-system]
requires = ["hatchling", "gitv"]

[project]
dynamic = ["version"]

[tool.hatch.version]
version = "0.1.0"
source = "vcs"

poetry

[build-system]
requires = ["poetry-core", "gitv"]

[tool.poetry]
version = "0.1.0"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

gitv-2.2.2-py3-none-any.whl (4.9 kB view hashes)

Uploaded Python 3

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