Background
src/picmaker/io.py shadows the stdlib io module name. The module's docstring acknowledges this and instructs all internal consumers to use absolute imports (from picmaker.io import …), and every consumer in the codebase complies. There is no functional bug today — but a future contributor (or an automated refactoring tool) writing import io inside the picmaker package would silently pick up picmaker.io instead of the stdlib, which is surprising.
See CODEBASE_CRITIQUE.md §1 (Structure and layout, "Finding (Low) — picmaker.io shadows the stdlib io module name").
Proposed approach
Rename src/picmaker/io.py to src/picmaker/readers.py (or picmaker/fileio.py — either works; readers is shorter and matches the leaf module's primary purpose, which is the reader-cascade plus the output-file helpers). This is a breaking change for downstream callers who write from picmaker.io import X, so it should ride the same major-version bump that prunes the picmaker.picmaker BC shim (#11).
For one release after the rename, keep a thin picmaker/io.py shim that re-exports the new module and emits DeprecationWarning at import time, so downstream callers have a migration window.
Acceptance criteria
Related
CODEBASE_CRITIQUE.md §1 — original finding.
- #11 — the BC-shim pruning is a natural companion; rename and prune should land in the same major version.
Background
src/picmaker/io.pyshadows the stdlibiomodule name. The module's docstring acknowledges this and instructs all internal consumers to use absolute imports (from picmaker.io import …), and every consumer in the codebase complies. There is no functional bug today — but a future contributor (or an automated refactoring tool) writingimport ioinside thepicmakerpackage would silently pick uppicmaker.ioinstead of the stdlib, which is surprising.See
CODEBASE_CRITIQUE.md§1 (Structure and layout, "Finding (Low) —picmaker.ioshadows the stdlibiomodule name").Proposed approach
Rename
src/picmaker/io.pytosrc/picmaker/readers.py(orpicmaker/fileio.py— either works;readersis shorter and matches the leaf module's primary purpose, which is the reader-cascade plus the output-file helpers). This is a breaking change for downstream callers who writefrom picmaker.io import X, so it should ride the same major-version bump that prunes thepicmaker.picmakerBC shim (#11).For one release after the rename, keep a thin
picmaker/io.pyshim that re-exports the new module and emitsDeprecationWarningat import time, so downstream callers have a migration window.Acceptance criteria
src/picmaker/io.pyrenamed tosrc/picmaker/readers.py(or chosen alternative).pipeline.py,cli.py,__init__.py,picmaker.py, tests).picmaker/io.pyshim that emitsDeprecationWarningand re-exports.docs/module.rstupdated.CHANGELOG/ RELEASING.md note added.Related
CODEBASE_CRITIQUE.md§1 — original finding.