Skip to content

Commit

Permalink
Merge pull request #152 from p5k369/fixed_fallback_date
Browse files Browse the repository at this point in the history
Fixed build and/or last modification fallback date
  • Loading branch information
eoyilmaz committed Aug 8, 2022
2 parents 228024f + a83da04 commit 04c0c49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion DisplayCAL/meta.py
Expand Up @@ -16,7 +16,7 @@
VERSION_STRING,
)
except ImportError:
build = lastmod = "0000-00-00T00:00:00.0Z"
build = lastmod = "1970-01-01T00:00:00Z"
VERSION = None
VERSION_STRING = None

Expand Down
10 changes: 3 additions & 7 deletions setup.py
Expand Up @@ -486,11 +486,7 @@ def setup():
timestamp = time.gmtime(mtime)

if timestamp:
lastmod = (
strftime("%Y-%m-%dT%H:%M:%S", timestamp)
+ str(round(mtime - int(mtime), 6))[1:]
+ "Z"
)
lastmod = f"{strftime('%Y-%m-%dT%H:%M:%S', timestamp)}Z"

if not dry_run:
print("Generating __version__.py")
Expand All @@ -499,8 +495,8 @@ def setup():
versionpy.write("# generated by setup.py\n\n")
build_time = time.time()
versionpy.write(
"BUILD_DATE = %r\n"
% (strftime("%Y-%m-%dT%H:%M:%S", gmtime(build_time)) + "Z")
f"BUILD_DATE = "
f"\"{strftime('%Y-%m-%dT%H:%M:%S', gmtime(build_time))}Z\"\n"
)

if lastmod:
Expand Down

0 comments on commit 04c0c49

Please sign in to comment.