uv icon indicating copy to clipboard operation
uv copied to clipboard

Improve display of conclusions after enumerating available versions

Open zanieb opened this issue 1 year ago • 3 comments

e.g. in

recommenders>0.7
❯ cargo run -q -- pip compile --python-version 3.12 requirements.in
  × No solution found when resolving dependencies:
  ╰─▶ Because the requested Python version (3.12) does not satisfy Python>=3.6,<3.10 and recommenders==1.0.0 depends on Python>=3.6,<3.9, we can conclude that recommenders==1.0.0 cannot be used.
      And because only the following versions of recommenders are available:
          recommenders<=0.7
          recommenders==1.0.0
          recommenders==1.1.0
          recommenders==1.1.1
      we can conclude that recommenders>0.7,<1.1.0 cannot be used. (1)

      Because the requested Python version (3.12) does not satisfy Python>=3.6,<3.10 and recommenders>=1.1.0 depends on Python>=3.6,<3.10, we can conclude that recommenders>=1.1.0 cannot be used.
      And because we know from (1) that recommenders>0.7,<1.1.0 cannot be used, we can conclude that recommenders>0.7 cannot be used.
      And because you require recommenders>0.7, we can conclude that the requirements are unsatisfiable.

We list the available versions then conclude that a range cannot be used

      And because only the following versions of recommenders are available:
          recommenders<=0.7
          recommenders==1.0.0
          recommenders==1.1.0
          recommenders==1.1.1
      we can conclude that recommenders>0.7,<1.1.0 cannot be used. (1)

However, this would be clearer to read as

      And because only the following versions of recommenders are available:
          recommenders<=0.7
          recommenders==1.0.0
          recommenders==1.1.0
          recommenders==1.1.1
      we can conclude that recommenders cannot be used. (1)

This requires formatting of terms to know about the previous term; I cannot determine a heuristic to use to determine when a compliment should be displayed here otherwise.

zanieb avatar Feb 02 '24 18:02 zanieb

I can't reproduce this anymore, i'm getting:

cargo run -q -- pip compile --python-version 3.12 a.in --no-build-isolation
⠙ lightfm==1.17                                                                                      error: Failed to download and build `scikit-surprise==1.1.4`
  Caused by: Failed to build: `scikit-surprise==1.1.4`
  Caused by: Build backend failed to determine metadata through `prepare_metadata_for_build_wheel` with exit status: 1
--- stdout:

--- stderr:
Traceback (most recent call last):
  File "<string>", line 14, in <module>
  File "/home/konsti/projects/uv/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 368, in prepare_metadata_for_build_wheel
    self.run_setup()
  File "/home/konsti/projects/uv/.venv/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
    exec(code, locals())
  File "<string>", line 3, in <module>
ModuleNotFoundError: No module named 'numpy'
---

konstin avatar Jun 27 '24 11:06 konstin

I reproduced with a tweak

❯ echo 'recommenders>0.7\nlightfm<1.17' | uv pip compile --python-version 3.12 -
  × No solution found when resolving dependencies:
  ╰─▶ Because the requested Python version (3.12) does not satisfy Python>=3.6,<3.10 and recommenders==1.0.0 depends on
      Python>=3.6,<3.9, we can conclude that recommenders==1.0.0 cannot be used.
      And because only the following versions of recommenders are available:
          recommenders<=0.7
          recommenders==1.0.0
          recommenders==1.1.0
          recommenders==1.1.1
          recommenders==1.2.0
      we can conclude that recommenders>0.7,<1.1.0 cannot be used. (1)

      Because the requested Python version (3.12) does not satisfy Python>=3.6,<3.10 and recommenders>=1.1.0,<=1.1.1
      depends on Python>=3.6,<3.10, we can conclude that recommenders>=1.1.0,<=1.1.1 cannot be used.
      And because we know from (1) that recommenders>0.7,<1.1.0 cannot be used, we can conclude that
      recommenders>0.7,<1.2.0 cannot be used.
      And because recommenders==1.2.0 depends on lightfm>=1.17,<2, we can conclude that recommenders>0.7 depends on
      lightfm>=1.17,<2.
      And because you require recommenders>0.7 and lightfm<1.17, we can conclude that the requirements are unsatisfiable.

zanieb avatar Jun 27 '24 11:06 zanieb

and similarly

❯ echo 'recommenders>0.7' | uv pip compile --python-version 3.12 --only-binary :all: -
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of recommenders are available:
          recommenders<=0.7
          recommenders==1.0.0
          recommenders==1.1.0
          recommenders==1.1.1
          recommenders==1.2.0
      and recommenders==1.0.0 has no usable wheels and building from source is disabled, we can conclude that recommenders>0.7,<1.1.0 cannot be used.
      And because recommenders==1.1.0 has no usable wheels and building from source is disabled and recommenders==1.1.1 has no usable wheels and building from source is disabled, we can conclude that recommenders>0.7,<1.2.0 cannot be used. (1)

zanieb avatar Jun 27 '24 11:06 zanieb