Adding -E shorthand for --extra flag#18076
Adding -E shorthand for --extra flag#18076suryawanshishantanu6 wants to merge 2 commits intoastral-sh:mainfrom
Conversation
Resolve conflict in crates/uv/tests/it/export.rs by keeping both: - export_extra_shorthand (testing -E shorthand) - pylock_toml_filter_by_requires_python (testing pylock.toml format)
|
I don't think we have consensus that we want to do this. |
|
(which is the hard part of a change like this) |
|
Thanks for the quick review @zanieb! I completely understand the need to be conservative with the short-flag namespace. My main motivation here is that poetry already uses -E for --extras. Since many users (myself included) are migrating workflows from Poetry to uv, having parity with that shorthand makes the transition smoother and improves muscle memory. Given that --extra is a high-frequency flag for local development (similar to how we use -r for requirements), the ergonomic benefit of -E feels substantial. Is there a concern that -E might be needed for a different feature in the future, or is the preference simply to minimize aliases generally? Happy to open a Discussion thread if that’s a better place to weigh the pros/cons. |
|
See also #17525 (comment)
Both. Once we use a flag, we're stuck with it forever, so we've been conservative. #17511 seems like the best place to discuss |
|
Thanks! |
Summary
This PR adds the -E shorthand flag for --extra across all relevant uv commands (uv pip compile, uv pip sync, uv pip install, uv run, uv sync, uv add, uv export). This improves CLI ergonomics by providing a shorter way to specify extras and saves time.
Test Plan