uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv sync` always tries to resolve all `optional-dependencies`

Open chrisjsewell opened this issue 5 months ago • 5 comments

the initial options of uv sync would lead me to believe that extras should not be resolved by default

$ uv sync --help       
Update the project's environment

Usage: uv sync [OPTIONS]

Options:
      --extra <EXTRA>                            Include optional dependencies from the extra group name
      --all-extras                               Include all optional dependencies

yet when I try to run it, I get e.g:

$ uv sync
× No solution found when resolving dependencies:
...
because myproject[docs] depends on projectx ...

It's weird, because if I remove projectx from the doc optional-dependencies, it works and none of the other dependencies in doc are included in the .venv


I see this is because uv tries to add all optional-dependencies to the uv.lock first, but what if I do not want them in there, because they have incompatibilities

chrisjsewell avatar Aug 27 '24 23:08 chrisjsewell