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

Local version causes mismatch between candidate and installed package #1497

Closed
1 task done
tgolsson opened this issue Nov 5, 2022 · 3 comments
Closed
1 task done
Labels
🐛 bug Something isn't working

Comments

@tgolsson
Copy link
Contributor

tgolsson commented Nov 5, 2022

  • I have searched the issue tracker and believe that this is not a duplicate.

Make sure you run commands with -v flag before pasting the output.

Context

This is the reduced case of #1496, but which is actually two different issues masquerading to look like a cache issue.

Steps to reproduce

Repeatedly pdm sync -v here and note that each time the torch package is deleted and reinstalled:

https://github.com/tgolsson/pdm-repros/tree/main/constant-redownload

Actual behavior

The same package is resolved (and reinstalled) each time when it's bitwise the same. This also leads to unearth claiming to download the package, which is what sent me down the cache path.

Note that pdm list recognizes the actual version installed:

╭─────────────────────┬────────────┬─────────────────────────────────────────────────────────╮
│ name                │ version    │ location                                                │
├─────────────────────┼────────────┼─────────────────────────────────────────────────────────┤
│ setuptools          │ 59.5.0     │                                                         │
│ torch               │ 1.10.2+cpu │                                                         │
│ wasteful-redownload │ 0.0.0      │ -e /home/ts/Repositories/pdm-repros/constant-redownload │
│ typing_extensions   │ 4.4.0      │                                                         │
╰─────────────────────┴────────────┴─────────────────────────────────────────────────────────╯

Expected behavior

Something like this is my expected behavior:

Requirement Installed Expected outcome
torch==1.10.2 torch==1.10.2 Keep
torch==1.10.2 torch==1.10.2+cpu Keep
torch==1.10.2+cpu torch==1.10.2 Update
torch==1.10.2+cpu torch==1.10.2+cpu Keep
torch==1.10.2+cpu torch==1.10.2+gpu Update

Environment Information

# Paste the output of `pdm info && pdm info --env` below:
# Paste the output of `pdm info && pdm info --env` below:
PDM version:
  2.2.1
Python Interpreter:
  /home/ts/Repositories/pdm-repros/constant-redownload/.venv/bin/python (3.8)
Project Root:
  /home/ts/Repositories/pdm-repros/constant-redownload
Project Packages:
  None
{
  "implementation_name": "cpython",
  "implementation_version": "3.8.10",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.68.1-microsoft-standard-WSL2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Mon Sep 19 19:14:52 UTC 2022",
  "python_full_version": "3.8.10",
  "platform_python_implementation": "CPython",
  "python_version": "3.8",
  "sys_platform": "linux"
}
@tgolsson tgolsson added the 🐛 bug Something isn't working label Nov 5, 2022
@frostming
Copy link
Collaborator

After a little research I found that

  • The reinstallation isn't expected and should be fixed
  • The cache mismatch is due to lacking of expires or max-age header.

frostming added a commit that referenced this issue Nov 7, 2022
frostming added a commit that referenced this issue Nov 7, 2022
@tgolsson
Copy link
Contributor Author

tgolsson commented Nov 7, 2022

@frostming Yepp! I put up a PR to avoid the cache thrashing caused by the headers.

@frostming
Copy link
Collaborator

This was fixed in e480d2c, the cache issue is tracked by #1498

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

No branches or pull requests

2 participants