Thank you for your interest in contributing to Antares Web! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Testing
- Submitting Changes
- Reporting Issues
Before contributing, make sure you have the following installed:
- Python 3.11.x
- Node.js 22.13.0
- Git
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/AntaREST.git cd AntaREST -
Add the upstream repository:
git remote add upstream https://github.com/AntaresSimulatorTeam/AntaREST.git
-
Install dependencies:
uv sync # Install all dependencies including dev -
Install frontend dependencies:
cd webapp npm install cd ..
This project follows the git-flow branching model:
dev: Main development branch (default branch)master: Stable release branch- Feature branches:
feat/your-feature-name - Bug fixes:
fix/bug-description - Documentation:
docs/what-you-document
# Make sure you're on dev and up to date
git checkout dev
git pull upstream dev
# Create your feature branch
git checkout -b feat/your-feature-name- Make your changes in your feature branch
- Write or update tests as needed
- Ensure all tests pass
- Ensure code quality checks pass
We use Ruff for linting and formatting Python code:
# Check for style issues and auto-fix them
ruff check antarest/ tests/ --fix
# Format code
ruff format antarest/ tests/We use mypy for static type checking:
mypyAll Python code should include type hints. Configuration is in pyproject.toml.
- Write clear, self-documenting code: Use descriptive variable and function names
- Keep functions focused: Each function should do one thing well
- Add docstrings: Document all public modules, functions, classes, and methods
- Handle errors gracefully: Use appropriate exception handling
- Avoid code duplication: Extract common logic into reusable functions
We follow the Conventional Commits specification:
<type>(<scope>): <subject>
<body>
<footer>
For breaking changes, add ! after the type/scope:
<type>(<scope>)!: <subject>
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
Examples:
feat(api): add endpoint for study export
Implements a new REST endpoint that allows users to export
studies in various formats.
Closes #123
fix(ui): correct table pagination behavior
The pagination was not resetting when filters were applied.
This commit ensures the page resets to 1 when filters change.
feat(study)!: breaking change
BREAKING CHANGE: something breaks
# Run all tests in parallel
pytest -n auto- Write unit tests for all new functionality
- Ensure integration tests cover end-to-end workflows
- Aim for high code coverage (target: 80%+)
- Use descriptive test names that explain what is being tested
- Follow the Arrange-Act-Assert pattern
Test file structure:
def test_function_name_should_do_something():
# Arrange: Set up test data and dependencies
study = create_test_study()
# Act: Execute the function being tested
result = process_study(study)
# Assert: Verify the expected outcome
assert result.status == "success"
assert len(result.warnings) == 0Ensure your changes meet all requirements:
- All tests pass
- Code is properly formatted (ruff)
- Type checking passes (mypy)
- Commit messages follow conventional commits
- Branch is rebased on latest upstream/dev
-
Push your branch to your fork:
git push origin feat/your-feature-name
-
Create a Pull Request on GitHub from your fork to the upstream
devbranch -
Fill in the PR template with:
- Clear description of changes
- Related issue numbers (e.g., "Closes #123")
- Screenshots (if UI changes)
- Testing steps
-
Wait for review - maintainers will review your PR and may request changes
- At least one maintainer approval is required
- All CI checks must pass
- Address any review comments
- Keep the PR focused - avoid mixing unrelated changes
- Search existing issues to avoid duplicates
- Check if the issue is already fixed in the latest version
- Gather relevant information (OS, Python version, etc.)
Include:
- Clear title describing the issue
- Environment details:
- OS and version
- Python version
- AntaREST version
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Error messages or logs
- Screenshots (if applicable)
bug: Something isn't workingenhancement: New feature or requestdocumentation: Documentation improvementsgood first issue: Good for newcomershelp wanted: Extra attention is needed
If you need help with contributing:
- Check the documentation
- Ask in GitHub Discussions
- Open an issue with the
questionlabel - Contact the maintainers: andrea.sgattoni@rte-france.com
Questions? Feel free to reach out to the maintainers or open a discussion on GitHub.