Skip to content

pullrequest.html#quick guide

Louis Rawlins edited this page Feb 21, 2017 · 2 revisions

DRAFT

Source: https://cpython-devguide.readthedocs.io/pullrequest.html#quick-guide


3.1.4. Quick Guide

Clear communication is key to contributing to any project, especially an Open Source project like Python. To ensure that the technical workflow runs smoothly, here is a quick overview of how to make a contribution 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. :)

3.1.5. 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)

git remote add upstream git://github.com/python/cpython.git

Work on new features or fixes:

git checkout -b MY_NEW_FEATURE upstream/master

git commit (as you work, create a separate commit for each bug fix, feature change, style or copy edit please)

git fetch upstream

git rebase -i upstream/master (using rebase -i lets you verify what you commit and squish small commits)

git push origin HEAD

When you're ready, make a Pull Request on Github and refer to your MY_NEW_FEATURE branch.

⁠* Though submitting a Pull Request on Github is the preferred method of contribution, you can alternatively Upload a Patch to bugs.python.org