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

metadata.files sorting in pdm.lock changes between computers #1256

Closed
Hnasar opened this issue Jul 21, 2022 · 0 comments · Fixed by #1257
Closed

metadata.files sorting in pdm.lock changes between computers #1256

Hnasar opened this issue Jul 21, 2022 · 0 comments · Fixed by #1257
Labels
🐛 bug Something isn't working

Comments

@Hnasar
Copy link
Contributor

Hnasar commented Jul 21, 2022

Steps to reproduce

  • Add several package sources which contain the same wheels with different hashes (for example https://piwheels.org for deploying to raspberry pi)
  • run pdm lock on different computers (linux vs windows)

Actual behavior

The following diff is observed between the two computers

 "uritemplate 3.0.1" = [
-    {url = "https://files.pythonhosted.org/packages/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815/uritemplate-3.0.1-py2.py3-none-any.whl", hash = "sha256:07620c3f3f8eed1f12600845892b0e036a2420acf513c53f7de0abd911a5894f"},
     {url = "https://www.piwheels.org/simple/uritemplate/uritemplate-3.0.1-py2.py3-none-any.whl", hash = "sha256:07620c3f3f8eed1f12600845892b0e036a2420acf513c53f7de0abd911a5894f"},
+    {url = "https://files.pythonhosted.org/packages/bf/0c/60d82c077998feb631608dca3cc1fe19ac074e772bf0c24cf409b977b815/uritemplate-3.0.1-py2.py3-none-any.whl", hash = "sha256:07620c3f3f8eed1f12600845892b0e036a2420acf513c53f7de0abd911a5894f"},
     {url = "https://files.pythonhosted.org/packages/42/da/fa9aca2d866f932f17703b3b5edb7b17114bb261122b6e535ef0d9f618f8/uritemplate-3.0.1.tar.gz", hash = "sha256:5af8ad10cec94f215e3f48112de2022e1d5a37ed427fbd88652fa908f2ab7cae"},
 ]

Expected behavior

pdm.lock should be the same no matter which computer last locked it.

Environment Information

Debian docker image with PDM 2.0.2 and WIndows 10 workstation with PDM 2.0.2

@Hnasar Hnasar added the 🐛 bug Something isn't working label Jul 21, 2022
Hnasar pushed a commit to Hnasar/pdm that referenced this issue Jul 21, 2022
In pdm-project#1203 pdm.lock was changed to store a list of URLs rather than wheel
names. That change caused a regression because we were sorting the
output based on filename only, not the full URL.

This caused unnecessary lockfile changes in our CI environment.

Fixes pdm-project#1256
@Hnasar Hnasar mentioned this issue Jul 21, 2022
2 tasks
Hnasar pushed a commit to Hnasar/pdm that referenced this issue Jul 22, 2022
In pdm-project#1203 pdm.lock was changed to store a list of URLs rather than wheel
names. That change caused a regression because we were sorting the
output based on filename only, not the full URL.

This caused unnecessary lockfile changes in our CI environment.

Fixes pdm-project#1256
frostming pushed a commit that referenced this issue Jul 22, 2022
* Fix doc

* Make pdm.lock metadata.files sorting idempotent

In #1203 pdm.lock was changed to store a list of URLs rather than wheel
names. That change caused a regression because we were sorting the
output based on filename only, not the full URL.

This caused unnecessary lockfile changes in our CI environment.

Fixes #1256

Co-authored-by: Hashem Nasarat <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant