Contributing
Development Setup
This project uses uv for dependency management.
# Install dependencies
uv sync
Code Generation
The SDK is auto-generated from Meraki's OpenAPI specification. To regenerate the client code:
make generate
This command:
- Downloads the OpenAPI spec for the specified version
- Generates the
meraki_clientpackage with sync and async clients - Generates Pydantic response schemas
- Generates integration tests in
tests/generated/ - Formats all generated code
See meraki/openapi releases for available API versions. Generated API version can be changed in .api-version file.
Project Structure
meraki_client/ # Generated client library
codegen/ # Code generation
tests/
├── test_*.py # Manual tests
└── generated/ # Auto-generated tests
Spec Overrides
Some endpoints have bugs in the OpenAPI spec. Workarounds are configured in codegen/spec_overrides.toml. The generator validates that overrides reference existing operations and logs warnings when the spec appears fixed.
Testing
Tests require a Meraki API key with access to an organization:
export MERAKI_DASHBOARD_API_KEY_TESTS=your_api_key
Optionally, specify test resources to avoid auto-discovery:
export ORGANIZATION_ID_TESTS=your_org_id
export NETWORK_ID_TESTS=your_network_id
export DEVICE_ID_TESTS=your_device_serial
Running Tests
# Run read-only tests (safe)
make test
# Run mutating tests (creates/updates/deletes resources)
make test-mutating
Writing Manual Tests
Manual tests for mutating operations should use the mutating marker:
import pytest
pytestmark = pytest.mark.mutating
def test_create_network() -> None:
# Test implementation
...
Linting
# Run all checks (format, lint, typecheck, docs)
make lint
To auto-fix formatting issues:
uv run ruff format meraki_client codegen tests
uv run ruff check --fix meraki_client codegen tests
Pull Requests
- Fork the repository
- Create a feature branch
- Make your changes
- Run
make lintandmake test(if possible) - Submit a pull request