Thanks for your interest in contributing! This guide will help you get started.
- Python 3.13+
- uv — fast Python package manager
- A NetBox instance with a read-only API token (for integration tests only)
# 1. Fork & clone the repo
git clone https://github.com/<your-username>/nbpull.git
cd nbpull
# 2. Install all dependencies (including dev)
make install
# 3. Copy the example env file
cp .env.example .env
# Fill in your NetBox URL and tokenmake all # format → lint → typecheck → test
make test # unit tests only (no network)
make lint # ruff linter
make format # auto-format with ruff
make typecheck # mypy strict mode- Create an issue describing the bug or feature
- Fork the repo and create a branch:
git checkout -b feat/my-featureorgit checkout -b fix/my-bug - Make your changes — keep commits focused and atomic
- Run
make allto ensure everything passes - Open a Pull Request against
main
| Prefix | Purpose |
|---|---|
feat/ |
New feature |
fix/ |
Bug fix |
docs/ |
Documentation only |
refactor/ |
Code refactoring |
test/ |
Adding/updating tests |
chore/ |
Maintenance / tooling |
- Unit tests (
make test) run without network access using mocked HTTP responses via respx. - Integration tests (
make test-integration) hit a real NetBox API and requireNETBOX_URL+NETBOX_TOKENin your environment. - Write tests for all new functionality. Aim for the same style as
existing tests in
tests/.
- Formatter / Linter: Ruff (line length 88)
- Type checking: mypy in strict mode
- Import order: isort via Ruff
- Strings: f-strings exclusively for interpolation
- Logging: use
loggingstdlib — noprint()statements - Async I/O:
async/awaitfor all HTTP operations - Models: Pydantic v2 for data validation
This tool is read-only. The NetBoxClient only exposes HTTP GET
methods. Never add POST/PUT/PATCH/DELETE capabilities. Every PR is
reviewed with this invariant in mind.
Use Conventional Commits:
feat: add --role filter to prefixes command
fix: handle empty pagination response from NetBox
docs: expand CLI examples in README
test: add VRF model edge cases
Open a Discussion or file an issue. We're happy to help!