Skip to content

Reorganize into vendors/<name>/ layout (v0.3.0, on-demand) #5

Description

@bryanwintermute

Summary

All NV-config CLIs in the repo today live at the top level with no vendor namespace: nv_config.py, ethernet_config.py, papersave_config.py, blackmark_config.py, other1_config.py, and the rongta_config.py dispatcher. That's fine for one vendor. The moment a second-vendor PR lands, names collide.

Proposal

Schedule for v0.3.0 (breaking-ish). Move Rongta-specific modules under a vendor namespace:

unspooled/
├── receipt_print.py              # brand-agnostic, stays at top level
├── rongta_config.py              # backwards-compat shim: imports from vendors.rongta
└── vendors/
    ├── __init__.py               # discovery hook
    └── rongta/
        ├── __init__.py
        ├── base.py               # was nv_config.py
        ├── ethernet.py           # was ethernet_config.py
        ├── papersave.py          # was papersave_config.py
        ├── blackmark.py          # was blackmark_config.py
        ├── other1.py             # was other1_config.py
        └── cli.py                # was rongta_config.py (dispatcher)

Plus a unspooled vendors list discovery command that enumerates vendors/*/ and shows what each provides.

Backwards compatibility

  • Top-level rongta_config.py becomes a 5-line shim: from vendors.rongta.cli import main; main(). Anyone scripting against python3 rongta_config.py ethernet dhcp on keeps working.
  • Old per-module names (nv_config.py etc.) are harder to preserve. Two options:
    • Hard break: delete them; document the move in CHANGELOG; bump major.
    • Shim each one with a deprecation warning. More work, gentler migration.
  • README CLI examples already mostly use the dispatcher form (rongta_config.py base --cutter on), so the public-API surface shrinks naturally.

Gating: do this only on real demand

The cost of moving files now is real (every import in every test, every docs link, every CHANGELOG mention). The benefit only materializes when there's actually a second-vendor PR to land. Hold this until either:

  1. A real PR shows up adding vendors/<other>/, OR
  2. We accumulate enough vendor-specific code of our own (Bluetooth tab, WiFi tab, UDP discovery) that the top-level is starting to look cluttered.

Until then, the "Adding a new vendor" guide (#N, vendor-extension-guide) is the higher-leverage thing to ship — it documents the seams without locking us into a layout.

Acceptance (when we do it)

  • All existing tests pass against the new layout.
  • The dry-run byte-equality fixtures in tests/test_dry_run_bytes.py are sha256-identical to v0.2.x output. This is the locked contract.
  • rongta_config.py <subcommand> (top-level) still works end-to-end.
  • CHANGELOG documents the move.
  • v0.3.0 release notes call it out as a soft-deprecation.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions