Pull request step-by-step#
The preferred workflow for contributing to ArviZ is to fork the GitHub repository, clone it to your local machine, and develop on a feature branch.
This tutorial applies to any of these repositories:
Steps#
Have you already gone through this tutorial?
If this is not your first time going over this tutorial and you want to work on your 2nd+ PR you can skip steps 1-3, and instead do:
git checkout main
git fetch upstream
git rebase upstream/main
This will make sure you are on the main branch of your local repository and sync it
with the one on GitHub. After this you can continue with step 4
to create your feature branch from the up-to-date main
Fork the project repository by clicking on the ‘Fork’ button near the top right of the main repository page. This creates a copy of the code under your GitHub user account.
Clone your fork of the target ArviZ repository from your GitHub account to your local disk.
git clone git@github.com:<your GitHub handle>/<arviz repo>.git
git clone https://github.com/<your GitHub handle>/<arviz repo>.git
Navigate to your arviz directory and add the base repository as a remote:
cd <arviz repo> git remote add upstream git@github.com:arviz-devs/<arviz repo>.git
cd <arviz repo> git remote add upstream https://github.com/arviz-devs/<arviz repo>.git
Create a
featurebranch to hold your development changes:git checkout -b my-feature
Warning
Always create a new
featurebranch before making any changes. Make your changes in thefeaturebranch. It’s good practice to never routinely work on themainbranch of any repository and we have a pre-commit check that prevents committing tomainWe use tox to help with common development tasks. To get your development environment up and running we recommend installing
toxand the arviz local package you are working on:pip install tox pip install -e .
Work on your feature, bugfix, documentation improvement…
Execute the relevant development related tasks. Each repository has slightly different needs for testing or doc building so we start by checking the available tox commands:
tox list -m dev
which will print something like:
check -> Perform style checks docs -> Build HTML docs test-namespace -> Run ArviZ metapackage tests cleandocs -> Clean HTML doc build outputs viewdocs -> View HTML docs with the default browser
we then execute the relevant commands. If we have been working a bugfix and didn’t change anything related to documentation we can skip those tasks and run only the
checkandtest-namespaceones:tox -e test-namespace tox -e check
Once you are happy with the changes, add your changes using git commands,
git addand thengit commit, like:git add modified_files git commit -m "commit message here"
to record your changes locally. After committing, it is a good idea to sync with the base repository in case there have been any changes:
git fetch upstream git rebase upstream/main
Then push the changes to your GitHub account with:
git push -u origin my-feature
Go to the GitHub web page of the respective ArviZ repository you were working on. Click the ‘Pull request’ button to send your changes to the project’s maintainers for review. This will send an email to the committers.
Tip
Now that the PR is ready to submit, check the Pull request checklist.
Thanks for contributing! Now Wait for reviews to come it. Most reviewers work on ArviZ on a volunteer basis, depending on availability and workload it can take several days until you get a review.
Address review comments. Some PRs can be merged directly, but the most common scenario if for further commits to be needed. To update your PR you only need to commit to the same branch you were working on and push as shown in step 6.