Skip to main content

better-setuptools-git-version

PackageVersion PythonVersion Stable Format License

Automatically set package version from Git. This is a re-release of very-good-setuptools-git-version with fixes and improvements, which is itself a re-release of setuptools-git-version

Introduction

Instead of hard-coding the package version in setup.py like:

setup(
    name='foobar',
    version='1.0',
    ...
)

this package allows to extract it from tags in the underlying Git repository:

setup(
    name='foobar',
    version_config={
        "version_format": "{tag}.dev{sha}",
        "starting_version": "0.1.0"
    },
    setup_requires=['better-setuptools-git-version'],
    ...
)

The tool uses the semantically-latest tag as the base version. If there are no annotated tags, the version specified by starting_version will be used. If HEAD is at the tag, the version will be the tag itself. If there are commits ahead of the tag, the first 8 characters of the sha of the HEAD commit will be included.

In all of the above cases, if the working tree is also dirty or contains untracked files, a +dirty suffix will be appended to the version.

Release files for better-setuptools-git-version 1.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for better-setuptools-git-version 1.0.5
File Size Uploaded
better-setuptools-git-version-1.0.5.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for better-setuptools-git-version 1.0.5
File Interpreter ABI Platform
better_setuptools_git_version-1.0.5-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size:7.9 kB

Release files / better-setuptools-git-version-1.0.5.tar.gz

Download URL better-setuptools-git-version-1.0.5.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2e0d70cbd3287d3fbe8696057f3c870d937fd9fbdd4a57d1a15796553b17d387
BLAKE2b-256 checksum
How to use checksums
5c19e574c327e6f6f2d89d4112bb45a476dcb3c5753af0ec63a2a657c24ec86a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15rc1

Release files / better_setuptools_git_version-1.0.5-py2.py3-none-any.whl

Download URL better_setuptools_git_version-1.0.5-py2.py3-none-any.whl
Size 4.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ecd893fe8c0936664171a9f4b2221c3e23a028bc792dd10e979a09f77baebfde
BLAKE2b-256 checksum
How to use checksums
5c657fcc51592de23cc66ff6e5b3ad2a307421a6e3fe6070a7a8124e52029d1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/2.7.15rc1

Release history Release notifications | RSS feed

This release

1.0.5 This release

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page