Skip to content

refactor: decompose build_context into focused submodules#3076

Merged
messense merged 2 commits into
PyO3:mainfrom
messense:refactor/decompose-build-context
Mar 9, 2026
Merged

refactor: decompose build_context into focused submodules#3076
messense merged 2 commits into
PyO3:mainfrom
messense:refactor/decompose-build-context

Conversation

@messense

@messense messense commented Mar 9, 2026

Copy link
Copy Markdown
Member

Split build_context/mod.rs (1118 lines) into three focused files:

  • mod.rs (255 lines): struct definition, build_wheels() dispatch, platform tags, excludes — the orchestrator
  • wheels.rs (497 lines): all bridge-specific wheel builders (pyo3/abi3/cffi/uniffi/bin) and the shared write_wheel pipeline
  • repair.rs (396 lines): auditwheel policy checking, external lib grafting, rpath patching, artifact staging, reflink helpers

Pure code-motion refactor, no logic changes, no public API changes.

Split build_context/mod.rs (1118 lines) into three focused files:

- mod.rs (255 lines): struct definition, build_wheels() dispatch,
  platform tags, excludes — the orchestrator
- wheels.rs (497 lines): all bridge-specific wheel builders
  (pyo3/abi3/cffi/uniffi/bin) and the shared write_wheel pipeline
- repair.rs (396 lines): auditwheel policy checking, external lib
  grafting, rpath patching, artifact staging, reflink helpers

Pure code-motion refactor, no logic changes, no public API changes.
@messense messense requested a review from Copilot March 9, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the build_context module by extracting wheel building and auditwheel/repair logic into dedicated submodules, reducing the size and responsibilities of build_context/mod.rs without intended behavior changes.

Changes:

  • Extracted wheel-building logic into src/build_context/wheels.rs.
  • Extracted auditwheel/repair + artifact staging/reflink helpers into src/build_context/repair.rs.
  • Slimmed src/build_context/mod.rs into an orchestrator module wiring the new submodules.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/build_context/mod.rs Wires in new wheels + repair submodules and removes the moved implementations from mod.rs.
src/build_context/wheels.rs Hosts wheel builders (pyo3/abi3/cffi/uniffi/bin) and the shared write_wheel pipeline.
src/build_context/repair.rs Hosts auditwheel policy checking, grafting/patching logic, artifact staging, and reflink helpers.

Comment thread src/build_context/wheels.rs Outdated
Comment thread src/build_context/repair.rs Outdated
Comment thread src/build_context/repair.rs Outdated
@messense messense merged commit 8f09973 into PyO3:main Mar 9, 2026
44 of 45 checks passed
@messense messense deleted the refactor/decompose-build-context branch March 9, 2026 14:14
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.

2 participants