Use pyproject.toml or SOURCE_DATE_EPOCH for generated file mtime#651
Use pyproject.toml or SOURCE_DATE_EPOCH for generated file mtime#651sneakers-the-rat wants to merge 3 commits into
pyproject.toml or SOURCE_DATE_EPOCH for generated file mtime#651Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
|
but this makes the build not (easily) reproducible: because the timestamp on pyproject.toml on your CI system is not the same as the timestamp on that file on my computer. |
wouldn't that be true of every file? |
|
yes, I guess so. But in that case it seems that #142 didn't really come close to addressing python-poetry/poetry#1102: and it's hard to tell whether the change proposed here is a step in the right or the wrong direction. |
|
I think its at least no worse with improvements - any change to pyproject.toml (updating mtime) will also make a new repro build anyway, so by default its at least as good as hardcoding a zero while also not making files that break some of my mtime-based cleanup scripts (thats probably a me problem, but still time = 0 is clearly Not Right) I Also added in using |
|
I don't feel particularly strongly about it. For me personally it's a little chunk of complexity with low value: but then - again for me personally - that's true of a lot of the poetry codebase! We will leave it to someone who has the power to merge to decide whether they want to do so. |
|
To summarize:
I personally don't care much if the time of generated files is 0 or the time of the pyproject.toml. I assume I'd be more eager to change this if there were other/more references where a time of zero is problematic. Regarding |








Resolves (or rather, revisits): poetry-core#142
Was wondering why there were a bunch of files with time == 0 on my disk, found this previous PR that set mtime to 0 for generated files for deterministic builds: #142 and also this comment at the end that suggested that pulling the time from
pyproject.tomlwould be a good way to be deterministic while also having a sensible timestamp: #142 (comment) and went ahead and did that, also adding this suggestion to useSOURCE_DATE_EPOCHif set #142 (review)