Pushing patches

Aaron Meurer edited this page Jan 21, 2018 · 18 revisions

If you have been around for some time and actively participating in SymPy's development, you will be granted push access to the main repository. Then you can push in patches that passed review.

How to Push to Master

Once the Pull Request (PR) is reviewed, click the green "Merge" button at the github PR page.

Only use the merge button. Don't try to do stuff from the command line, because it is too easy to mess stuff up, and it's not worth it (and plus, Travis won't run unless there is a pull request).

To make sure that you never accidentally push something to SymPy, run

$ git remote set-url origin git://github.com/sympy/sympy.git

(replace sympy.git with the name of the repo for the other repos). This will set your origin url to git://, which is read only. Note that this may cause issues if you are on a firewall or proxy, so if you have issues pulling, you may need to set it back. To be sure, SymPy has branch protection on GitHub, so that pushing to master is actually impossible, but this is a good practice anyway (it will avoid accidentally pushing other branches, for instance).


There are basically four things that you need to do before pushing anything in:

  1. Make sure all tests pass (if it is part of the main repo; for the webpage, make sure everything looks good and also that the pages are built). Do this for the merged/rebased version to make sure that that didn't introduce any errors. For pull requests to SymPy, make sure Travis passes. Actually, GitHub is currently configured so that PRs without Travis passing cannot be merged (if a Travis build fails because of a Travis error, you should have the ability to restart it if you login to Travis).

  2. Make sure that all content has been reviewed (for example, make sure that the person didn't push in a new commit to the branch for review that you didn't notice).

  3. Make sure that no one else has any objections to the branch. Everything is based on consensus, so until one is reached, the branch cannot be pushed in.

  4. All new functionality should be tested, and all new methods/functions/classes should have some doctests showing how to use them (the ./bin/coverage_doctest.py script will show you what methods have doctests). This will upload a review to the pull request that will say if the documentation coverage has increased or decreased.

Push access removal due to inactivity

Our policy is to remove push access from anyone who hasn't made any contributions in the past year. This is done for security purposes only. If you had push access before and it was revoked due to inactivity, we will be happy to reinstate it if you start contributing again (just email Aaron).

There is also a way to push patches from a command line (Pushing-patches-expert), but please do not use it, as it is too easy to screw things up.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.