diff --git a/pullrequest.rst b/pullrequest.rst index 7e479f5326..c6b2100e64 100644 --- a/pullrequest.rst +++ b/pullrequest.rst @@ -93,6 +93,89 @@ command (after any successful build of Python):: python.bat Tools/scripts/patchcheck.py +Quick Guide +''''''''''' + +`Clear communication`_ is key to contributing to any project, especially an +`Open Source`_ project like Python. + +Here is a quick overview of you can contribute to CPython on Github: + +1. `Create an Issue`_ that describes your change, if it doesn't exist and you're explicitly working on something + +2. `Get started`_ and set up your system + +3. Fork `CPython on Github`_ (using the Fork button in the upper-right on Github) + +4. `Compile Python`_ on your system + +5. `Run tests`_ after you have built Python + +6. `Add an "upstream" Remote in Git`_ on your system + +7. `Create a Branch in Git`_ where you can work on changes + +8. Commit changes and `resolve conflicts in Git`_ + +9. `Run tests`_ again + +10. `Push commits`_ to your Github repo + +11. `Create Pull Request`_ in Github to merge a branch from your Fork + +12. Celebrate! You just contributed to Python. :) + +.. _Clear communication: https://opensource.guide/how-to-contribute/#how-to-submit-a-contribution +.. _Open Source: https://opensource.guide/ +.. _Create an Issue: https://bugs.python.org/ +.. _Get started: https://cpython-devguide.readthedocs.io/setup.html#getting-started +.. _CPython on Github: https://github.com/python/cpython +.. _Compile Python: https://cpython-devguide.readthedocs.io/setup.html#compiling-for-debugging +.. _Run tests: https://cpython-devguide.readthedocs.io/runtests.html#running-writing-tests +.. _Add an "upstream" Remote in Git: https://cpython-devguide.readthedocs.io/committing.html#remotes-setup +.. _Create a Branch in Git: https://cpython-devguide.readthedocs.io/committing.html#active-branches +.. _resolve conflicts in Git: https://cpython-devguide.readthedocs.io/committing.html#squashing-commits +.. _Run tests: https://cpython-devguide.readthedocs.io/runtests.html#running-writing-tests +.. _Push commits: https://cpython-devguide.readthedocs.io/committing.html#pushing-changes +.. _Create Pull Request: https://help.github.com/articles/creating-a-pull-request/ + + +Quick Guide Step-by-step +'''''''''''''''''''''''' + +Set up your system:: + + git clone git@github.com:YOUR_GITHUB_ID/cpython.git + +Replace **YOUR_GITHUB_ID** with your Github account name above, then add upstream:: + + git remote add upstream git://github.com/python/cpython.git + +Work on new features or fixes:: + + git checkout -b MY_NEW_FEATURE upstream/master + +As you work, please create a separate commit for each bug fix or feature change:: + + git commit + +Then fetch upstream to see if anything conflicts with your changes:: + + git fetch upstream + +Use rebase -i to verify what you commit and squish small commits:: + + git rebase -i upstream/master + +Then push your work to your clone on Github:: + + git push origin MY_NEW_FEATURE + +When you're ready, make a Pull Request on Github and refer to your branch named **MY_NEW_FEATURE**. + +*Though submitting a Pull Request on Github is the preferred method of contribution, you can alternatively upload a patch to bugs.python.org* + + Licensing ---------