Contributing¶
We welcome contributions to the NetBird Python client!
Getting Started¶
Development Setup¶
Fork the repository on GitHub
Clone your fork:
git clone https://github.com/YOUR-USERNAME/netbird-python-client.git cd netbird-python-client
Install development dependencies:
pip install -e ".[dev,docs]"
Install pre-commit hooks:
pre-commit install
Code Quality¶
We enforce code quality with automated tools:
Black - Code formatting (line length: 88)
isort - Import sorting
flake8 - Linting
mypy - Strict type checking
Run all checks:
black src/ tests/
isort src/ tests/
flake8 src/ tests/
mypy src/
Testing¶
We maintain 88% test coverage with 364+ unit tests.
# Run all tests
pytest
# Run with coverage
pytest --cov=src/netbird --cov-report=html
# Run specific categories
pytest tests/unit/ # Core resource tests
pytest tests/unit/cloud/ # Cloud resource tests
All new code should include tests. Use pytest.mark.unit for unit tests.
API Design Principles¶
Input validation: Use Pydantic models (
ResourceCreate,ResourceUpdate)Response format: Return standard Python dictionaries
Error handling: Raise specific exception types from
netbird.exceptionsForward compatibility: Use
extra="allow"on all models
Documentation¶
Documentation is built with Sphinx and the Furo theme:
cd docs
make html # Build HTML docs
make livehtml # Live reload during development
make linkcheck # Check for broken links
Pull Requests¶
Create a feature branch from
mainMake changes with tests
Run the full test suite
Update documentation if needed
Submit a Pull Request
Commit messages should use imperative mood (“Add feature”, not “Added feature”).
Release Process¶
Releases follow semantic versioning:
Version bump in
src/netbird/__init__.pyUpdate
CHANGELOG.mdCreate GitHub release with notes
PyPI package is published automatically
Getting Help¶
Check existing issues
Open a new issue with your question
See the full documentation