Contributing to Tune¶
We welcome (and encourage!) all forms of contributions to Tune, including and not limited to:
- Code reviewing of patches and PRs.
- Pushing patches.
- Documentation and examples.
- Community participation in forums and issues.
- Code readability and code comments to improve readability.
- Test cases to make the codebase more robust.
- Tutorials, blog posts, talks that promote the project.
Setting up a development environment¶
If you have Ray installed via pip (
pip install -U ray), you can develop Tune locally without needing to compile Ray.
First, you will need your own [fork](https://help.github.com/en/articles/fork-a-repo) to work on the code. Press the Fork button on the ray project page. Then, clone the project to your machine and connect your repository to the upstream (main project) ray repository.
git clone https://github.com/[your username]/ray.git [path to ray directory] cd [path to ray directory] git remote add upstream https://github.com/ray-project/ray.git
Then, run [path to ray directory]/python/ray/setup-dev.py (also here on Github) script.
This sets up links between the
tune dir (among other directories) in your local repo and the one bundled with the
What can I work on?¶
If raising a new issue or PR related to Tune, be sure to include “[tune]” in the beginning of the title.
For project organization, Tune maintains a relatively up-to-date organization of issues on the Tune Github Project Board. Here, you can track and identify how issues are organized.
Submitting and Merging a Contribution¶
There are a couple steps to merge a contribution.
First rebase your development branch on the most recent version of master.
git remote add upstream https://github.com/ray-project/ray.git git fetch upstream git rebase upstream/master
Make sure all existing tests pass.
If introducing a new feature or patching a bug, be sure to add new test cases in the relevant file in tune/tests/.
Document the code. Public functions need to be documented, and remember to provide an usage example if applicable.
Request code reviews from other contributors and address their comments. One fast way to get reviews is to help review others’ code so that they return the favor. You should aim to improve the code as much as possible before the review. We highly value patches that can get in without extensive reviews.
Reviewers will merge and approve the pull request; be sure to ping them if the pull request is getting stale.
Even though we have hooks to run unit tests automatically for each pull request, we recommend you to run unit tests locally beforehand to reduce reviewers’ burden and speedup review process.
Documentation should be documented in Google style format.
We also have tests for code formatting and linting that need to pass before merge. Install yapf==0.23, flake8, flake8-quotes. You can run the following locally:
Becoming a Reviewer¶
We identify reviewers from active contributors. Reviewers are individuals who not only actively contribute to the project and are also willing to participate in the code review of new contributions. A pull request to the project has to be reviewed by at least one reviewer in order to be merged. There is currently no formal process, but active contributors to Tune will be solicited by current reviewers.
These tips are based off of the TVM contributor guide.