Skip to content

Simplify tests/helpers/maturin.py: inline pin-collection logic and remove speculative abstractions #97

Description

@coderabbitai

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions