Skip to content

st7105/bad-setuptools-git-version

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bad-setuptools-git-version

PackageVersion PythonVersion Stable Format License

Automatically set package version from Git. This is a re-release of [bad-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.0',
    ...
)

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

setup(
    name='foobar',
    version_config={
        "version_format": "{tag}.{cc}",
        "starting_version": "0.1.0"
    },
    setup_requires=['bad-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.

About

Automatically set PyPi package version from Git

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 85.7%
  • Makefile 9.3%
  • Batchfile 5.0%