cryptobot/contains the core package; async clients live beside_sync/wrappers, andmodels/defines request/response DTOs.cryptobot/webhook.pyexposes the FastAPI webhook entrypoint used by the sample service.- Tests reside under
tests/, notablytests/test_sync_client.py; add new regression coverage here. - Documentation sources live in
docs/; rebuild when API signatures or examples change. - Build artifacts (
dist/,htmlcov/) should remain untracked.
poetry installresolves runtime and dev dependencies pinned inpoetry.lock.poetry run python -m cryptobot.webhookstarts the demo webhook for local validation.make lintwrapspoetry run flake8to enforce style gates.make testruns pytest with coverage; usemake test-allfor the tox matrix when touching cross-version code paths.make docsregenerates the Sphinx site (docs/_build/html/index.html).
- Target Python 3.9+ with 4-space indentation and keep lines ≤127 characters.
- Prefer snake_case for modules, functions, and variables; classes (especially in
models/) use PascalCase matching CryptoBot entities. - Run
poetry run flake8 cryptobot testsbefore submitting to catch import or complexity issues.
- Tests use pytest; name files
tests/test_*.pyand functionstest_*. - Maintain coverage near the existing ~90% target by extending fixtures and using httpx
MockTransportfor network isolation. - Execute
make testbefore commits andmake test-allwhen modifying compatibility-sensitive code.
- Follow Conventional Commit prefixes used in history, e.g.,
feat(sync): add transfer helperorfix: handle webhook timeouts. - PRs should summarize changes, link issues, and note
make lint/make testresults; include screenshots for docs or webhook response updates.
- Store secrets in
.envand load them viapython-dotenv; never hard-code tokens. - After dependency bumps (FastAPI, Uvicorn, httpx), verify the webhook boots with
poetry run uvicorn cryptobot.webhook:app --reload.