Silence the three autonerves-rooted CLI-noise sources - #149
Merged
Conversation
Fixes the three root causes identified by the 2026-08-06 /cli_noise_clean audit (PyAutoMind draft/maintenance/pyautonerves/cli_noise_autonerves_batch.md): 1. fits leak — fitsable.ndarray_via_fits_from and header_obj_from called fits.open without closing, emitting 'ResourceWarning: unclosed file' in every downstream repo that loads FITS. Both now use 'with fits.open(...)'. 2. pytest collection — test_test_mode.py imported the real API functions test_mode_level/test_mode_samples by bare name, so pytest collected them as tests (PytestReturnNotNoneWarning, an ERROR in future pytest). The unused test_mode_level import is dropped and test_mode_samples is aliased to _test_mode_samples. 3. check_version false positive — with workspace_root defaulting to cwd, every library import from inside a library's own source repo warned 'Cannot verify the workspace ... is compatible'. check_version now skips silently when the root is a package source checkout (setup.py or pyproject.toml at its top level) and no version floor is recorded; a recorded floor is still enforced, and a genuine workspace missing its version keys still warns. Regression tests added for all three. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015NrwGppUCg8r4Foed6bgSf
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.
Implements PyAutoMind
draft/maintenance/pyautonerves/cli_noise_autonerves_batch.md— the three CLI-noise root causes from the 2026-08-06/cli_noise_cleanaudit:ndarray_via_fits_fromcalledfits.openwithout closing, emittingResourceWarning: unclosed filein every downstream repo that loads FITS. Now useswith fits.open(...); the same fix is applied toheader_obj_from, which had the identical unclosed-handle pattern.test_test_mode.pyimported the real API functionstest_mode_level/test_mode_samplesby bare name, so pytest collected them as tests (PytestReturnNotNoneWarning, an ERROR in a future pytest). The unusedtest_mode_levelimport is dropped andtest_mode_samplesis aliased to_test_mode_sampleswith a comment explaining why.check_versionfalse positive — withworkspace_rootdefaulting to cwd, every library import from inside a library's own source repo warned "Cannot verify the workspace ... is compatible".check_versionnow skips silently when the root is a package source checkout (setup.pyorpyproject.tomlat its top level) and no version floor is recorded. A recorded floor is still enforced, and a genuine workspace missing its version keys still warns.Surface decision noted in the Mind prompt:
check_versionremains the surface of the workspace-facing libraries (autofit/autogalaxy/autolens); autoarray/autonerves intentionally do not call it.Regression tests added for all three; full
test_autonervessuite passes 157/157 underpytest -W allwith none of the three warnings remaining.🤖 Generated with Claude Code
https://claude.ai/code/session_015NrwGppUCg8r4Foed6bgSf
Generated by Claude Code