Skip to content

Support a SOURCE_DATE_EPOCH prior to 1980 - #1999

Merged
cjames23 merged 4 commits into
pypa:masterfrom
branchv:source-date-epoch
Feb 3, 2026
Merged

Support a SOURCE_DATE_EPOCH prior to 1980#1999
cjames23 merged 4 commits into
pypa:masterfrom
branchv:source-date-epoch

Conversation

@branchv

@branchv branchv commented Jun 11, 2025

Copy link
Copy Markdown
Contributor

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/python@3.13/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 ofek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread backend/src/hatchling/builders/wheel.py Outdated
@branchv

branchv commented Dec 10, 2025

Copy link
Copy Markdown
Contributor Author

@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

@cjames23

Copy link
Copy Markdown
Member

I will need to get a PR out to address the changes with Rich in 14.3 this week to merge this.

davep added a commit to davep/homebrew-homebrew that referenced this pull request Jan 31, 2026
@cjames23
cjames23 enabled auto-merge (squash) February 3, 2026 23:43
@cjames23
cjames23 disabled auto-merge February 3, 2026 23:44
@cjames23
cjames23 merged commit f400be1 into pypa:master Feb 3, 2026
94 of 99 checks passed
@branchv
branchv deleted the source-date-epoch branch February 5, 2026 02:55
@branchv

branchv commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

thank you!

github-actions Bot pushed a commit to DimitriPapadopoulos/hatch that referenced this pull request Feb 6, 2026
Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com> f400be1
github-actions Bot pushed a commit to paulsuh/hatch that referenced this pull request Feb 14, 2026
Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com> f400be1
github-actions Bot pushed a commit to edgarrmondragon/fork--hatch that referenced this pull request Feb 17, 2026
Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com> f400be1
github-actions Bot pushed a commit to flying-sheep/hatch that referenced this pull request Feb 24, 2026
Co-authored-by: Cary Hawkins <hawkinscary23@gmail.com> f400be1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

zipfile will fail if SOURCE_DATE_EPOCH is before 1980

3 participants