-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
Summary
Our project (Annif) has just switched from Poetry to uv. It has quite a few extras (optional dependencies) so the --extra option is needed a lot. We also had to write a little for loop in our Dockerfile just to construct the --extra options for uv sync, where previously (with Poetry) a simple variable substitution did the trick.
Unlike Poetry, uv currently only supports a long --extra option that may be repeated. To improve the developer experience, I would like to propose shorter forms of that option, matching what Poetry supports.
In Poetry, I can run poetry install -E foo,bar to install the package with the extras foo and bar.
uv sync (current version 0.9.26 on Linux) doesn't support the short form -E:
$ uv sync -E foo
error: unexpected argument '-E' found
Usage: uv sync [OPTIONS]
For more information, try '--help'.
uv sync --extra also doesn't support a comma-separated list of extras:
$ uv sync --extra foo,bar
error: invalid value 'foo,bar' for '--extra <EXTRA>': Extra names must start and end with a letter or digit and may only contain -, _, ., and alphanumeric characters
For more information, try '--help'.
Since both of these currently trigger errors, I think it should be unproblematic to add support for the shorter forms, i.e.
- A short option
-Ethat works the same way as--extra - Support for a comma-separated value for
--extra/-Eas an alternative for repeating the option
PS. I tried looking for existing issues with similar proposals but couldn't find any. I hope I didn't miss something.
Example
I would like this command to work (when extras foo and bar are defined):
uv sync -E foo,bar