Skip to content

Commit 11cb073

Browse files
authored
Merge pull request #8 from decibeltrade/make-python-spec
Add API specification and behavioral test suite
2 parents 9c016e8 + 1163cf5 commit 11cb073

20 files changed

Lines changed: 6377 additions & 17 deletions

CLAUDE.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Decibel Python SDK — Claude Code Instructions
2+
3+
## Pre-commit Checklist
4+
5+
Before EVERY commit, run the full CI pipeline and verify all steps pass:
6+
7+
```bash
8+
uv run ruff check .
9+
uv run ruff format --check .
10+
uv run pyright
11+
uv run pytest -k "not testnet"
12+
```
13+
14+
Or equivalently: `make all`
15+
16+
If `ruff format --check` fails, run `uv run ruff format src tests` to fix.
17+
18+
Do NOT commit if any of these fail.
19+
20+
## Project Structure
21+
22+
- `src/decibel/` — SDK source code
23+
- `src/decibel/read/` — Read-only API readers (REST + WebSocket subscriptions)
24+
- `src/decibel/write/` — On-chain transaction writers (async + sync)
25+
- `tests/api_resources/` — Spec compliance and integration tests
26+
- `docs/SPEC*.md` — API specification documents
27+
28+
## Testing
29+
30+
- Unit/spec tests (no network): `uv run pytest -k "not testnet"`
31+
- Integration tests (needs API key): `DECIBEL_API_KEY=<key> uv run pytest tests/api_resources/test_testnet_integration.py -v`
32+
- Integration tests auto-skip without `DECIBEL_API_KEY`
33+
34+
## Code Style
35+
36+
- Line length: 100 (enforced by ruff)
37+
- Format: `uv run ruff format src tests`
38+
- Lint: `uv run ruff check src tests` (auto-fix with `--fix`)
39+
- Type checking: `uv run pyright` (strict mode on `src/`)
40+
- Python 3.11+, async-first with sync wrappers
41+
- Pydantic v2 for all data models

0 commit comments

Comments
 (0)