hatch
hatch copied to clipboard
Support a SOURCE_DATE_EPOCH prior to 1980
Fixes #1605
A common value for SOURCE_DATE_EPOCH is 0, which unfortunately breaks hatchling:
$ uv init --build-backend=hatch
$ SOURCE_DATE_EPOCH=0 uv build
# ...
File "/opt/homebrew/Cellar/[email protected]/3.13.4/Frameworks/Python.framework/Versions/3.13/lib/python3.13/zipfile/__init__.py", line 412, in __init__
raise ValueError('ZIP does not support timestamps before 1980')
ValueError: ZIP does not support timestamps before 1980
This clamps to 1980 instead (same as setuptools and flit-core. poetry also support this but defaults to 2016)
@ofek @cjames23 sorry for the ping, but Homebrew has been working around this bug for a while so I'd love to see this merged