Add per-build dependencies and normalized exclusions.
Review Request #15044 — Created May 12, 2026 and submitted
During the development of buildthings, one of the goals was to allow
editable builds to exclude certain dependencies. This was removed
accidentally during the move to build isolation dependency control.This change brings that functionality back and improves it.
All build types can now specify their own lists of dependencies, which
default to the standard dependencies set. They can also specify their
own exclusions.Exclusions, both on dependencies and isolations, are now normalized.
The name in an exclusion can now match against a name with a version
specifier in the dependencies list. Names are also canonicalized, so
they don't have to be an exact match.Unit tests covering the dependency options for build isolation, package
metadata, and builds have been added, along with the underlying methods
used for normalizing and filtering dependencies. These tests have been
moved intobuildthings/tests/so that we can reliably import test
modules for utilities.
Built packages in Review Board using both dependencies and exclusions.
Checked the resulting lists.Installed in editable mode and verified it also used the right
dependencies and exclusions.All unit tests pass.
| Summary | ID |
|---|---|
| 191e79ad4df7f1211d2a0adb42765f0c28283e63 |
| Description | From | Last Updated |
|---|---|---|
|
It seems like these shouldn't have isolation in them. |
|
|
|
You added a whole big section for .exclude-deps, but .dependencies only gets this. Can we make a section for this … |
|
|
|
Don't we need to be applying exclusions here? It seems like we're correctly excluding dependencies inside the isolated environment, but … |
|
|
|
Same here. |
|
|
|
Same here. |
|
|
|
It might be nice to validate that these are lists (in the way that _load_dependencies does). |
|
|
|
It might be surprising that package[extras] wouldn't match an exclusion of package. Can we at least note in here that … |
|
|
|
This can be *package_deps_config['dependencies'] |
|
|
|
typo: arguments -> argument |
|
|
|
We're not validating the type in this branch. Can we make a small helper to do the validation bit that … |
|
|
|
Need to add "Returns:" to this docstring now. |
|
|
|
PEP685 says that extras names should be normalized using the same rules as project names, so this should probably be: … |
|
|
|
I think when we're in greenfield packages where we're truly using pytest-style tests, we should use real python docstrings with … |
|
|
|
Leftover debug code. |
|
-
-
-
You added a whole big section for
.exclude-deps, but.dependenciesonly gets this. Can we make a section for this too? -
Don't we need to be applying exclusions here? It seems like we're correctly excluding dependencies inside the isolated environment, but the resulting wheel file would have
Requires-Distwith all dependencies in it. -
-
-
-
It might be surprising that
package[extras]wouldn't match an exclusion ofpackage. Can we at least note in here that extras will be included in the returned name?
- Change Summary:
-
- Fixed up exclusions for all dependency lists.
- Added a comprehensive test suite. This now lives in
buildthings/tests/, since we need to be able to reliably import a utils module. - Fixed bad override keys in the dependencies docs.
- Improved internal docs when it comes to
[extras]support.
- Description:
-
During the development of buildthings, one of the goals was to allow
editable builds to exclude certain dependencies. This was removed accidentally during the move to build isolation dependency control. This change brings that functionality back and improves it.
All build types can now specify their own lists of dependencies, which
default to the standard dependencies set. They can also specify their own exclusions. Exclusions, both on dependencies and isolations, are now normalized.
The name in an exclusion can now match against a name with a version specifier in the dependencies list. Names are also canonicalized, so they don't have to be an exact match. + + Unit tests covering the dependency options for build isolation, package
+ metadata, and builds have been added, along with the underlying methods + used for normalizing and filtering dependencies. These tests have been + moved into buildthings/tests/so that we can reliably import test+ modules for utilities. - Testing Done:
-
Built packages in Review Board using both dependencies and exclusions.
Checked the resulting lists. Installed in editable mode and verified it also used the right
dependencies and exclusions. + + All unit tests pass.
- Commits:
-
Summary ID ad480abd541cb36506fb181b275094ba8e79f034 690b984189cb89b5e03994c521fefbc2cb5a1306
Checks run (2 succeeded)
-
-
-
-
We're not validating the type in this branch.
Can we make a small helper to do the validation bit that you added twice above so we can use it here too?
-
-
PEP685 says that extras names should be normalized using the same rules as project names, so this should probably be:
extras_str = ','.join(sorted(canonicalize_name(e) for e in extras)) -
I think when we're in greenfield packages where we're truly using pytest-style tests, we should use real python docstrings with imperative mood and trailing periods.
So "Test get_requires_for_build_editable."
Same for the rest of the test cases.
-
- Change Summary:
-
- Reworked unit test docstrings.
- Fixed doc issues.
- Normalized extras names.
- Reused an already-fetched variable.
- Removed debug code.
- Commits:
-
Summary ID 690b984189cb89b5e03994c521fefbc2cb5a1306 191e79ad4df7f1211d2a0adb42765f0c28283e63