Pull request step-by-step#
The preferred workflow for contributing to PyMC is to fork theGitHub repository, clone it to your local machine, and develop on a feature branch.
Steps#
Read theEtiquette for code contributions.
Fork theproject 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 PyMC repo from your GitHub account to your local disk, and add the base repository as a remote:
gitclonegit@github.com:<yourGitHubhandle>/pymc.gitcdpymcgitremoteaddupstreamgit@github.com:pymc-devs/pymc.gitCreate a
featurebranch to hold your development changes:gitcheckout-bmy-feature
Attention
Always use a
featurebranch. It’s good practice to never routinely work on themainbranch of any repository.Project requirements are in
requirements.txt, and libraries used for development are inrequirements-dev.txt.The easiest (and recommended) way to set up a development environment is viaminiconda:condaenvcreate-fconda-envs/environment-dev.yml
condaenvcreate-f.\conda-envs\windows-environment-dev.yml
condaenvcreate-fconda-envs/windows-environment-dev.yml
condaactivatepymc-devpipinstall-e.
Alternatively you may (probably in avirtual environment) run:
pipinstall-e.pipinstall-rrequirements-dev.txt
Develop the feature on your feature branch.
gitcheckoutmy-feature# no -b flag because the branch is already createdBefore committing, run
pre-commitchecks.pipinstallpre-commitpre-commitrun--all# 👈 to run it manuallypre-commitinstall# 👈 to run it automatically before each commit
Add changed files using
gitaddand thengitcommitfiles:$gitaddmodified_files$gitcommit
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:
gitfetchupstreamgitrebaseupstream/main
Then push the changes to the fork in your GitHub account with:
gitpush-uoriginmy-feature
If this is your first contribution, the start of some CI jobs will have to be approved by a maintainer.
Go to the GitHub web page of your fork of the PyMC repo.Click the ‘Pull request’ button to send your changes to the project’s maintainers for review.This will send a notification to the committers.
Tip
Now that your PR is ready, read thePull request checklist to make sure it follows best practices.
