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

Requires-python conflicts inside a workspace #5578

Closed
bluss opened this issue Jul 29, 2024 · 2 comments · Fixed by #5644
Closed

Requires-python conflicts inside a workspace #5578

bluss opened this issue Jul 29, 2024 · 2 comments · Fixed by #5644
Assignees
Labels
needs-decision Undecided if this should be done preview Experimental behavior

Comments

@bluss
Copy link
Contributor

bluss commented Jul 29, 2024

Workspaces seem to require that all members use the same requires-python. Maybe this can be relaxed, or a dedicated error can explain it.

Steps to reproduce

uv init --virtual root
cd root
uv init -p 3.11 a
uv init -p 3.12 b
uv sync

It should have set up two projects a, b in the same workspace with conflicting requires-python of >= 3.11 and >= 3.12.

Actual Behaviour

  × No solution found when resolving dependencies:
  ╰─▶ Because the requested Python version (>=3.11) does not satisfy Python>=3.12 and
      b==0.1.0 depends on Python>=3.12, we can conclude that b==0.1.0 cannot be used.
      And because only b==0.1.0 is available and you require b, we can conclude that the
      requirements are unsatisfiable.

      hint: The `requires-python` value (>=3.11) includes Python versions that are not
      supported by your dependencies (e.g., b==0.1.0 only supports >=3.12). Consider using
      a more restrictive `requires-python` value (like >=3.12).

Expected Behaviour

Logically, the combination of a and b is fine to use with any python >= 3.12. There would be a reason to emit error is if a depends directly on b.

This situation seems to happen quite easily. Not sure what's the best way to improve.

uv 0.2.31
platform: linux (x86_64)

@charliermarsh
Copy link
Member

Right now we take the union of the versions. I think what you're suggesting is we could take the intersection...

@charliermarsh
Copy link
Member

Thinking on this more, I think intersection is probably right here (as long as we reject trying to install at a lower version).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-decision Undecided if this should be done preview Experimental behavior
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants