Split __init__.py into focused modules #29
Labels
No labels
bug
contribution welcome
duplicate
enhancement
good first issue
help wanted
invalid
question
upstream
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
marvin8/zaojun#29
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
src/zaojun/init.py has grown to ~1320 lines as features (aged-version fallback, vulnerability scanning, license checking, library-mode) accumulated. The file now contains at least seven distinct concerns mixed together, making it hard to navigate and hard to place new logic when adding features.
This issue tracks splitting it into focused single-responsibility modules with no behaviour changes.
Findings
Seven distinct concerns currently live in
__init__.py:VulnAdvisory,PyPIPackageData,DependencyResult)The existing split-out files (
cache.py,config.py,licenses.py) are already well-scoped and won't change.Plan of attack
Create six new modules with a clean layered dependency graph (no cycles):
models.pypypi.pyversion.pyvulns.py_norm_pkglives here too)render.pychecker.py__init__.pyDependency graph:
models ← pypi, version, vulns, render; all ← checker; checker ← __init__Migration is a pure mechanical move — one module at a time, full quality suite after each step. No logic changes.
Design spec:
docs/superpowers/specs/2026-06-24-refactor-init-design.md