Files
lerobot-clone/CONTRIBUTING.md

87 lines
3.0 KiB
Markdown
Raw Permalink Normal View History

# How to contribute to 🤗 LeRobot
2024-04-16 10:33:58 +02:00
Everyone is welcome to contribute, and we value everybody's contribution. Code is not the only way to help the community. Answering questions, helping others, reaching out, and improving the documentation are immensely valuable.
2024-04-16 10:33:58 +02:00
Whichever way you choose to contribute, please be mindful to respect our [code of conduct](https://github.com/huggingface/lerobot/blob/main/CODE_OF_CONDUCT.md) and our [AI policy](https://github.com/huggingface/lerobot/blob/main/AI_POLICY.md).
2024-04-16 10:33:58 +02:00
## Ways to Contribute
2024-04-16 10:33:58 +02:00
You can contribute in many ways:
2024-04-16 10:33:58 +02:00
- **Fixing issues:** Resolve bugs or improve existing code.
- **New features:** Develop new features.
- **Extend:** Implement new models/policies, robots, or simulation environments and upload datasets to the Hugging Face Hub.
- **Documentation:** Improve examples, guides, and docstrings.
- **Feedback:** Submit tickets related to bugs or desired new features.
If you are unsure where to start, join our [Discord Channel](https://discord.gg/q8Dzzpym3f).
2024-04-16 10:33:58 +02:00
## Development Setup
2024-04-16 10:33:58 +02:00
To contribute code, you need to set up a development environment.
2024-04-16 10:33:58 +02:00
### 1. Fork and Clone
2024-04-16 10:33:58 +02:00
Fork the repository on GitHub, then clone your fork:
2024-04-16 10:33:58 +02:00
```bash
git clone https://github.com/<your-handle>/lerobot.git
cd lerobot
git remote add upstream https://github.com/huggingface/lerobot.git
```
2024-04-16 10:33:58 +02:00
### 2. Environment Installation
2024-04-16 10:33:58 +02:00
Please follow our [Installation Guide](https://huggingface.co/docs/lerobot/installation) for the environment setup & installation from source.
2024-04-16 10:33:58 +02:00
## Running Tests & Quality Checks
2024-04-16 10:33:58 +02:00
### Code Style (Pre-commit)
2024-04-16 10:33:58 +02:00
Install `pre-commit` hooks to run checks automatically before you commit:
2024-04-16 10:33:58 +02:00
```bash
pre-commit install
```
2024-04-16 10:33:58 +02:00
To run checks manually on all files:
2024-04-16 10:33:58 +02:00
```bash
pre-commit run --all-files
```
2024-04-16 10:33:58 +02:00
### Running Tests
2024-04-16 10:33:58 +02:00
We use `pytest`. First, ensure you have test artifacts by installing **git-lfs**:
2024-04-16 10:33:58 +02:00
```bash
git lfs install
git lfs pull
2024-04-16 10:33:58 +02:00
```
Run the full suite (this may require extras installed):
2024-04-16 10:33:58 +02:00
```bash
pytest -sv ./tests
2024-04-16 10:33:58 +02:00
```
Or run a specific test file during development:
2024-04-16 10:33:58 +02:00
```bash
pytest -sv tests/test_specific_feature.py
2024-04-16 10:33:58 +02:00
```
## Submitting Issues & Pull Requests
2024-04-16 10:33:58 +02:00
Use the templates for required fields and examples.
- **Issues:** Follow the [ticket template](https://github.com/huggingface/lerobot/blob/main/.github/ISSUE_TEMPLATE/bug-report.yml).
- **Pull requests:** Rebase on `upstream/main`, use a descriptive branch (don't work on `main`), run `pre-commit` and tests locally, and follow the [PR template](https://github.com/huggingface/lerobot/blob/main/.github/PULL_REQUEST_TEMPLATE.md).
> [!IMPORTANT]
> Community Review Policy: To help scale our efforts and foster a collaborative environment, we ask contributors to review at least one other person's open PR before their own receives attention. This shared responsibility multiplies our review capacity and helps everyone's code get merged faster!
Once you have submitted your PR and completed a peer review, a member of the LeRobot team will review your contribution.
2024-04-16 10:33:58 +02:00
Thank you for contributing to LeRobot!