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

PDM misdetects platform tag, leading to version selection that breaks resolution #3341

Closed
1 task done
sanmai-NL opened this issue Dec 6, 2024 · 15 comments
Closed
1 task done
Labels
🐛 bug Something isn't working

Comments

@sanmai-NL
Copy link
Contributor

Describe the bug

DEBUG Searching for a compatible version of torch (>=2.2.2, <3.0.0)
DEBUG Selecting: torch==2.5.1 [preference] (torch-2.5.1-cp312-cp312-manylinux1_x86_64.whl)

This happens on macOS x86_64, the latest torch version that's available for this platform is 2.2.2.

To reproduce

pdm install

Expected Behavior

Selection of compatible torch version (2.2.2).

Environment Information

PDM version:
  2.21.0
Python Interpreter:
  /Users/myuser/app/.venv/bin/python (3.12)
Project Root:
  /Users/myuser/app
Local Packages:
{
 "implementation_name": "cpython",
 "implementation_version": "3.13.0",
 "os_name": "posix",
 "platform_machine": "x86_64",
 "platform_release": "23.6.0",
 "platform_system": "Darwin",
 "platform_version": "Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:00 PDT 2024; root:xnu-10063.141.2~1/RELEASE_X86_64",
 "python_full_version": "3.12.7",
 "platform_python_implementation": "CPython",
 "python_version": "3.12",
 "sys_platform": "darwin"
}

pdm -v output

No response

Additional Context

Full repository at https://gitlab.com/han-aim/research/knowledgeplatform/app/-/tree/ea2d531552edb9f8832d83a564203d92274186b6

Are you willing to submit a PR to fix this bug?

  • Yes, I would like to submit a PR.
@sanmai-NL sanmai-NL added the 🐛 bug Something isn't working label Dec 6, 2024
@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Dec 6, 2024

Possibly related: 3234

@frostming
Copy link
Collaborator

frostming commented Dec 6, 2024

You didn't mention but apparently you are using uv mode. Then it has nothing to do with unearth.

@sanmai-NL
Copy link
Contributor Author

Yes that is true, I don't think it has to do with unearth (but I suppose the problem is in the lockfile, and I don't know the exact interaction between PDM and uv in generating that).

@sanmai-NL
Copy link
Contributor Author

Is this related? #2696

@frostming
Copy link
Collaborator

I can't reproduce using the main branch, can you confirm?

@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Dec 6, 2024

@frostming I would like to, do you have instructions on how to run it for my colleague?

@frostming
Copy link
Collaborator

@frostming I would like to, do you have instructions on how to run it for my colleague?

Instructions on run what?

@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Dec 6, 2024

@frostming How to install PDM from the main branch, on macOS.

@sanmai-NL
Copy link
Contributor Author

She uses PDM from Homebrew.

@frostming
Copy link
Collaborator

She uses PDM from Homebrew.

brew install --HEAD pdm

@sanmai-NL
Copy link
Contributor Author

@frostming The fault persists on her system. I'm still trying to get hold of the log. The new uv resolution overrides functionality did provide a workaround, by the way.

@sanmai-NL
Copy link
Contributor Author

@frostming
bugreport.log

@frostming
Copy link
Collaborator

The issue exists in the lock file, and there is no torch version compatible with MacOS 14 x86_64.

In fact, I forgot to mention in the docs that cross-platform lock targets are unavailable in UV mode. You may need to remove the MacOS x86_64 target, turn off uv mode, and run pdm lock --append --platform macos_14_0_x86_64 to fix the lock file.

@sanmai-NL
Copy link
Contributor Author

sanmai-NL commented Dec 10, 2024

@frostming Thanks. There does exist a compatible torch version: v2.2.2. When the lockfile is deleted and regenerated on the native macOS system, the fault pops up too.

@sanmai-NL
Copy link
Contributor Author

Context for the interested reader: astral-sh/uv#3347

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