Thank you for your interest in contributing to discopt. This document explains how to set up your development environment, run tests, and submit changes.
Prerequisites:
- Rust 1.84+
- Python 3.10+
- Ipopt (
brew install ipopton macOS)
# Clone the repo
git clone https://github.com/jkitchin/discopt.git
cd discopt
# Clone ripopt (Rust IPM dependency, path dependency at ../ripopt)
git clone <ripopt-repo-url> ../ripopt
# Create a Python virtual environment
python -m venv .venv && source .venv/bin/activate
# Install Python dependencies
pip install -e ".[dev,ipopt,highs]"
# Build Rust-Python bindings
cd crates/discopt-python && maturin develop && cd ../..# Rust tests
cargo test -p discopt-core
# Python tests (JAX requires these env vars on macOS)
JAX_PLATFORMS=cpu JAX_ENABLE_X64=1 pytest python/tests/ -v
# Quick smoke tests
pytest python/tests/ -m smoke
# Skip slow tests
pytest python/tests/ -m "not slow"
# With coverage (>=85% required)
pytest python/tests/ --cov=discopt- Python: ruff v0.14.6 (pinned), line-length 100, target Python 3.10+
- Rust: standard rustfmt
- Type checking: mypy
ruff check python/
ruff format --check python/
mypy python/discopt/
cargo fmt --checkPre-commit hooks are configured. Install with:
pip install pre-commit
pre-commit install- Create a feature branch from
main. - Write tests for new functionality.
- Ensure all tests pass and coverage stays >= 85%.
- Run
ruff checkandruff formatbefore committing. - Keep commits focused; use descriptive commit messages.
- Open a PR against
mainwith a clear description. - Add a one-line entry to the
## [Unreleased]section ofCHANGELOG.mdunder the appropriate group (Added / Changed / Fixed / etc.).
Releases are cut by following RELEASE.md, which is the
authoritative checklist for tests, documentation, manuscript, changelog,
version bump, tagging, and PyPI publication. Tagging vX.Y.Z triggers
.github/workflows/release.yml, which builds wheels and publishes to PyPI.
crates/discopt-core/-- Rust solver engine (expression IR, B&B tree, presolve)crates/discopt-python/-- PyO3 bindingspython/discopt/-- Python package (modeling API, JAX layer, solver orchestrator)python/tests/-- Python test suitedocs/-- Jupyter Book documentation (notebooks live indocs/notebooks/)
Use the GitHub issue tracker: https://github.com/jkitchin/discopt/issues