astral-sh/uv

Exclusive bound incorrectly reported in uv conflict explanation

Closed this issue · 2 comments

Summary

This is a bit of a nit, but:

λ cat r.in
cffi>=1.17
snowflake-connector-python>=3.16
snowflake-sqlalchemy>=1.7.7
fastapi-mail>=1.5.7
uvicorn>=0.38
λ uv pip compile r.in
  × No solution found when resolving dependencies:
  ╰─▶ Because only the following versions of snowflake-connector-python are available:
          snowflake-connector-python<=3.16.0
          snowflake-connector-python==3.17.0
          snowflake-connector-python==3.17.1
          snowflake-connector-python==3.17.2
          snowflake-connector-python==3.17.3
          snowflake-connector-python==3.17.4
          snowflake-connector-python==3.18.0
          snowflake-connector-python>4.0.0
      and snowflake-connector-python>=3.16.0,<=3.18.0 depends on cffi>=1.9,<2.0.0, we can conclude that
      snowflake-connector-python>=3.16.0,<4.0.0 depends on cffi>=1.9,<2.0.0.
...

snowflake-connector-python==4.0.0 is available, so I think the third last line in that should be snowflake-connector-python>=4.0.0 not >

Platform

macOS

Version

0.9

Python version

No response

zanieb commented

Thanks for the report.

Dumping the derivation tree here as it's useful for debugging....

❯ UV_INTERNAL__SHOW_DERIVATION_TREE=1 uv pip compile r.in
Resolver derivation tree before reduction
term root==0a0.dev0
  root==0a0.dev0 depends on uvicorn>=0.38
  term not uvicorn>=0.37.0, <0.38.0
  term root==0a0.dev0
    root==0a0.dev0 depends on fastapi-mail>=1.5.7
    term fastapi-mail>=1.5.7
    term not uvicorn>=0.37.0, <0.38.0
    term root==0a0.dev0
      root==0a0.dev0 depends on snowflake-sqlalchemy>=1.7.7
      term fastapi-mail>=1.5.7
      term snowflake-sqlalchemy>=1.7.7
      term not uvicorn>=0.37.0, <0.38.0
      term root==0a0.dev0
        root==0a0.dev0 depends on snowflake-connector-python>=3.16
        term fastapi-mail>=1.5.7
        term snowflake-sqlalchemy>=1.7.7
        term not uvicorn>=0.37.0, <0.38.0
        term not snowflake-connector-python<3.16.0
          no versions of snowflake-sqlalchemy>1.7.7
          term fastapi-mail>=1.5.7
          term snowflake-sqlalchemy==1.7.7
          term not uvicorn>=0.37.0, <0.38.0
          term not snowflake-connector-python<3.16.0
            snowflake-sqlalchemy==1.7.7 depends on snowflake-connector-python<4.0.0
            term fastapi-mail>=1.5.7
            term not uvicorn>=0.37.0, <0.38.0
            term snowflake-connector-python>=3.16.0, <4.0.0
              term fastapi-mail>=1.5.7, <1.5.8 | >1.5.8
              term not uvicorn>=0.37.0, <0.38.0
                no versions of fastapi-mail>1.5.7, <1.5.8 | >1.5.8
                fastapi-mail==1.5.7 depends on uvicorn>=0.37.0, <0.38.0
              term fastapi-mail==1.5.7 | ==1.5.8
              term snowflake-connector-python>=3.16.0, <4.0.0
                fastapi-mail==1.5.7 | ==1.5.8 depends on cryptography>=46.0.3, <47.0.0
                term cryptography>=46.0.3, <47.0.0
                term snowflake-connector-python>=3.16.0, <4.0.0
                  no versions of cryptography>46.0.3, <47.0.0
                  term cryptography==46.0.3
                  term snowflake-connector-python>=3.16.0, <4.0.0
                    cryptography==46.0.3 depends on cffi{platform_python_implementation != 'PyPy'}>=2.0.0
                    term not cffi>=1.9, <2.0.0
                    term snowflake-connector-python>=3.16.0, <4.0.0
                      snowflake-connector-python==3.16.0 | ==3.17.0 | ==3.17.1 | ==3.17.2 | ==3.17.3 | ==3.17.4 | ==3.18.0 depends on cffi>=1.9, <2.0.0
                      no versions of snowflake-connector-python>3.16.0, <3.17.0 | >3.17.0, <3.17.1 | >3.17.1, <3.17.2 | >3.17.2, <3.17.3 | >3.17.3, <3.17.4 | >3.17.4, <3.18.0 | >3.18.0, <4.0.0
Resolver derivation tree after reduction
term root==0a0.dev0
  root==0a0.dev0 depends on uvicorn>=0.38
  term not uvicorn>=0.37.0, <0.38.0
  term root==0a0.dev0
    root==0a0.dev0 depends on fastapi-mail>=1.5.7
    term fastapi-mail>=1.5.7
    term not uvicorn>=0.37.0, <0.38.0
    term root==0a0.dev0
      root==0a0.dev0 depends on snowflake-sqlalchemy>=1.7.7
      term fastapi-mail>=1.5.7
      term snowflake-sqlalchemy>=1.7.7
      term not uvicorn>=0.37.0, <0.38.0
      term root==0a0.dev0
        root==0a0.dev0 depends on snowflake-connector-python>=3.16
        term fastapi-mail>=1.5.7
        term snowflake-sqlalchemy>=1.7.7
        term not uvicorn>=0.37.0, <0.38.0
        term not snowflake-connector-python<3.16.0
          no versions of snowflake-sqlalchemy>1.7.7
          term fastapi-mail>=1.5.7
          term snowflake-sqlalchemy==1.7.7
          term not uvicorn>=0.37.0, <0.38.0
          term not snowflake-connector-python<3.16.0
            snowflake-sqlalchemy==1.7.7 depends on snowflake-connector-python<4.0.0
            term fastapi-mail>=1.5.7
            term not uvicorn>=0.37.0, <0.38.0
            term snowflake-connector-python>=3.16.0, <4.0.0
              term fastapi-mail>=1.5.7, <1.5.8
              term not uvicorn>=0.37.0, <0.38.0
                no versions of fastapi-mail>1.5.7, <1.5.8 | >1.5.8
                fastapi-mail==1.5.7 depends on uvicorn>=0.37.0, <0.38.0
              term fastapi-mail>=1.5.7
              term snowflake-connector-python>=3.16.0, <4.0.0
                fastapi-mail>=1.5.7 depends on cryptography>=46.0.3
                term cryptography>=46.0.3
                term snowflake-connector-python>=3.16.0, <4.0.0
                  no versions of cryptography>46.0.3, <47.0.0
                  term cryptography==46.0.3
                  term snowflake-connector-python>=3.16.0, <4.0.0
                    cryptography==46.0.3 depends on cffi{platform_python_implementation != 'PyPy'}>=2.0.0
                    term not cffi>=1.9, <2.0.0
                    term snowflake-connector-python>=3.16.0, <4.0.0
                      snowflake-connector-python>=3.16.0, <=3.18.0 depends on cffi>=1.9, <2.0.0
                      no versions of snowflake-connector-python>3.16.0, <3.17.0 | >3.17.0, <3.17.1 | >3.17.1, <3.17.2 | >3.17.2, <3.17.3 | >3.17.3, <3.17.4 | >3.17.4, <3.18.0 | >3.18.0, <4.0.0
zanieb commented

Alright this is sort of a wild one... the contains calls at

Bound::Included(version) if !available_versions.contains(version) => {

and

Bound::Included(version) if !available_versions.contains(version) => {

can return false because if min components of the versions don't match