Skip to content

feat(cli): add CLI entry point and remove legacy scripts - #13

Merged
ldastey-dev merged 1 commit into
masterfrom
action/11-cli
Feb 22, 2026
Merged

feat(cli): add CLI entry point and remove legacy scripts#13
ldastey-dev merged 1 commit into
masterfrom
action/11-cli

Conversation

@ldastey-dev

Copy link
Copy Markdown
Owner

Action 11 — CLI entry point + legacy removal

What changed

Area Change
src/chesscom/cli.py New — build_parser() (argparse, 4 sub-commands) + main()
src/chesscom/__main__.py New — enables python -m chesscom
tests/unit/test_cli.py New — 22 tests (parser, routing, env, --match-id, errors, output)
pyproject.toml Added [project.scripts]; removed xlsxwriter dep
.github/workflows/ci.yml Removed obsolete exit-code-5 workaround
Legacy scripts + src/utils/ Deleted (superseded by the chesscom package)
tests/integration/test_api_calls.py Deleted (superseded by test_client.py + test_reports.py)
tests/unit/test_calculations.py Redirected to chesscom.domain.services; dropped TestGetUniqueFilename + TestRequestHandler

CLI sub-commands

python -m chesscom member-summary
python -m chesscom prospects
python -m chesscom match-eligibility [--match-id ID]
python -m chesscom match-participation

Test count

240 passing (255 master − 37 deleted legacy tests + 22 new CLI tests)

Verification

ruff check .   # All checks passed
pytest -q      # 240 passed in 8.09s

- 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.
@ldastey-dev
ldastey-dev merged commit 40f6181 into master Feb 22, 2026
2 checks passed
@ldastey-dev
ldastey-dev deleted the action/11-cli branch February 22, 2026 20:23
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