Thank you for your interest in contributing to NATS.py!
This is a uv workspace containing multiple packages.
- Install uv
- Install nats-server and ensure it's in your PATH:
nats-server -v
# Clone the repository
git clone https://github.com/nats-io/nats.py
cd nats.py
# Install dependencies
uv sync# Run all tests
uv run pytest
# Run tests for specific package
uv run pytest nats/tests
uv run pytest nats-server/tests
# Run tests in parallel
uv run pytest -n auto
# Run with coverage
uv run pytest --covuv run mypy nats/src# Format code
uv run yapf -i -r nats/src nats-server/src
# Check formatting
uv run yapf -d -r nats/src nats-server/src# Run ruff
uv run ruff check nats/src nats-server/src
# Run flake8 (for nats-py)
uv run flake8 nats/src/nats/js/
# Run isort
uv run isort nats/src nats-server/srcTo update the docs, first checkout the docs branch under a local copy of the nats.py repo:
git clone https://github.com/nats-io/nats.py
cd nats.py
git clone https://github.com/nats-io/nats.py --branch docs --single-branch docs
cd docs
uv venv
source .venv/bin/activate # or `.venv\Scripts\activate` on Windows
uv pip install sphinx sphinx_autodoc_typehints myst_parser furo pygments
make html
# preview the changes:
make serveIf you are happy with the changes, make a PR on the docs branch:
make publish
git add docs
- Fork the repository and create your branch from
main - Make sure all tests pass
- Update documentation if needed
- Follow the existing code style
- Write clear commit messages
- Create a pull request with a clear description of the changes
By contributing to NATS.py, you agree that your contributions will be licensed under the Apache License 2.0.