Development Guide
Environment Setup
Prerequisites
- Python 3.12+
- Conda
Initial Setup
# Clone the repository
git clone https://github.com/DanaResearchGroup/Carmel.git
cd Carmel
# Create conda environment
conda env create -f environment.yml
conda activate crml_env
# Install in editable mode with dev dependencies
make install
Testing
Carmel follows test-driven development. Write tests before or alongside implementation.
make test # Run all tests with coverage
# Or target specific tests directly:
pytest tests/test_config.py
pytest tests/test_config.py::TestCarmelConfig
pytest tests/test_config.py::TestCarmelConfig::test_minimal_config
Test Expectations
Every public function must have tests covering:
- Trivial / empty input
- Standard / normal case
- Realistic / complex case
- Edge cases
- Invalid input / failure paths
CLI commands must test exit codes, stdout, and stderr.
Coverage target: 90%+
Linting
Type Checking
Carmel uses mypy in strict mode. All functions require complete type annotations.
Full Verification
Run all checks before committing:
CI
GitHub Actions runs on every push to main and on pull requests:
- Lint (
ruff check) - Format check (
ruff format --check) - Type check (
mypy carmel) - Tests with coverage (
pytest --cov --cov-report=term-missing)
All checks must pass before merging.
Adding New Functionality
- Write tests first
- Implement the feature
- Add type hints and Google-style docstrings
- Run
make check - Update documentation if the feature is user-facing