Skip to content

Makefile

Available commands

You can always run make help to see the latest list.

Notes

  • These are the explicit CLI commands that each make target runs.
  • make all, make release, make build, make check, make docs are composites (they run multiple steps).
Target Description
make help Print available targets
make all Clean, setup, check, test
make release Clean, setup, check, test, i-test
make build Clean and setup
make setup Install dependencies (via uv) and install HyperTorch in editable mode
make setup-tensorboard Install optional TensorBoard extra
make check Run lint + format + typecheck
make lint Run the linter (ruff check)
make lint-fix Run the linter with auto-fix (ruff check --fix)
make lint-rule R=<RULE> Lint a single Ruff rule (ruff check --select <RULE>)
make lint-rule-fix R=<RULE> Lint a single Ruff rule with auto-fix
make format Run the formatter (ruff format)
make typecheck Run the type checker (ty check)
make docstring-check Check docstring formatting
make test Run all tests (with coverage)
make stest T=<test_path> Run a single test file/folder under hypertorch/tests/
make i-test Run all integration tests
make si-test T=<test_path> Run a single integration test file/folder under hypertorch/integration_tests/
make run <file.py> Run a single Python file (for example: make run examples/gcn.py)
make docs Build and serve documentation
make docs-build Build documentation without serving
make docs-serve Serve built documentation locally (default: http://127.0.0.1:8000)
make loc Count lines of Python code
make clean Remove build/test artifacts
make destroy Destroy the environment (removes .venv, lockfile, logs)

Setup

  • make setup: Install dependencies (via uv) and install HyperTorch in editable mode

    CLI:

    uv sync
    uv pip install -e .
    
  • make setup-tensorboard: Install optional TensorBoard extra

    CLI:

    uv pip install -e ".[tensorboard]"
    

Lint / format / typecheck

  • make lint: Run the linter (ruff check)

    CLI:

    uv run ruff check
    
  • make lint-fix: Run the linter with auto-fix

    CLI:

    uv run ruff check --fix
    
  • make lint-rule R=<RULE>: Lint a single Ruff rule

    CLI:

    uv run ruff check --select <RULE>
    
  • make lint-rule-fix R=<RULE>: Lint a single Ruff rule with auto-fix

    CLI:

    uv run ruff check --select <RULE> --fix
    
  • make format: Run the formatter (ruff format)

    CLI:

    uv run ruff format
    
  • make typecheck: Run the type checker (ty check)

    CLI:

    uv run ty check
    
  • make docstring-check: Check docstring formatting

    CLI:

    uv run ./scripts/validate_docstrings.py
    

Tests

  • make test: Run all tests (with coverage)

    CLI:

    uv run pytest -n auto --cov=hypertorch --cov-report=term-missing -m "not integration"
    
  • make stest T=<test_name>: Run a single test file or folder under hypertorch/tests/

    CLI:

    uv run pytest -s hypertorch/tests/<test_name>
    
  • make i-test: Run all integration tests

    CLI:

    uv run pytest -n auto -m "integration"
    

    Integration tests may perform live dataset downloads. The supported-dataset fallback tests use GitHub raw URLs first and Hugging Face Hub as the fallback source; set HF_DOWNLOAD_TOKEN when running in environments that need authenticated or higher-quota Hugging Face downloads.

  • make si-test T=<test_name>: Run a single integration test file or folder under hypertorch/integration_tests/

    CLI:

    uv run pytest -n auto -s hypertorch/integration_tests/<test_name> -m "integration"
    

Run scripts

  • make run <file.py>: Run a single Python file

    CLI:

    uv run python3 <file.py>
    

Documentation

  • make docs-build: Build documentation without serving

    CLI:

    uv run zensical build --clean -f zensical.toml
    
  • make docs-serve: Serve built documentation locally (default: http://127.0.0.1:8000)

    CLI:

    uv run zensical serve -f zensical.toml -a 127.0.0.1:8000
    

Maintenance

  • make loc: Count lines of Python code

    CLI:

    find . -type f -name "*.py" -not -path "*/.venv/*" | xargs wc -l
    
  • make clean: Remove build/test artifacts

    CLI:

    find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
    find . -type f -name "*.pyc" -delete 2>/dev/null || true
    rm -rf hypertorch.egg-info .pytest_cache .coverage .ruff_cache site docs/site
    
  • make destroy: Destroy the environment (removes .venv, lockfile, logs)

    CLI:

    # clean
    find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
    find . -type f -name "*.pyc" -delete 2>/dev/null || true
    rm -rf hypertorch.egg-info .pytest_cache .coverage .ruff_cache site docs/site
    
    # destroy
    rm -rf .venv uv.lock hypertorch_logs
    

Composite targets

Utility targets that run multiple steps in sequence.

  • make all: Clean, setup, check, test
  • make release: Clean, setup, check, test, i-test
  • make build: Clean and setup
  • make check: Run lint + format + typecheck
  • make docs: Build and serve documentation