We welcome contributions of all sizes, from typo fixes to major features. This document explains how to get started, what we expect from contributors, and how we review and release changes.
- Report bugs or request features by opening GitHub issues with clear context and reproduction steps.
- Improve documentation, tutorials, and examples.
- Fix defects, refactor internals, or add new functionality.
- Help other community members by reviewing pull requests or answering questions.
- Fork and clone the repository. Configure the upstream remote so you can pull future updates.
- Create a feature branch:
git switch -c feature/my-improvement. - Install dependencies using an isolated environment:
python -m venv .venv source .venv/bin/activate # Windows: .venv\Scripts\activate python -m pip install --upgrade pip pip install -e .[testing] pip install -r requirements-doc.txt # Only if you plan to build docs
- Run the test suite early and often:
pytest
- Format and lint your changes before committing:
pre-commit install pre-commit run --all-files
- Write clear commit messages in the present tense, e.g.
Add distance-aware connectivity helper. - Open a pull request against
main. Reference related issues and describe the motivation, implementation details, and testing performed.
- Python code must be compatible with CPython 3.10 and newer.
- Follow the rules enforced by
ruffand the project configuration. Prefer descriptive variable names and concise functions. - Keep modules focused; extract shared logic into utilities instead of duplicating code.
- Add or update unit tests for new behavior. Contributions without coverage will likely be delayed.
- Document public APIs using reStructuredText or Markdown docstrings and update
relevant guides in
docs/when functionality changes.
To preview the documentation locally:
pip install -r requirements-doc.txt
sphinx-build -b html docs docs/_build/htmlPlease proofread content for clarity and provide screenshots or diagrams when it helps users understand the feature. Keep narrative tutorials executable by running the code blocks end-to-end.
- Tests pass locally (
pytest). -
pre-commit run --all-filesreports no issues. - New or changed behavior is covered by tests and documentation.
- Changelog entry added when the change is user-facing.
- Contributors listed in
AUTHORS.mdupdated if applicable.
Core maintainers cut releases on demand. If your change should be part of the next release, mention it in your pull request. Release steps include:
- Update
CHANGELOG.mdwith highlights of the release. - Bump
braintools.__version__. - Build artifacts:
python -m pip wheel . --no-deps -w distandpython -m build(PEP 517 source distribution). - Run smoke tests on the built wheel in a clean environment.
- Publish to PyPI and create a GitHub release tag.
All participants must follow the project Code of Conduct. If you encounter issues or need clarification, open a discussion or email maintainers at conduct@braintools.dev.
Thank you for helping BrainTools grow!