Skip to content

Development Guide

This guide covers common development tasks for the networkx-mermaid project.

Setup

Install the project with development dependencies:

uv pip install -e ".[dev,test,docs]"

Running Tests

Run tests using pytest:

pytest tests

Run tests with coverage:

pytest tests --cov=src --cov-branch --cov-report=html

Run tests in parallel:

pytest tests -n auto

Run tests including README examples:

pytest tests README.md

Linting

This project uses ruff for linting and code formatting.

Check for linting issues:

ruff check .

Fix auto-fixable linting issues:

ruff check --fix .

Format code:

ruff format .

Type Checking

This project uses mypy for static type checking.

Run type checking:

mypy src

Documentation

Documentation is built using zensical, an Open Source documentation system built by the creators of Material for MkDocs.

Serve documentation locally:

zensical serve

Build documentation:

zensical build

The documentation will be built to the site/ directory.

Configuration is managed in zensical.toml.

Development Workflow

  1. Create a new branch for your feature or bugfix
  2. Make your changes
  3. Run linting: ruff check . && ruff format .
  4. Run type checking: mypy src
  5. Run tests: pytest tests --cov=src
  6. Commit your changes
  7. Push and create a pull request

Project Structure

networkx-mermaid/
├── docs/                 # Documentation files
├── src/                  # Source code
├── tests/                # Test files
├── LICENSE               # License information
├── pyproject.toml        # Project configuration
├── README.md             # Project description
└── zensical.toml         # Zensical configuration