uv/docs
Li-Lun Lin e485dfd7f1
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 <charlie.r.marsh@gmail.com>
2024-11-24 02:25:09 +00:00
..
.overrides Use | for page separator in meta titles (#6953) 2024-09-03 00:42:59 +00:00
assets Add `static` assets to docs pages (#6951) 2024-09-02 20:00:30 -04:00
concepts Fix header level of "Conflicting dependencies" page (#9330) 2024-11-21 11:44:22 -06:00
configuration docs: reference `--no-progress` option in related environment variable (#9357) 2024-11-22 14:51:53 +00:00
getting-started Bump version to v0.5.4 (#9290) 2024-11-20 16:01:24 -05:00
guides Bump version to v0.5.4 (#9290) 2024-11-20 16:01:24 -05:00
js Add support for anchor redirects with client-side js (#9212) 2024-11-19 22:32:43 -06:00
pip DOC - Fix syntax for local directory installation (#9193) 2024-11-18 08:31:01 -05:00
reference feat: add support for `--no-extra` flag and setting (#9387) 2024-11-24 02:25:09 +00:00
stylesheets Add breadcrumbs to the documentation (#9242) 2024-11-19 22:31:43 -06:00
.gitignore Add structured documentation (#4426) 2024-06-26 11:28:42 -05:00
index.md Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00
requirements-insiders.in Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements-insiders.txt Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00
requirements.in Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00
requirements.txt Reorganize the project concept documentation (#9121) 2024-11-19 13:52:12 -06:00