Skip to content

Commit

Permalink
Merge 94860f6 into b4eb09b
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoscsouza committed May 5, 2023
2 parents b4eb09b + 94860f6 commit f0d9155
Showing 1 changed file with 7 additions and 2 deletions.
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

0 comments on commit f0d9155

Please sign in to comment.