Skip to content

Poetry-Built Wheel Timestamps Pinned to 1980 and 2016 #3531

@mattsta

Description

@mattsta
  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Tested on macos and Linux both with a pyenv Python 3.9.1
  • Poetry version: pip package Poetry version 1.1.4
  • Link of a Gist with the contents of your pyproject.toml file: any new empty project

Issue

Hi Poets,

I don't think I'm going crazy this time, but poetry is building packages with dates pinned to 1980 and 2016, which is eerily similar to the zip format original date limits.

Reproducible on macos and Linux:

matt@webby:/tmp/q/dist$ poetry new nothing
Created package nothing in nothing
matt@webby:/tmp/q/dist$ cd nothing
matt@webby:/tmp/q/dist/nothing$ poetry build
Creating virtualenv nothing-NUlh54qg-py3.6 in /home/matt/.cache/pypoetry/virtualenvs
Building nothing (0.1.0)
  - Building sdist
  - Built nothing-0.1.0.tar.gz
  - Building wheel
  - Built nothing-0.1.0-py3-none-any.whl

matt@webby:/tmp/q/dist/nothing$ zipinfo dist/nothing-0.1.0-py3-none-any.whl
Archive:  dist/nothing-0.1.0-py3-none-any.whl
Zip file size: 1021 bytes, number of entries: 4
-rw-r--r--  2.0 unx       22 b- defN 80-Jan-01 00:00 nothing/__init__.py
?rw-r--r--  2.0 unx       83 b- defN 16-Jan-01 00:00 nothing-0.1.0.dist-info/WHEEL
?rw-r--r--  2.0 unx      390 b- defN 16-Jan-01 00:00 nothing-0.1.0.dist-info/METADATA
?rw-r--r--  2.0 unx      279 b- defN 16-Jan-01 00:00 nothing-0.1.0.dist-info/RECORD
4 files, 774 bytes uncompressed, 475 bytes compressed:  38.6%

And it extracts to the old dates as well:

matt@webby:/tmp/q/dist/nothing/dist$ unzip nothing-0.1.0-py3-none-any.whl
Archive:  nothing-0.1.0-py3-none-any.whl
  inflating: nothing/__init__.py     
  inflating: nothing-0.1.0.dist-info/WHEEL  
  inflating: nothing-0.1.0.dist-info/METADATA  
  inflating: nothing-0.1.0.dist-info/RECORD  

matt@webby:/tmp/q/dist/nothing/dist$ ls -latrh nothing
total 12K
-rw-r--r-- 1 matt matt   22 Jan  1  1980 __init__.py
drwxrwxr-x 5 matt matt 4.0K Jan  2 16:13 ..
drwxrwxr-x 2 matt matt 4.0K Jan  2 16:13 .
matt@webby:/tmp/q/dist/nothing/dist$ ls -latrh nothing-0.1.0.dist-info/
total 20K
-rw-r--r-- 1 matt matt   83 Jan  1  2016 WHEEL
-rw-r--r-- 1 matt matt  279 Jan  1  2016 RECORD
-rw-r--r-- 1 matt matt  390 Jan  1  2016 METADATA
drwxrwxr-x 5 matt matt 4.0K Jan  2 16:13 ..
drwxrwxr-x 2 matt matt 4.0K Jan  2 16:13 .

The tar file has the proper dates:

matt@webby:/tmp/q/dist/nothing/dist$ ls
nothing-0.1.0-py3-none-any.whl  nothing-0.1.0.tar.gz
matt@webby:/tmp/q/dist/nothing/dist$ tar xfvzp nothing-0.1.0.tar.gz 
nothing-0.1.0/nothing/__init__.py
nothing-0.1.0/pyproject.toml
nothing-0.1.0/setup.py
nothing-0.1.0/PKG-INFO
matt@webby:/tmp/q/dist/nothing/dist$ ls -latRh nothing-0.1.0/
nothing-0.1.0/:
total 24K
drwxrwxr-x 5 matt matt 4.0K Jan  2 16:13 ..
drwxrwxr-x 3 matt matt 4.0K Jan  2 16:07 .
drwxrwxr-x 2 matt matt 4.0K Jan  2 16:07 nothing
-rw-r--r-- 1 matt matt  390 Jan  2 16:04 PKG-INFO
-rw-r--r-- 1 matt matt  492 Jan  2 16:04 setup.py
-rw-r--r-- 1 matt matt  297 Jan  2 16:04 pyproject.toml

nothing-0.1.0/nothing:
total 12K
drwxrwxr-x 2 matt matt 4.0K Jan  2 16:07 .
drwxrwxr-x 3 matt matt 4.0K Jan  2 16:07 ..
-rw-r--r-- 1 matt matt   22 Jan  2 16:04 __init__.py

I haven't seen where poetry is actually building the packages (doesn't look like zipfile.ZipFile is used anywhere for creating packages), but something in the source-to-dist pipeline is borked.

Also, even looking through my pip cache, I can see projects built with poetry because they have weird timestamps:

Archive:  ./28/2d/6b/560369248c33fc2d882500262bb2b6d3e5d672575f3501fa6f/pytokenizations-0.7.2-py3-none-any.whl
Zip file size: 1791 bytes, number of entries: 6
-rw-r--r--  2.0 unx      475 b- defN 80-Jan-01 00:00 tokenizations/__init__.py
-rw-r--r--  2.0 unx      354 b- defN 80-Jan-01 00:00 tokenizations/__init__.pyi
-rw-r--r--  2.0 unx        0 b- defN 80-Jan-01 00:00 tokenizations/py.typed
?rw-r--r--  2.0 unx       83 b- defN 16-Jan-01 00:00 pytokenizations-0.7.2.dist-info/WHEEL
?rw-r--r--  2.0 unx      443 b- defN 16-Jan-01 00:00 pytokenizations-0.7.2.dist-info/METADATA
?rw-r--r--  2.0 unx      468 b- defN 16-Jan-01 00:00 pytokenizations-0.7.2.dist-info/RECORD
6 files, 1823 bytes uncompressed, 937 bytes compressed:  48.6%

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions