Skip to content

Silence the three autonerves-rooted CLI-noise sources - #149

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/autonerves-cli-noise-h1w8sq
Aug 18, 2026
Merged

Silence the three autonerves-rooted CLI-noise sources#149
Jammy2211 merged 1 commit into
mainfrom
claude/autonerves-cli-noise-h1w8sq

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Implements PyAutoMind draft/maintenance/pyautonerves/cli_noise_autonerves_batch.md — the three CLI-noise root causes from the 2026-08-06 /cli_noise_clean audit:

  1. fits leakndarray_via_fits_from called fits.open without closing, emitting ResourceWarning: unclosed file in every downstream repo that loads FITS. Now uses with fits.open(...); the same fix is applied to header_obj_from, which had the identical unclosed-handle pattern.
  2. pytest collectiontest_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 a future pytest). The unused test_mode_level import is dropped and test_mode_samples is aliased to _test_mode_samples with a comment explaining why.
  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.

Surface decision noted in the Mind prompt: check_version remains 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_autonerves suite passes 157/157 under pytest -W all with none of the three warnings remaining.

🤖 Generated with Claude Code

https://claude.ai/code/session_015NrwGppUCg8r4Foed6bgSf


Generated by Claude Code

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
@Jammy2211
Jammy2211 merged commit b6b6ab6 into main Aug 18, 2026
2 checks passed
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