Skip to content

Commit

Permalink
Merge pull request #450 from citrus-it/pydates
Browse files Browse the repository at this point in the history
Fix .py timestamp derivation from git history
  • Loading branch information
hadfl authored Oct 6, 2023
2 parents 5b0d787 + 645ee2f commit f760421
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 98 deletions.
93 changes: 0 additions & 93 deletions src/pydates

This file was deleted.

10 changes: 5 additions & 5 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1159,12 +1159,11 @@ def __init__(self, dist):
# consistent across builds, causing their corresponding .pyc
# files to be unchanged unless the .py file content changed.

self.timestamps = {}
print("Gathering file timestamps from git history")

pydates = "pydates"
self.timestamps = {}

if os.path.isdir(os.path.join(pwd, "../.git")):
pydates = "pydates.git"
pydates = "pydates.git"

p = subprocess.Popen(
os.path.join(pwd, pydates),
Expand Down Expand Up @@ -1257,7 +1256,8 @@ def copy_file(self, infile, outfile, preserve_mode=1, preserve_times=1,
src_mtime = self.timestamps[b"."]
else:
src_mtime = self.timestamps.get(
os.path.join("src", infile), self.timestamps[b"."])
os.path.join("src", infile).encode('utf-8'),
self.timestamps[b"."])

# Force a copy of the file if the source timestamp is different
# from that of the destination, not just if it's newer. This
Expand Down

0 comments on commit f760421

Please sign in to comment.