Summary
[tool.pytest.ini_options] has been updated to set filterwarnings = ["error"] so any unexpected DeprecationWarning / UserWarning / ResourceWarning from astropy / numpy / Pillow / picmaker itself becomes a test failure instead of silent noise (see also priority 3 of CODEBASE_CRITIQUE.md).
Two follow-up tasks are tracked here so the temporary mitigations don't outlive their purpose.
Active mitigations
-
Pillow 12 deprecation of Image.Image.getdata() is currently ignored via a targeted entry:
filterwarnings = [
"error",
"ignore:Image.Image.getdata is deprecated:DeprecationWarning",
]
src/picmaker/pil_utils.py calls image.getdata() in four places (_one_pil_to_array line 106 / 118, write_pil lines 140 / 149). Pillow 12 deprecates this in favor of image.get_flattened_data(), with removal in Pillow 14 (2027-10-15). The migration is mechanical but touches the snapshot-test fixtures because the underlying buffer dtype/shape differ.
Action: migrate pil_utils.py to get_flattened_data(), regenerate tests/fixtures/expected/ snapshots via python tests/fixture_recipes/generate_snapshots.py, and remove the targeted ignore::DeprecationWarning filter.
-
ReadTiff16 file-handle leak has been addressed (the body of ReadTiff16 is now wrapped in a with open(...) as f: block, so the file is closed even if my_assert(...) / raise OSError(...) short-circuits mid-parse). This fix was forced by filterwarnings = ["error"] turning the underlying ResourceWarning into pytest.PytestUnraisableExceptionWarning. WriteTiff16 has the same f = open(...) / f.close() pattern but isn't currently surfacing because no test exercises a partial write — worth converting in the same tiff16.py modernization PR (priority 6 of CODEBASE_CRITIQUE.md).
Why this matters
- Without
filterwarnings = ["error"], a new Pillow / astropy / numpy deprecation would land in the test output and nobody would notice until the runtime broke. The strict setting catches drift the day it arrives.
- The Pillow getdata migration is a hard deadline (Pillow 14, 2027-10-15) — leaving it until just before removal risks colliding with other in-flight work.
Acceptance criteria
Summary
[tool.pytest.ini_options]has been updated to setfilterwarnings = ["error"]so any unexpectedDeprecationWarning/UserWarning/ResourceWarningfrom astropy / numpy / Pillow / picmaker itself becomes a test failure instead of silent noise (see also priority 3 ofCODEBASE_CRITIQUE.md).Two follow-up tasks are tracked here so the temporary mitigations don't outlive their purpose.
Active mitigations
Pillow 12 deprecation of
Image.Image.getdata()is currently ignored via a targeted entry:src/picmaker/pil_utils.pycallsimage.getdata()in four places (_one_pil_to_arrayline 106 / 118,write_pillines 140 / 149). Pillow 12 deprecates this in favor ofimage.get_flattened_data(), with removal in Pillow 14 (2027-10-15). The migration is mechanical but touches the snapshot-test fixtures because the underlying buffer dtype/shape differ.Action: migrate
pil_utils.pytoget_flattened_data(), regeneratetests/fixtures/expected/snapshots viapython tests/fixture_recipes/generate_snapshots.py, and remove the targetedignore::DeprecationWarningfilter.ReadTiff16file-handle leak has been addressed (the body ofReadTiff16is now wrapped in awith open(...) as f:block, so the file is closed even ifmy_assert(...)/raise OSError(...)short-circuits mid-parse). This fix was forced byfilterwarnings = ["error"]turning the underlyingResourceWarningintopytest.PytestUnraisableExceptionWarning.WriteTiff16has the samef = open(...)/f.close()pattern but isn't currently surfacing because no test exercises a partial write — worth converting in the sametiff16.pymodernization PR (priority 6 ofCODEBASE_CRITIQUE.md).Why this matters
filterwarnings = ["error"], a new Pillow / astropy / numpy deprecation would land in the test output and nobody would notice until the runtime broke. The strict setting catches drift the day it arrives.Acceptance criteria
src/picmaker/pil_utils.pyno longer callsImage.getdata()(useget_flattened_data()).tests/fixtures/expected/regenerated and committed.ignore:Image.Image.getdata is deprecated:DeprecationWarningentry removed from[tool.pytest.ini_options].filterwarnings.WriteTiff16wrapped inwith open(...) as f:so the same file-handle leak doesn't fire on partial-write failures.