Development Setup
This guide covers everything you need to set up your development environment and submit contributions to NeMo Gym.
Quick Start
Development Commands
Run NeMo Gym Tests:
View Test Coverage:
Configuration Debugging:
CI/CD Requirements
All contributions must pass these automated checks:
Required Checks:
- Unit Tests: All existing tests must pass
- Build Docs: Documentation must build without errors
- Copyright Check: All files must have proper copyright headers
- DCO Signing: All commits must be signed off
- Pre-commit Hooks: Code formatting and linting
Test Requirements:
- At least one test per server you contribute
- Tests must run using
ng_test +entrypoint=your_server_path - Use pytest for async testing patterns
Build Docs CI Failures
If the build-docs check fails:
-
Test documentation locally: Preview the Fern docs by running
fern docs devfrom the repository root. -
Common issues:
- Missing docstrings in public functions
- Broken markdown links in README or tutorials
- Invalid MDX syntax
Copyright Header Errors
Error: “Found files with missing copyright”
Solution: Add this header to all new Python files:
DCO and Commit Signing
All NeMo Gym contributions require commit signing and DCO sign-off.
Quick Setup
1. Configure Git Signing (Required)
2. Add Signing Key to GitHub
- Go to GitHub Settings → SSH and GPG keys
- Under “SSH keys” section, find “Signing keys” subsection
- Click “New SSH key” → Set type to “Signing Key”
- Copy your public key:
cat ~/.ssh/id_ed25519.pub - Paste the entire output (including
ssh-ed25519prefix)
3. Test Your Setup
IDE Integration
VSCode Setup
Create/update .vscode/settings.json in your project:
Other IDEs: Enable “Git commit signing” and “Always sign-off” in your Git settings.
Making Signed Commits
Every commit must be signed off using the -s flag:
Troubleshooting
Problem: error: gpg failed to sign the data
Problem: “Signing key not found on GitHub”
- Ensure you copied the complete public key including the
ssh-ed25519prefix - Add the key as a Signing Key (not Authentication Key) on GitHub
- Wait a few minutes for GitHub to process the new key
Problem: IDE not signing commits
- Restart your IDE after configuring Git
- Check IDE Git settings match the command line configuration
- Try committing through the command line first to verify setup
Problem: “DCO sign-off missing”
Alternative: GPG Signing
If you prefer GPG over SSH signing:
Common Issues
Testing Issues
Problem: Tests fail locally but not in CI
- Check Python version (3.12+ required)
- Ensure all dependencies installed:
uv sync --extra dev - Run in clean environment
Problem: Async test failures
- Use
pytest-asynciofor async tests - Mark async tests with
@pytest.mark.asyncio - Ensure proper fixture cleanup
Pre-commit Hook Failures
Problem: Pre-commit hooks fail
Common fixes:
ruff check --fix .for lintingruff format .for formatting- Add copyright headers to new files
Development Workflow
- Create feature branch:
git checkout -b feature/your-feature - Make changes with tests
- Run local checks:
ng_dev_test && pre-commit run --all-files - Commit with signoff:
git commit -s -S -m "Your message" - Push and create PR: Ensure all CI checks pass
- Address review feedback and iterate
Questions? Check existing issues or create a new one for guidance.