-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
Summary
I'm working on a project that requires different versions of the same package for two separate environments. For example, I need numpy==2.1.2 for one environment and numpy==2.0.0 for another. However, UV does not seem to support this scenario, as it results in dependency resolution conflicts.
Expected behavior
Is there a way to specify different versions of the same package in separate optional dependencies without causing conflicts?
Example
Here is a simplified example of my pyproject.toml file:
dependencies = [
"some-shared-lib",
]
[project.optional-dependencies]
project1 = [
"numpy==2.1.2",
"some-other-lib",
]
project2 = [
"numpy==2.0.0",
"some-other-lib",
]Issue
When I run uv sync with this configuration, I get No solution found when resolving dependencies for split (python_full_version == '3.11.*') error.
My current uv version is 0.4.19 installed from brew.
Why this would be useful
In cases like our repository, where different subprojects require different versions of the same package, not having this feature forces us to create a separate project for each subproject within the same repository. This approach is less convenient compared to having distinct optional dependencies that are exclusive to each other.