Development¶
This page covers how to set up a development environment for contributing to OptiMHC.
Clone the Repository¶
Install Dependencies¶
OptiMHC uses uv for dependency management (recommended):
Alternatively, using pip:
Running Tests¶
uv run pytest # All tests
uv run pytest tests/test_psm_container.py # Single file
uv run pytest tests/ -k "test_config" # Filter by name
Linting and Formatting¶
OptiMHC uses Ruff for linting and formatting:
uv run ruff check . # Lint
uv run ruff format . # Format
uv run ruff format --check . # Check without modifying
Configuration: line-length = 99, rules ["E", "F", "I"] (pycodestyle errors, pyflakes, isort). E501 (line too long) is ignored. Ruff excludes docs/ and examples/.
Pre-commit Hooks¶
uv run pre-commit install # Install hooks
uv run pre-commit run --all-files # Run all hooks manually