fix(rate-of-closure): repair three variation modules that are unimportable on main - #4523
Merged
Merged
Conversation
…main
`rate_of_closure.variation.regional_ground_study_adapter` cannot be imported on
current `main`:
ImportError: cannot import name 'to_ground_model_result'
from 'shared.python.swing_sim.ground'
Two of my own PRs combined to cause it. #4517 removed that name from the ground
package's eager exports, correctly — the package's own
`test_unqualified_compatibility_adapter_is_not_public` requires the explicitly
*unqualified* compatibility adapter to stay private, and it is absent from both
`__all__` and the lazy-import map. #4520 then landed a consumer importing it
from the package path. Neither PR's tests imported the adapter module, so both
were green while three modules could not be loaded at all:
`regional_ground_study_adapter`, `regional_ground_variation`, and
`regional_ground_target_projection`.
The import now names the owning module,
`shared.python.swing_sim.ground.result_adapter`, which does export it. That
keeps the package contract intact — the unqualified adapter is still not
package-public — while making the unqualified dependency explicit where it is
used, which is the honest thing for a compatibility path.
Adds `tests/rate_of_closure/test_variation_module_importability.py`, which
imports every module in the package. This is the check that was missing: a
suite can be entirely green while a module in it is unreachable, and no
existing gate covers that. It also catches the neighbouring cases — a symbol
dropped from a package's `__all__`, a rename, a new circular import. Verified
by reverting the one-line fix: 3 failed, 35 passed.
The ground contract test still passes, so this does not weaken what #4517
established. Scoped ruff and ruff format clean.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
dieterolson
enabled auto-merge (squash)
August 17, 2026 13:13
ruff-format flagged the added test; formatted. SPEC row renumbered to 1.17.24 above the merged ground-playback 1.17.23.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mainis currently broken. Three modules cannot be imported:Affected:
regional_ground_study_adapter,regional_ground_variation,regional_ground_target_projection.Two of my own PRs combined to cause it
to_ground_model_resultfrom the ground package's eager exports — correctly. That package's owntest_unqualified_compatibility_adapter_is_not_publicrequires the explicitly unqualified compatibility adapter to stay private, and it is absent from both__all__and the lazy-import map.Neither PR's tests imported the adapter module, so both were green while three modules could not load at all.
The fix
The import now names the owning module,
shared.python.swing_sim.ground.result_adapter, which does export it. That keeps the package contract intact — the unqualified adapter is still not package-public — while making the unqualified dependency explicit at the call site, which is the honest thing for a compatibility path. The ground contract test still passes, so nothing #4517 established is weakened.The check that was missing
tests/rate_of_closure/test_variation_module_importability.pyimports every module in the package.A suite can be entirely green while a module in it is unreachable, and no existing gate covered that. This also catches the neighbouring cases: a symbol dropped from a package's
__all__, a rename, a new circular import.Verified by reverting the one-line fix: 3 failed, 35 passed.
Please prioritise — every PR branched from current
maininherits the breakage.🤖 Generated with Claude Code