Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to version numbering so that it is in accordance with PEP 404 #456

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 7 additions & 2 deletions setup.py
Expand Up @@ -31,8 +31,13 @@
sys.argv.remove('--nightly')

project_name = 'tensorflow-examples'
# Get the current commit hash
version = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8')
# Get the current commit hash and timestamp
# The timestamp is used so that newer commits have a higher version number
# The hash is used so that the specific commit can be identified
# The hash integer can be converted back to the hash string with: '%032x' % commit_hash_int
commit_hash_int = int(subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip(), 16)
commit_timestamp = subprocess.check_output(['git', 'show', '-s', '--format=%ct', 'HEAD']).decode('utf-8').strip()
version = f"0.{commit_timestamp}.{commit_hash_int}"

if nightly:
project_name = 'tensorflow-examples-nightly'
Expand Down