Testing and Packaging
Testing strategy
Section titled “Testing strategy”tests/test_client.py: sync client behaviortests/test_async_client.py: async client behaviortests/test_models.py: Pydantic model validationtests/conftest.py: fixtures and shared test setup
Tooling:
pytestpytest-asynciopytest-httpxpytest-covruffmypy
pytest options include strict markers/config and coverage reports.
Extending the SDK safely
Section titled “Extending the SDK safely”- Add/update Pydantic models in
models.py. - Implement new methods in both sync and async clients.
- Route HTTP through
_request_jsonfor consistent retry/error behavior. - Add tests for sync, async, and models.
- Keep README and docs synchronized with behavior.
- Preserve backward compatibility where possible.
Packaging and distribution
Section titled “Packaging and distribution”- Build backend:
setuptools.build_meta - Build artifacts:
python -m build-> wheel + sdist indist/ - Dev install:
pip install -e .[dev] py.typedincluded for PEP 561 typing support