feat(cli): add fleet/__main__.py so python3 -m fleet works - #61
Merged
Conversation
- fleet/__main__.py (new): delegate to fleet.cli:main (same entry as the console script) - 'from fleet.cli import main' + 'if __name__ == "__main__": sys.exit(main())'. No argument parsing reimplemented. - tests/test_cli.py: test_python_m_fleet_help_exits_zero runs 'python3 -m fleet --help' as a subprocess from a neutral tmp_path with PYTHONPATH set to the repo root; asserts returncode==0 and that the help text mentions the status subcommand. - tests/test_cli.py: test_python_m_fleet_version_exits_zero_and_prints_version runs 'python3 -m fleet --version' the same way; asserts returncode==0 and that stdout is exactly 'fleet 0.1.0' (exercises the sys.exit(main()) path with argparse's action="version" SystemExit). - tickets: TICKET-052 (version subprocess test), TICKET-053 (README note, deferred - out of scope for this one-file + one-test cycle). Closes #59. Closes #60.
This was referenced Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The fleet package had no
__main__.py, sopython3 -m fleetfailed withNo module named fleet.__main__even though thefleetconsole script andfleet.cli:mainboth work. This adds the missing__main__module (delegation only) and pins it with two subprocess tests.Changes
fleet/__main__.py(new): delegates tofleet.cli:mainexactly —from fleet.cli import main+if __name__ == "__main__": sys.exit(main()). No argument parsing reimplemented;main()already owns the parser (including the top-level--versionflag from Cycle 12).tests/test_cli.py:test_python_m_fleet_help_exits_zero— runspython3 -m fleet --helpas a subprocess from a neutraltmp_pathwithPYTHONPATHset to the repo root; assertsreturncode == 0and the help text mentions thestatussubcommand.test_python_m_fleet_version_exits_zero_and_prints_version— runspython3 -m fleet --versionthe same way; assertsreturncode == 0and stdout is exactlyfleet 0.1.0(exercises thesys.exit(main())path with argparseaction="version"SystemExit).tickets/: TICKET-052 (version subprocess test), TICKET-053 (README note — deferred, out of scope for this one-file + one-test cycle).Gate
pytest tests/ -x -q: 110 passed (was 108)ruff check fleet/: cleanmypy fleet/ --ignore-missing-imports: clean (7 source files)Closes #59. Closes #60.