Skip to main content

Automatically set package version using git tag/hash

Project description

setuptools-git-ver

PyPI version Build Status

Automatically set package version using git tag/hash

Install

Install using pip

Usage

To just use the default templates for versioning:

setuptools.setup(
    ...
    version_config=True,
    ...
    setup_requires=['setuptools-git-ver'],
    ...
)

Changing templates (also shows the defaults):

setuptools.setup(
    ...
    version_config={
        "template": "{tag}",
        "dev_template": "{tag}.dev{ccount}+git.{sha}"
        "dirty_template": "{tag}.dev{ccount}+git.{sha}.dirty"
    },
    ...
    setup_requires=['setuptools-git-ver'],
    ...
)

Templates

  • template: used if no untracked files and latest commit is tagged

  • dev_template: used if no untracked files and latest commit isn't tagged

  • dirty_template: used if untracked files exist or uncommitted changes have been made

Format Options

  • {tag}: Latest tag in the repository

  • {ccount}: Number of commits since last tag

  • {sha}: First 8 characters of the sha hash of the latest commit

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

setuptools-git-ver-1.0.4.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

setuptools_git_ver-1.0.4-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file setuptools-git-ver-1.0.4.tar.gz.

File metadata

  • Download URL: setuptools-git-ver-1.0.4.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for setuptools-git-ver-1.0.4.tar.gz
Algorithm Hash digest
SHA256 07b57167e9fc2359850195f76a230de2440fc92245351c523865690e70395a08
MD5 c82bafe6e2cfc9845207c5414a8a5fe4
BLAKE2b-256 ce23480a76b81a65e1c68429d59904d7a1fde44969d71a7ee896711e2d4a6f56

See more details on using hashes here.

File details

Details for the file setuptools_git_ver-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: setuptools_git_ver-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.1

File hashes

Hashes for setuptools_git_ver-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d26b7d060cd0f7cfe156aceed43070d1766ac130928ae2ec79d14e88c14b7db0
MD5 f188031ce2ed54812a4187fd917fe5ff
BLAKE2b-256 d7f4a82e50268e9ef672d10adbef55d5229256f1cb4d74e699f9ee4117b430dd

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