From db7542d51d451714379af90a253b511af4f03b09 Mon Sep 17 00:00:00 2001 From: Eduardo Date: Sun, 30 Apr 2023 23:50:23 -0300 Subject: [PATCH] Change version numbering to be in accordance with PEP 440, required by Setuptools>=66 --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d1b528bb4bb..b1112456d3b 100644 --- a/setup.py +++ b/setup.py @@ -31,8 +31,10 @@ 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 +commit_hash = subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('utf-8').strip() +commit_timestamp = subprocess.check_output(['git', 'show', '-s', '--format=%ct', 'HEAD']).decode('utf-8').strip() +version = f"0.{commit_timestamp}.{int(commit_hash, 16)}" if nightly: project_name = 'tensorflow-examples-nightly'