We want to make contributing to this project as easy and transparent as possible.
-
Fork and clone:
git clone https://github.com/YOUR_USERNAME/momentum.git cd momentum git remote add upstream https://github.com/facebookresearch/momentum.git -
Build: (dependencies auto-install)
pixi run build # C++ library pixi run build_py # Python bindings
-
Test:
pixi run test # C++ tests pixi run test_py # Python tests
-
Make changes:
git checkout -b feature/your-feature # Make your changes pixi run lint # Format code pixi run test # Verify tests pass
-
Submit:
git commit -m "Your message" git push origin feature/your-feature # Open PR on GitHub
- Git
- Pixi package manager (install guide)
Dependencies are automatically installed when running any Pixi task.
pixi run build # Release build
pixi run build_dev # Debug build
pixi run test # Run testsPlatform-specific:
- Windows:
pixi run open_vsopens Visual Studio - Linux: FBX SDK auto-installs during build
View all tasks: pixi task list
pixi run build_py # Build Python bindings
pixi run test_py # Run Python tests
pixi run doc_py # Build Python docsNote: Rebuild after C++/pybind11 changes. Pure Python changes don't require rebuilding.
- See Style Guide
- Format:
pixi run lint - Check:
pixi run lint-check
- Follow PEP 8
- Use type hints and docstrings
- Format:
black pymomentum/
pixi run test # C++ tests
pixi run test_py # Python tests
pixi run test_verbose # C++ verbose output
pixi run test_py_verbose # Python verbose outputRun specific tests:
pixi shell
pytest pymomentum/test/test_character.py -v
exitWe actively welcome your pull requests.
- Fork the repo and create your branch from
main. - If you've added code that should be tested, add tests.
- If you've changed APIs, update the documentation.
- Ensure the test suite passes.
- Make sure your code lints.
- If you haven't already, complete the Contributor License Agreement ("CLA").
Note: Pull requests are not imported into the GitHub repository in the usual way. There is an internal Meta repository that is the "source of truth" for this project. The GitHub repository is generated from the internal Meta repository. Pull requests must first be imported into the internal Meta repository, where they are reviewed. Once approved, changes are automatically reflected from the internal Meta repository back to GitHub. This is why you won't see your PR being directly merged, but you will still see your changes in the repository once it reflects the imported changes.
PRs automatically run:
- Builds on Ubuntu, macOS, Windows
- All C++ and Python tests
- Code formatting checks
- Documentation builds
In order to accept your pull request, we need you to submit a CLA. You only need to do this once to work on any of Meta's open source projects.
Complete your CLA here: https://code.facebook.com/cla
Build fails: pixi run clean && pixi run build
Format errors: pixi run lint
Test fails: Use pixi run test_verbose for details
Merge conflicts:
git fetch upstream
git rebase upstream/main
# Resolve conflicts
git rebase --continue
git push origin feature/your-feature --force- Pure Python changes: Edit and test directly (no rebuild)
- C++ binding changes:
pixi run build_py
pixi shell
gdb python
run pymomentum/test/test_character.pymomentum/ # C++ core library
pymomentum/ # Python bindings
├── pymomentum/ # Pure Python code
├── test/ # Python tests
└── bindings/ # pybind11 bindings
We use GitHub issues to track public bugs. Please ensure your description is clear and has sufficient instructions to be able to reproduce the issue.
When filing a bug, include:
- Clear description
- Steps to reproduce
- Expected vs actual behavior
- Environment (OS, compiler, Python version)
- Minimal example code
Meta has a bounty program for the safe disclosure of security bugs. In those cases, please go through the process outlined on that page and do not file a public issue.
- Questions: GitHub Discussions
- Bugs: Issue Tracker
- Documentation: Project Website
By contributing to this project, you agree that your contributions will be licensed under the LICENSE file in the root directory of this source tree.
Thank you for contributing to Momentum!