Development & Contributing¶
This guide explains how to set up the development environment, execute tests, build documentation, and package folioman-client for distribution.
Prerequisites¶
- Python 3.11+
uv(recommended) or standardpip/venv
Repository Setup¶
-
Clone the repository:
-
Install dependencies with
This creates an isolated virtual environment inuv:.venv/and installs runtime, testing, and documentation packages.
Running the Test Suite¶
The test suite uses pytest, pytest-asyncio, and respx for mock HTTP responses.
To run with verbose output or targeted files:
All 17 tests verify:
- Proactive and reactive JWT token handling
- Concurrency locks
- Resource method parsing and status code mapping
- Serialization and model validation
Building the Package¶
We use hatchling as the build backend. Build both a binary wheel and source distribution (sdist):
Artifacts are placed into the dist/ directory:
dist/folioman_client-<version>-py3-none-any.whldist/folioman_client-<version>.tar.gz
Documentation Workflow¶
Documentation is built with MkDocs Material and mkdocstrings.
Previewing Documentation Locally¶
Start a live reload server:
Open http://127.0.0.1:8000/ in your browser. Changes saved in docs/ or Python docstrings will automatically refresh in your browser.
Building Documentation with Strict Validation¶
To verify all links, navigation entries, and Python docstrings resolve without warnings:
Code Quality & Docstring Conventions¶
When contributing new features or modifying existing public APIs:
- Strict Typing: All function signatures and model attributes must include complete type annotations.
- Google-Style Docstrings: Public classes, methods, models, and exceptions must feature Google-style docstrings (
Args,Returns,Raises). - No Credential Leaks: Never hardcode credentials, real JWTs, or production endpoints in tests, comments, or examples.
CI/CD and Release Workflow¶
- CI Documentation Deployment (
docs.yml): Pushes tomainautomatically runmkdocs gh-deployto publish documentation to GitHub Pages athttps://sid-146.github.io/folioman-client/. - PyPI Release (
publish.yml): Publishing a GitHub Release triggers PyPI Trusted Publishing (OIDC) to build distributions and upload to PyPI automatically.