-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
pip updates mtimes when insatlling wheels #13207
Comments
As additional context: Fedora packaging guidelines say:
In this case, the files are being copied unmodified, so that guideline applies. Preserving timestamps is useful because it provides additional information to users when the file was really changed by the upstream and it also avoids churn between updates when packages are updated, but many files stay unchanged over many versions. |
This seems like a reasonable thing to add. A PR would be welcome. |
There's some discussion in #5648 about mtimes, both from unpacking from a wheel and generating pyc files. If it's not already done, copying the mtimes from a wheel seems like a good move (assuming little negative consequences like a big performance hit). Mtimes on generated pyc files seems is a little more tricky, but maybe there already good solutions for this. |
If the file is newly generated, then set the mtime to "now". (Maybe $SOURCE_DATE_EPOCH should be taken into account, not sure.) If the file is just copied, preserve the timestamp. I don't think |
I am willing to investigate and work on this, but not in the next 2 weeks. If anybody wants to tackle this themselves, please don't wait for me. |
Description
Hello.
When debugging a problem in RPM packaging I realized that when pip installs a wheel, the mtimes of the extracted files are set to the current timestamp.
Should installation of unmodified files preserve their mtime?
Based on #7808 I would assume installation wants to be reproducible.
Expected behavior
When a wheel is installed, I would expect the mtimes on disk to be kept as they were in the wheel.
pip version
25.0
Python version
3.13.2
OS
Linux
How to Reproduce
Observe the mtime is
6 Feb 14:41
(a.k.a. now). I would expect it to be 12-04-2024.As a side note, setting or not setting
$SOURCE_DATE_EPOCH
does not make a difference.Code of Conduct
The text was updated successfully, but these errors were encountered: