Skip to content

feat: multiple files from workspaces#2825

Draft
henryiii wants to merge 5 commits intopypa:mainfrom
henryiii:henryiii/feat/workspace
Draft

feat: multiple files from workspaces#2825
henryiii wants to merge 5 commits intopypa:mainfrom
henryiii:henryiii/feat/workspace

Conversation

@henryiii
Copy link
Copy Markdown
Contributor

@henryiii henryiii commented Apr 22, 2026

Looking at supporting uv build's multiple file output. This is a first pass at it. I've added a new test with two compiled wheels, and tried to generalize to multiple wheels. Making a PR now so I can look over it later, build in CI, & trigger GH review. I don't have a setup for running the non-unit tests at the moment.

🤖 Assisted-by: OpenCode:Kimi-K2.6 (open-source model)

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Assisted-by: OpenCode:Kimi-K2.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
All tasks are complete. Here's a summary of the changes made:

- **`_wheel_is_compatible()`**: Extracted the core compatibility check from `find_compatible_wheel` into a standalone function
- **`find_all_compatible_wheels()`**: Returns *all* compatible wheels for an identifier (not just the first)
- **`should_skip_build()`**: New function that returns `True` only if *all* previously built wheels are compatible with the current identifier. This fixes the workspace bug where an `abi3` subpackage would incorrectly skip a rebuild of a normal subpackage.
- Added unit tests for both new functions

- **`build_end()`** now accepts `Path | Sequence[Path] | None`
- When a list of wheels is passed, one `BuildInfo` row per wheel is appended to the summary
- Added `Sequence` import

- **Linux** (`linux.py`): Discovers all wheels via `container.glob()`, repairs each one individually using per-wheel temp dirs, tests install all wheels, copies all back to host
- **macOS** (`macos.py`): Same pattern with `list(built_wheel_dir.glob("*.whl"))` and per-wheel repair dirs
- **Windows** (`windows.py`): Same pattern
- **iOS** (`ios.py`): Consistency update (no uv support yet)
- **Pyodide** (`pyodide.py`): Consistency update (no uv support yet)
- **Android** (`android.py`): Renamed `build_wheel()` → `build_wheels()` returning `list[Path]`, renamed `test_wheel()` → `test_wheels()` accepting `list[Path]`

1. Use `should_skip_build()` instead of `find_compatible_wheel()` to decide whether to skip
2. If skipping: collect all compatible wheels and use them for testing
3. If building: discover all `*.whl` files in the output dir
4. Repair each wheel individually (using unique temp dirs like `repaired_wheel_0`, `repaired_wheel_1`)
5. Install **all** wheels into the test virtualenv before running tests
6. Move all repaired wheels to the output directory
7. Call `log.build_end()` with the list of output wheels

- All existing `unit_test` tests pass ✅
- `nox -s lint` passes (ruff check + format + mypy 3.11 + mypy 3.14) ✅

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Assisted-by: OpenCode:Kimi-K2.6
Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant