Summary
tests/helpers/maturin.py is a 177-line module with 9 functions that currently serves only 3 tests introduced as part of a maturin version pin update (PR #59). The module includes:
- General-purpose wheel-metadata normalisation logic (platform tag normalisation, dist-info suffix handling, WHEEL/METADATA parsing) that goes well beyond the requirements of a version synchronisation check.
- Speculative platform-variability handling that is not exercised by any current consumer.
- No documented reuse strategy or evidence that a second consumer is planned.
This level of abstraction is disproportionate to the problem scope and adds maintenance burden without clear benefit.
Resolution
- Inline the pin-collection logic (currently in
collect_maturin_pins and expected_maturin_version) directly into cuprum/unittests/test_maturin_build.py, where it has a single consumer.
- Retain a minimal
wheel_build_snapshot helper only if the wheel-introspection logic cannot be cleanly inlined.
- Remove speculative platform-variability normalisation that is not required by any current test.
- Document a reuse strategy in
docs/developers-guide.md before re-externalising helpers into a shared module.
Context
Identified during review of PR #59 (maturin 1.6.0 → 1.13.3 version bump).
PR: #59
Raised by @leynos.
Summary
tests/helpers/maturin.pyis a 177-line module with 9 functions that currently serves only 3 tests introduced as part of a maturin version pin update (PR #59). The module includes:This level of abstraction is disproportionate to the problem scope and adds maintenance burden without clear benefit.
Resolution
collect_maturin_pinsandexpected_maturin_version) directly intocuprum/unittests/test_maturin_build.py, where it has a single consumer.wheel_build_snapshothelper only if the wheel-introspection logic cannot be cleanly inlined.docs/developers-guide.mdbefore re-externalising helpers into a shared module.Context
Identified during review of PR #59 (maturin 1.6.0 → 1.13.3 version bump).
PR: #59
Raised by @leynos.