This project uses uv for various project
management tasks. This can be installed globally with brew install uv on mac.
uv will manage its own venv.
Sync the project requirements, with all dev dependencies:
uv sync
Run pre-commit install to enable the pre-commit configuration:
pre-commit install
The pre-commit hooks will be run against all files during a git commit, or
you can run it explicitly with:
pre-commit run --all-files
If for some reason, you wish to commit code that does not pass the pre-commit checks, this can be done with:
git commit --no-verify
Tests are run using pytest. Put pytest python modules and other resource in
the tests/ directory.
Run the tests:
pytest
With uv, adding dependencies is as simple as running uv add. Dev
dependencies can be added by specifying the extra flag --dev. Upgrade
dependencies by running uv sync --upgrade and optionally passing a package
name to upgrade. By default that command will upgrade all dependencies.
Run the HTTP server directly with uvicorn:
uvicorn chapi.main:app --reload
With the uvicorn defaults, the app should be accessible at
http://localhost:8000.