Skip to content

Move the terminal helpers to a leaf module and guard the package layering - #100

Merged
bencehezso merged 3 commits into
release/2.0from
task/cli2_terminal_module
Oct 24, 2026
Merged

bencehezso merged 3 commits into
release/2.0from
task/cli2_terminal_module

Conversation

@bencehezso

Copy link
Copy Markdown
Contributor

Summary

Providers no longer import from the command line. The console, print_step and ask move to cloudexit/terminal.py, a module that imports nothing from the project except the exit codes, and a new test keeps the layering from drifting.

Changes

Moved (code unchanged)

  • console, NO_TERMINAL_MESSAGE, ask and print_step from cloudexit/cli/prompts.py to cloudexit/terminal.py. The prompts, banner and help text stay in cli/prompts.py.
  • The Azure collectors and the CLI import them from the new module; the lazy cloudexit.cli import that worked around the resulting cycle is removed.

Tests

  • tests/test_layering.py lists which area may import which (only cli imports cli, the leaves import only the exit codes, platform and providers are independent, ...); a new cross-area import fails the test.
  • The patch targets for getpass and the console in the prompt tests follow the move.

Compatibility

Behaviour, the command line, exit codes, log names, report output and the API v2 copy are unchanged; the console is the same single instance as before. The Python import paths cloudexit.cli.prompts.ask, print_step, console and NO_TERMINAL_MESSAGE no longer exist.

@bencehezso bencehezso self-assigned this Oct 24, 2026
@bencehezso bencehezso added the enhancement New feature or request label Oct 24, 2026
@bencehezso
bencehezso merged commit d41dc62 into release/2.0 Oct 24, 2026
11 checks passed
@bencehezso
bencehezso deleted the task/cli2_terminal_module branch October 24, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant