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#

  1. 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.

  1. 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
    
  2. 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
    
  1. Create a feature branch to hold your development changes:

    git checkout -b my-feature
    

    Warning

    Always create a new feature branch before making any changes. Make your changes in the feature branch. It’s good practice to never routinely work on the main branch of any repository and we have a pre-commit check that prevents committing to main

  2. We use tox to help with common development tasks. To get your development environment up and running we recommend installing tox and the arviz local package you are working on:

    pip install tox
    pip install -e .
    
  3. Work on your feature, bugfix, documentation improvement…

  4. 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 check and test-namespace ones:

    tox -e test-namespace
    tox -e check
    
  1. Once you are happy with the changes, add your changes using git commands, git add and then git 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
    
  2. 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.

  3. 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.

  4. 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.