src/picmaker/tiff16.py exposes two public functions whose PascalCase names violate the project's N802 ruff rule:
WriteTiff16(filename, array, …)
ReadTiff16(filename, …)
These are the only entries in [tool.ruff.lint.per-file-ignores] — the rest of the per-file ignores were eliminated in #8. Renaming them is the last step to drop the file-level ignore entirely.
Why this is deferred
The names are part of the documented public surface. They are:
- Re-exported from
src/picmaker/picmaker.py (BC import path) and pinned by tests/test_api_compat.py.
- Called from
src/picmaker/pil_utils.py:150,157 on the 16-bit TIFF write path.
- Used by
tests/fixture_recipes/small_tiff16.recipe.py and tests/test_tiff16_branches.py.
A rename is a behavioural change: any downstream caller using from picmaker.tiff16 import WriteTiff16 (or from picmaker.picmaker import WriteTiff16) breaks at import.
Suggested approach
- Add
write_tiff16 and read_tiff16 as the new canonical names in src/picmaker/tiff16.py.
- Keep
WriteTiff16 = write_tiff16 and ReadTiff16 = read_tiff16 as deprecated aliases that emit a DeprecationWarning on call. Add them to __all__ so the BC shim picks them up.
- Update internal callers (
pil_utils.py, the fixture recipe, the test file) to use the new names.
- Update
tests/test_api_compat.py to verify both the legacy and new names resolve to the same callable.
- Remove
"src/picmaker/tiff16.py" = ["N802"] from [tool.ruff.lint.per-file-ignores] in pyproject.toml — the whole table goes away.
- Document the deprecation in the next release notes; remove the aliases in a later release (e.g. 1.0 or 2.0).
Effort
Medium. ~5 files to edit, two tests to update, and a deprecation cycle to plan around the next release.
src/picmaker/tiff16.pyexposes two public functions whose PascalCase names violate the project'sN802ruff rule:WriteTiff16(filename, array, …)ReadTiff16(filename, …)These are the only entries in
[tool.ruff.lint.per-file-ignores]— the rest of the per-file ignores were eliminated in #8. Renaming them is the last step to drop the file-level ignore entirely.Why this is deferred
The names are part of the documented public surface. They are:
src/picmaker/picmaker.py(BC import path) and pinned bytests/test_api_compat.py.src/picmaker/pil_utils.py:150,157on the 16-bit TIFF write path.tests/fixture_recipes/small_tiff16.recipe.pyandtests/test_tiff16_branches.py.A rename is a behavioural change: any downstream caller using
from picmaker.tiff16 import WriteTiff16(orfrom picmaker.picmaker import WriteTiff16) breaks at import.Suggested approach
write_tiff16andread_tiff16as the new canonical names insrc/picmaker/tiff16.py.WriteTiff16 = write_tiff16andReadTiff16 = read_tiff16as deprecated aliases that emit aDeprecationWarningon call. Add them to__all__so the BC shim picks them up.pil_utils.py, the fixture recipe, the test file) to use the new names.tests/test_api_compat.pyto verify both the legacy and new names resolve to the same callable."src/picmaker/tiff16.py" = ["N802"]from[tool.ruff.lint.per-file-ignores]inpyproject.toml— the whole table goes away.Effort
Medium. ~5 files to edit, two tests to update, and a deprecation cycle to plan around the next release.