Closed mbignotti closed 1 day ago
I believe this is actually the same as #9289, so let's track there. Thanks for the clear write-up.
Definitely a bug though. I believe the general issue lies in having dependencies that depend on a package that's listed multiple times, across conflicting groups.
Hi! First of all, I wanted to thank you for the new pytorch packaging guide and for the project as whole. It's great!
I'm having an issue in my current project, where I'm trying keep the cpu and gpu torch versions separate, as in your example. I need to install an additional package,
ultralytics
, that depends on pytorch, and I would like it to respect the selected torch version. Here is my base setup:However, when I run
uv sync --extra cpu
, the gpu torch version is downloaded anyways sinceultralytics
depends on torch, and on Linux the default pytorch version is the gpu one. I've already tried to move theultralytics
dependency in a separate optional group or in a dependency group, but nothing changes even when I install it after installing torch. If I use the pip interface, instead, it works. The two following commands respect the specified torch version:However, packages installed with the pip interface are not tracked in the pyproject.toml and in the lock file.
Do you have any idea about how to solve this problem? Am I doing something wrong?
Thanks a lot!