mirror of
https://github.com/kennethreitz/responder.git
synced 2026-06-05 23:00:17 +00:00
cb4bc295b8
- tutorial-auth: fix deprecated datetime.utcnow() → datetime.now(timezone.utc), add role-based access control section, add auth strategy comparison - tutorial-websockets: use WebSocketDisconnect instead of bare Exception, add connection lifecycle section, add rejected connection test example - tutorial-sqlalchemy: modernize to mapped_column() / Mapped[] (SQLAlchemy 2.0) - deployment: use uv in Docker example, fix stale uv.lock reference - quickstart: link to all tutorials in "next steps" - sandbox: rewrite with project layout, mypy, and pattern-matching test examples Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1.6 KiB
1.6 KiB
(sandbox)=
Development Sandbox
Setup
Clone the repo and install all dependencies:
git clone https://github.com/kennethreitz/responder.git
cd responder
uv venv && source .venv/bin/activate
uv pip install --upgrade --editable '.[develop,docs,release,test]'
Running Tests
pytest # full suite with coverage
pytest tests/test_responder.py -xvs # single file, stop on first failure
pytest -k "test_mount" # run tests matching a pattern
Code Formatting
ruff format . # auto-format
ruff check --fix . # lint and auto-fix
Type Checking
mypy
Documentation
Live-reloading doc server (opens in browser):
cd docs
sphinx-autobuild --open-browser --watch source source build
Or build once:
cd docs
make html
# open build/html/index.html
Project Layout
responder/
├── responder/ # main package
│ ├── api.py # API class — the entry point
│ ├── routes.py # Router, Route, WebSocketRoute
│ ├── models.py # Request and Response wrappers
│ ├── ext/ # extensions (CLI, GraphQL, OpenAPI, rate limiting)
│ ├── background.py # background task queue
│ └── formats.py # content negotiation (JSON, YAML, msgpack)
├── tests/ # pytest test suite
├── examples/ # runnable example apps
├── docs/source/ # Sphinx documentation
└── pyproject.toml # project metadata and tool config