astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
25.01k stars 723 forks source link

Incompatibilities for unusable distributions are not combined #1901

Open zanieb opened 8 months ago

zanieb commented 8 months ago

e.g.

❯ uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of torch are available:
          torch==0.1
          torch==0.1.6.post17
          torch==0.1.6.post20
          torch==0.1.6.post22
          torch==0.1.7.post2
          torch==0.1.8.post1
          torch==0.1.9.post1
          torch==0.1.9.post2
          torch==0.1.10.post1
          torch==0.1.11.post4
          torch==0.1.11.post5
          torch==0.1.12.post1
          torch==0.1.12.post2
          torch==0.2.0.post1
          torch==0.2.0.post2
          torch==0.2.0.post3
          torch==0.3.0
          torch==0.3.0.post2
          torch==0.3.0.post3
          torch==0.3.0.post4
          torch==0.3.1
          torch==0.4.0
          torch==0.4.1
          torch==1.11.0
          torch==1.12.0
          torch==1.12.1
          torch==1.13.0
          torch==1.13.1
          torch==2.0.0
          torch==2.0.1
      and torch==0.1 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.6.post17 cannot be used.
      And because torch==0.1.6.post17 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.6.post20 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.6.post22 cannot be used.
      And because torch==0.1.6.post22 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.7.post2 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.8.post1 cannot be used.
      And because torch==0.1.8.post1 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.9.post1 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.9.post2 cannot be used.
      And because torch==0.1.9.post2 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.10.post1 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.11.post4 cannot be used.
      And because torch==0.1.11.post4 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.11.post5 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.1.12.post1 cannot be used.
      And because torch==0.1.12.post1 is unusable because no wheels are available with a matching Python ABI and
      torch==0.1.12.post2 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.2.0.post1 cannot be used.
      And because torch==0.2.0.post1 is unusable because no wheels are available with a matching Python ABI and
      torch==0.2.0.post2 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.2.0.post3 cannot be used.
      And because torch==0.2.0.post3 is unusable because no wheels are available with a matching Python ABI and
      torch==0.3.0 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.3.0.post2 cannot be used.
      And because torch==0.3.0.post2 is unusable because no wheels are available with a matching Python ABI and
      torch==0.3.0.post3 is unusable because no wheels are available with a matching Python ABI, we can conclude that
      torch<0.3.0.post4 cannot be used.
      And because torch==0.3.0.post4 is unusable because no wheels are available with a matching Python ABI and
      torch==0.3.1 is unusable because no wheels are available with a matching Python ABI, we can conclude that torch<0.4.0
      cannot be used.
      And because torch==0.4.0 is unusable because no wheels are available with a matching Python ABI and torch==0.4.1
      is unusable because no wheels are available with a matching Python ABI, we can conclude that torch<1.11.0 cannot
      be used.
      And because torch==1.11.0 is unusable because no wheels are available with a matching Python ABI and torch==1.12.0
      is unusable because no wheels are available with a matching Python ABI, we can conclude that torch<1.12.1 cannot
      be used.
      And because torch==1.12.1 is unusable because no wheels are available with a matching Python ABI and torch==1.13.0
      is unusable because no wheels are available with a matching Python ABI, we can conclude that torch<1.13.1 cannot
      be used.
      And because torch==1.13.1 is unusable because no wheels are available with a matching Python ABI and torch==2.0.0 is
      unusable because no wheels are available with a matching Python ABI, we can conclude that torch<2.0.1 cannot be used.
      And because torch==2.0.1 is unusable because no wheels are available with a matching Python ABI and you require
      torch, we can conclude that the requirements are unsatisfiable.

We should combine all of these incompatibilities into a single range.

Eh2406 commented 6 months ago

From the pubgrub perspective this should get the same fix is described in https://github.com/astral-sh/uv/issues/2519#issuecomment-2009842106