Last active
January 9, 2018 14:44
-
-
Save anqxyr/56ab72982bbbcd8cdfb4 to your computer and use it in GitHub Desktop.
Python: automagically increment version with commit count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import setuptools | |
import subprocess | |
major_version = '1.4' | |
commits = commits = subprocess.check_output( | |
['/usr/bin/git', 'rev-list', 'HEAD', '--count']).decode('utf8').strip() | |
kwargs = {} # you know what to put here | |
setuptools.setup( | |
version='{}.{}'.format(major_version, commits), | |
**kwargs) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment