Skip to content

refactor: extract _console.py from __init__.py (PR-1/8)#2474

Open
darion-yaphet wants to merge 1 commit intogithub:mainfrom
darion-yaphet:refactor/split-init-pr1
Open

refactor: extract _console.py from __init__.py (PR-1/8)#2474
darion-yaphet wants to merge 1 commit intogithub:mainfrom
darion-yaphet:refactor/split-init-pr1

Conversation

@darion-yaphet
Copy link
Copy Markdown

Summary

Part 1 of 8 in the __init__.py module split refactor (design spec).

Extracts all Rich UI primitives from the 5880-line __init__.py into a focused _console.py base-layer module.

Moved symbols:

  • BANNER, TAGLINE — ASCII art constants
  • StepTracker — live progress tree renderer
  • get_key, select_with_arrows — interactive keyboard input
  • BannerGroup, show_banner — Typer banner integration
  • console — Rich Console singleton

Backward compatibility: All symbols remain importable from specify_cli via re-exports in __init__.py.

Dependency rule: _console.py has zero internal imports (base layer).

Test plan

  • New regression test tests/test_console_imports.py guards all 8 re-exported symbols
  • Full suite: 2788 passed, 34 skipped (baseline was 2786)
  • from specify_cli import console, StepTracker, ... works
  • specify --help renders banner correctly

@darion-yaphet darion-yaphet requested a review from mnriem as a code owner May 7, 2026 05:10
Move Rich UI primitives (BANNER, TAGLINE, StepTracker, get_key,
select_with_arrows, console, BannerGroup, show_banner) into a new
src/specify_cli/_console.py module. Re-export all symbols from
__init__.py to preserve the public API. Add regression guard tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant