-
Notifications
You must be signed in to change notification settings - Fork 908
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for
--no-extra
flag and setting (#9387)
<!-- Thank you for contributing to uv! To help us review effectively, please ensure that: - The pull request includes a summary of the change. - The title is descriptive and concise. - Relevant issues are referenced where applicable. --> ## Summary Resolves #9333 This pull request introduces support for the `--no-extra` command-line flag and the corresponding `no-extra` UV setting. ### Behavior - When `--all-extras` is supplied, the specified extras in `--no-extra` will be excluded from the installation. - If `--all-extras` is not supplied, `--no-extra` has no effect and is safely ignored. ## Test Plan Since `ExtrasSpecification::from_args` and `ExtrasSpecification::extra_names` are the most important parts in the implementation, I added the following tests in the `uv-configuration/src/extras.rs` module: - **`test_no_extra_full`**: Verifies behavior when `no_extra` includes the entire list of extras. - **`test_no_extra_partial`**: Tests partial exclusion, ensuring only specified extras are excluded. - **`test_no_extra_empty`**: Confirms that no extras are excluded if `no_extra` is empty. - **`test_no_extra_excessive`**: Ensures the implementation ignores `no_extra` values that don't match any available extras. - **`test_no_extra_without_all_extras`**: Validates that `no_extra` has no effect when `--all-extras` is not supplied. - **`test_no_extra_without_package_extras`**: Confirms correct behavior when no extras are available in the package. - **`test_no_extra_duplicates`**: Verifies that duplicate entries in `pkg_extras` or `no_extra` do not cause errors. --------- Co-authored-by: Charlie Marsh <[email protected]>
- Loading branch information
1 parent
c63616c
commit e485dfd
Showing
12 changed files
with
297 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.