Skip to main content

Automatically set package version using git tag/hash

Project description

setuptools-git-versioning

PyPI version Build Status

Automatically set package version using git tag/hash

Compairing with other packages

Package/Function Lastest release Python2 support Python3 support PEP 440 compatible Separated template for not tagged HEAD Separated template for dirty run Using functions outside setup.py
setuptools-git-versioning 2020 + + + + + +
setuptools-git-ver (Base package) 2020 - + + + + -
even-better-setuptools-git-version 2019 - + + - - +
better-setuptools-git-version 2018 - + + - - +
very-good-setuptools-git-version 2018 - + - - - +
setuptools-git-version 2018 + + - - - -

Installation

No need.

Adding setup_requires=['setuptools-git-versioning'] somewhere in setup.py will automatically download the latest version from PyPi and save it in the .eggs folder when setup.py is run.

Usage

To just use the default templates for versioning:

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

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-versioning'],
    ...
)

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-versioning-1.1.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distributions

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

setuptools_git_versioning-1.1.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

setuptools_git_versioning-1.1.2-py2-none-any.whl (4.8 kB view details)

Uploaded Python 2

File details

Details for the file setuptools-git-versioning-1.1.2.tar.gz.

File metadata

  • Download URL: setuptools-git-versioning-1.1.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.15

File hashes

Hashes for setuptools-git-versioning-1.1.2.tar.gz
Algorithm Hash digest
SHA256 b4a761ce5d781e99defa1ccc80ca5f02fc7591795fc0a44670ce0454501ef6a9
MD5 5494fc98e8a3ba9c61b1d45021ef1ec8
BLAKE2b-256 78a4eba7714e15848b08e682f505c35087bac9fcba3aadb1a1c3f94a87973045

See more details on using hashes here.

File details

Details for the file setuptools_git_versioning-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: setuptools_git_versioning-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.1

File hashes

Hashes for setuptools_git_versioning-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e3fb5c7598c5b112a7f29a9aa4d2d1b989504aa117c77ece011369b9896721da
MD5 a671fdf9b0da482813c111f3ca95cf9c
BLAKE2b-256 a38535b3b382d4d286384cab58ded054b11c8fb9a87c75f800daae7e13c19d59

See more details on using hashes here.

File details

Details for the file setuptools_git_versioning-1.1.2-py2-none-any.whl.

File metadata

  • Download URL: setuptools_git_versioning-1.1.2-py2-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/2.7.15

File hashes

Hashes for setuptools_git_versioning-1.1.2-py2-none-any.whl
Algorithm Hash digest
SHA256 5eaa20096b1eb5677fa37113f5877ab49e16f7f5a92dae0b82586cd7baf5fda8
MD5 412449cd4524571f5d09e221e77079e7
BLAKE2b-256 4ecc520207a2a70b5c32ba2165084a0c98b09682cff3d89c6e31a690d170a032

See more details on using hashes here.

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