Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge custom incompatibility reasons #232

Open
konstin opened this issue Jun 7, 2024 · 1 comment
Open

Merge custom incompatibility reasons #232

konstin opened this issue Jun 7, 2024 · 1 comment

Comments

@konstin
Copy link
Member

konstin commented Jun 7, 2024

When two versions of a package have the same dependency we merge that into one incompatibility in merge_incompatibility. This allows us to avoid saying "Because a==1.0.0 depends on b>2 and you have b==1 and because a==1.1.0 depends on b>2 and you have b==1, ..." and skip directly to "Because a>=1.0.0 depends on b>2 and you have b==1, ..". Pubgrub should perform the same merging for custom incompatibilities.

Here's a shortened example, the full error message is 200 lines long, most of which are just telling me that tensorflow is missing compatible wheels for a version range:

  × No solution found when resolving dependencies:
  ╰─▶ Because transformers:dev==4.39.0.dev0 depends on transformers==4.39.0.dev0 and
      transformers==4.39.0.dev0 depends on tensorflow>=2.6,<2.16, we can conclude that
      transformers:dev==4.39.0.dev0 depends on tensorflow>=2.6,<2.16. (1)

      Because only the following versions of tensorflow are available:
          tensorflow<=2.6.5
          tensorflow>=2.7.0
      and tensorflow==2.6.0 has no wheels are available with a matching Python ABI, we can conclude that
      any of:
          tensorflow>=2.6.0,<2.6.1
          tensorflow>2.6.5,<2.7.0
       cannot be used.
      And because tensorflow==2.6.1 has no wheels are available with a matching Python ABI and
      tensorflow==2.6.2 has no wheels are available with a matching Python ABI, we can conclude that any of:
          tensorflow>=2.6.0,<2.6.3
          tensorflow>2.6.5,<2.7.0
       cannot be used.
      And because tensorflow==2.6.3 has no wheels are available with a matching Python ABI and
      tensorflow==2.6.4 has no wheels are available with a matching Python ABI, we can conclude that any of:
          tensorflow>=2.6.0,<2.6.5
          tensorflow>2.6.5,<2.7.0
       cannot be used.
      And because tensorflow==2.6.5 has no wheels are available with a matching Python ABI and
      tensorflow==2.7.0 has no wheels are available with a matching Python ABI, we can conclude that
      tensorflow>=2.6.0,<2.7.1 cannot be used.
      And because tensorflow==2.7.1 has no wheels are available with a matching Python ABI and
      tensorflow==2.7.2 has no wheels are available with a matching Python ABI, we can conclude that
      tensorflow>=2.6.0,<2.7.3 cannot be used.
      And because tensorflow==2.7.3 has no wheels are available with a matching Python ABI and
      tensorflow==2.7.4 has no wheels are available with a matching Python ABI, we can conclude that
      tensorflow>=2.6.0,<2.8 cannot be used.
      And because we know from (1) that transformers:dev==4.39.0.dev0 depends on tensorflow>=2.6,<2.16, we
      can conclude that transformers:dev==4.39.0.dev0 depends on tensorflow>=2.8,<2.16.
      And because transformers==4.39.0.dev0 depends on tensorflow<2.8 and transformers:dev==4.39.0.dev0, we
      can conclude that transformers==4.39.0.dev0 cannot be used.
      And because only transformers==4.39.0.dev0 is available and transformers 

I can create a reproducible example if it's required.

Ref astral-sh/uv#2519

@zanieb
Copy link
Member

zanieb commented Aug 16, 2024

@Eh2406 you may be interested in astral-sh/uv#6154 — to get started, I'm implementing the collapse on the derivation tree instead of in the resolver.

zanieb added a commit to astral-sh/uv that referenced this issue Aug 16, 2024
Uses my expanding tree reduction knowledge from #6092 to improve the
long-standing issue of verbose messages for unavailable packages.

Implements pubgrub-rs/pubgrub#232, but
post-resolution instead of during resolution.

Partially addresses #5046
Closes #2519
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants