Can we define per-dependency sources? Some PyTorch and Transformers dependency resolving issues #949
Tremeschin
started this conversation in
General
Replies: 1 comment
-
I am facing the exact same issue. Once this is improved it will be possible to address a very important part of the ML ecosystem |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Update: This issue is known and being tracked on uv/171 and partially explained on uv/PIP_COMPATIBILITY.md
Would probably still need integration in
pyproject.toml
; take my report below as a unwanted behavior causing a "deadlock" of dependencies, in howuv
decides and always prioritizes custom indexesOld comment
Hi, I'll try to give enough context and reasoning, didn't find similar issues after some searching, bit of complex problem~
I'm installing PyTorch CPU 'flavor', some projects use it, as that is more platform agnostic and the smallest:
To my understanding adding this source with implied
type="index"
makes packages to take precedence for the custom source over PyPI, globallyI've probably stumbled on two issues due this, the main one being that when installing
torch
andtransformers
together, dependency resolving forhuggingface-hub
fails duefsspec
package:Previously, I had similar issues with dependency resolving for
Pillow
andmoderngl-window
, even got in touch with the developers there to maybe relax pillow requirements, and I was getting weird issues likePillow==10.0.1
doesn't exist, even when clearly all the wheels are on PyPI and Python 3.11 is not an exceptionSo, after noticing similar stuff with
transformers
, I went to investigate a bitAt first, when inspecting the
METADATA
file of the lastesthuggingface_hub-0.22.1-py3-none-any.whl
, it points toRequires-Dist: fsspec >=2023.5.0
, and there's clearly no version of that on PyPI currently, I thought it was their error on dependency specification and was preparing to write a bug report, but I wasn't ultimately convinced because how come Poetry, pip-tools resolve the dependencies right anduv
fail it, it's NP hard but not NP impossible 😅I was about to write reproduction steps and I
rye init
,rye add transformers
andrye add torch
, to my happy accident, I forgot to add the sources to thepyproject.toml
, and everything installed correctly, so I'm writing here nowIt looks like
uv
is prioritizing https://download.pytorch.org/whl/fsspec and https://download.pytorch.org/whl/pillow over PyPI's ones, and PyTorch's wheels are clearly either slightly outdated or missing older versions likePillow==10.0.1
~
Long story short; is there a way to only define the PyTorch CPU source for the
torch
package itself?With Poetry we simply do-
-on a dependency basis to specify the source, not globally
I can just slap regular torch for now but that's quite a GBs of data for just running any project. This is kind of a breaking feature I need, and I really want to use rye, it solves so many issues with packaging and monorepo in general
Thanks !
Beta Was this translation helpful? Give feedback.
All reactions