Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source installs fail due to timestamps/zip for flit-based sdists #1748

Closed
adrianeboyd opened this issue Feb 20, 2024 · 1 comment · Fixed by #1749
Closed

Source installs fail due to timestamps/zip for flit-based sdists #1748

adrianeboyd opened this issue Feb 20, 2024 · 1 comment · Fixed by #1749
Assignees

Comments

@adrianeboyd
Copy link

(Some?) sdists created with flit (e.g. cloudpathlib, tomli, typer) include a PKG-INFO file with a timestamp of Jan 1 1970, which raises an error when building from source. pip installs without errors.

Command, using uv 0.1.5:

uv pip install cloudpathlib==0.17.0 --no-binary cloudpathlib --no-cache --reinstall

Output:

Resolved 2 packages in 392ms
error: Failed to download distributions
  Caused by: Failed to fetch wheel: cloudpathlib==0.17.0
  Caused by: Failed to build: cloudpathlib==0.17.0
  Caused by: Build backend failed to build wheel through `build_wheel()`:
--- stdout:

--- stderr:
Traceback (most recent call last):
  File "<string>", line 6, in <module>
  File "/tmp/.tmplPwcVh/.tmp6SwAEy/.venv/lib/python3.8/site-packages/flit_core/buildapi.py", line 72, in build_wheel
    info = make_wheel_in(pyproj_toml, Path(wheel_directory))
  File "/tmp/.tmplPwcVh/.tmp6SwAEy/.venv/lib/python3.8/site-packages/flit_core/wheel.py", line 224, in make_wheel_in
    wb.build(editable)
  File "/tmp/.tmplPwcVh/.tmp6SwAEy/.venv/lib/python3.8/site-packages/flit_core/wheel.py", line 210, in build
    self.copy_module()
  File "/tmp/.tmplPwcVh/.tmp6SwAEy/.venv/lib/python3.8/site-packages/flit_core/wheel.py", line 164, in copy_module
    self._add_file(full_path, rel_path)
  File "/tmp/.tmplPwcVh/.tmp6SwAEy/.venv/lib/python3.8/site-packages/flit_core/wheel.py", line 111, in _add_file
    zinfo = zipfile.ZipInfo.from_file(full_path, rel_path)
  File "/usr/lib/python3.8/zipfile.py", line 539, in from_file
    zinfo = cls(arcname, date_time)
  File "/usr/lib/python3.8/zipfile.py", line 362, in __init__
    raise ValueError('ZIP does not support timestamps before 1980')
ValueError: ZIP does not support timestamps before 1980

This looks like the same issue as #579, but it doesn't appear to be fixed by #634?

@konstin konstin self-assigned this Feb 20, 2024
konstin added a commit that referenced this issue Feb 20, 2024
Don't preserve mtime to work around alexcrichton/tar-rs#349. Same as #634 except for the streaming unzip.

Fixes #1748.
@konstin
Copy link
Member

konstin commented Feb 20, 2024

This got lost in the streaming unpack implementation, i added a test to prevent this from happening again.

charliermarsh pushed a commit that referenced this issue Feb 20, 2024
## Summary

Don't preserve mtime to work around alexcrichton/tar-rs#349. Same as
#634 except for the streaming unzip.

Fixes #1748.

## Test Plan

Added the tomli source dist as test case.
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 a pull request may close this issue.

2 participants