feat(cli): add CLI entry point and remove legacy scripts - #13
Merged
Conversation
- Add src/chesscom/cli.py with build_parser() and main() using argparse (4 sub-commands: member-summary, prospects, match-eligibility, match-participation; --match-id flag for match-eligibility) - Add src/chesscom/__main__.py so `python -m chesscom` works - Add tests/unit/test_cli.py (22 tests covering parser, routing, env loading, --match-id override, error handling, and output) - Delete legacy top-level scripts (club_contribution_report.py, generate_club_member_report.py, generate_prospect_data.py, match_strengthening_extract.py) and src/utils/ - Delete tests/integration/test_api_calls.py (superseded by test_client.py and test_reports.py) - Rewrite tests/unit/test_calculations.py to import from chesscom.domain.services; remove TestGetUniqueFilename and TestRequestHandler (covered by test_excel.py and test_client.py) - Remove xlsxwriter from project dependencies (openpyxl is the writer used by ExcelReportWriter) - Add [project.scripts] entry: chesscom = chesscom.cli:main - Simplify CI pytest step (remove obsolete exit-code-5 workaround) 240 tests, all passing.
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.
Action 11 — CLI entry point + legacy removal
What changed
src/chesscom/cli.pybuild_parser()(argparse, 4 sub-commands) +main()src/chesscom/__main__.pypython -m chesscomtests/unit/test_cli.pypyproject.toml[project.scripts]; removedxlsxwriterdep.github/workflows/ci.ymlsrc/utils/chesscompackage)tests/integration/test_api_calls.pytest_client.py+test_reports.py)tests/unit/test_calculations.pychesscom.domain.services; droppedTestGetUniqueFilename+TestRequestHandlerCLI sub-commands
Test count
240 passing (255 master − 37 deleted legacy tests + 22 new CLI tests)
Verification