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

Redundant message when running sync with invalid dependencies and optional dependencies #10062

Open
mrob95 opened this issue Dec 20, 2024 · 2 comments
Assignees
Labels
error messages Messaging when something goes wrong

Comments

@mrob95
Copy link

mrob95 commented Dec 20, 2024

UV version: 0.5.9

Repro pyproject.toml:

[project]
name = "my-project"
version = "0.1.0"
description = "...."
requires-python = ">=3.10"
readme = "README.md"
dependencies = [
    "pydantic>=7",
]

[project.optional-dependencies]
dev = [
    "ruff>=0.6",
]

pydantic only has up to version 2, so this should fail, and it does, but it fails with the following message:

  × No solution found when resolving dependencies:
  ╰─▶ Because only pydantic<=2.10.4 is available and your project depends on pydantic>=7, we can conclude that your project's requirements are unsatisfiable.
      And because your project requires my-project[dev], we can conclude that your project's requirements are unsatisfiable.

The second sentence here seems redundant and reads oddly.

Removing the optional dependencies removes the redundant line:

  × No solution found when resolving dependencies:
  ╰─▶ Because only pydantic<=2.10.4 is available and your project depends on pydantic>=7, we can conclude that your project's requirements are unsatisfiable.

I would consider also removing 'we can conclude that' - seems unnecessary.

This is the biggest issue I have found in 2 days of converting projects to use UV, so great job and thank you!

@zanieb zanieb added the error messages Messaging when something goes wrong label Dec 20, 2024
@zanieb zanieb self-assigned this Dec 20, 2024
@zanieb
Copy link
Member

zanieb commented Dec 20, 2024

Thanks for the report!

Glad you're enjoying the tool :)

@zanieb
Copy link
Member

zanieb commented Dec 20, 2024

For my own reference, the derivation tree is

Resolver derivation tree before reduction
term root==0a0.dev0
  root==0a0.dev0 depends on my-project[dev]*
  term my-project[dev]*
    term my-project==0.1.0
      my-project==0.1.0 depends on pydantic>=7
      no versions of pydantic>=7
    no versions of my-project[dev]<0.1.0 | >0.1.0
Resolver derivation tree after reduction
term root==0a0.dev0
  root==0a0.dev0 depends on my-project[dev]*
  term my-project==0.1.0
    my-project==0.1.0 depends on pydantic>=7
    no versions of pydantic>=7

The clause root==0a0.dev0 depends on my-project[dev]* is useless and wrong? It's possible there's a bug in the resolver here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

No branches or pull requests

2 participants