Skip to main content

Air-Gap Development Setup

Purpose: For contributors, shows how to set up the Air-Gap development environment.

What you'll have at the end

A working Python development environment where you can run the AirGap build tool, execute tests (including property-based tests with Hypothesis), and validate changes with the full linting suite.

Prerequisites

  • Python 3.12+
  • pip and venv (included with Python)
  • Git
  • Mise (optional, manages Python version)

Step 1: Clone and create a virtual environment

cd openCenter-AirGap
python3 -m venv .venv
source .venv/bin/activate

Step 2: Install the package in editable mode with dev dependencies

pip install -e ".[dev]"

This installs the opencenter-airgap CLI command and all development tools (pytest, hypothesis, black, mypy, pylint, pre-commit).

Step 3: Verify the installation

opencenter-airgap --help

You should see the Typer-generated help output listing available commands.

Step 4: Run the test suite

# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

# Run only property-based tests
pytest tests/property/

# Run unit tests only
pytest tests/unit/

# Run integration tests
pytest tests/integration/

The project uses strict pytest configuration (see pyproject.toml). Tests timeout after 300 seconds. Coverage must stay above 80% (fail_under = 80.0).

Step 5: Run code quality checks

# Format code (100 char line length)
black src/ tests/

# Type checking (strict mode)
mypy src/

# Linting
pylint src/opencenter_build/

mypy runs in strict mode with disallow_untyped_defs = true. All new code must have type annotations. Black uses 100 character line length.

Step 6: Set up pre-commit hooks

pre-commit install

This runs black, mypy, pylint, and detect-secrets automatically before each commit.

Code Style

  • Python: PEP 8, Google Python Style Guide
  • Formatting: black (100 char line length)
  • Type hints: Required on all functions (mypy --strict)
  • Docstrings: Google-style
  • Bash scripts: Google Shell Style Guide, set -euo pipefail, shellcheck

Branch Naming

  • feature/ — New features
  • fix/ — Bug fixes
  • docs/ — Documentation only
  • refactor/ — Code restructuring
  • test/ — Test additions

Check your work

After completing setup, all of these should pass:

opencenter-airgap --help # CLI loads
pytest # Tests pass
black --check src/ tests/ # Formatting clean
mypy src/ # No type errors
pylint src/opencenter_build/ # No lint errors

Next steps