Quick Reference

Here are the basic steps needed to get set up and open a pull request.

This is meant as a checklist and cheat-sheet, not a comprehensive guide. For complete instructions please see the setup guide.

  1. Install and set up Git and other dependencies (see the Git Setup page for detailed information).

  2. Fork the CPython repository to your GitHub account and get the source code using:

    git clone https://github.com/<your_username>/cpython
    cd cpython
    
  3. Build Python:

    ./configure --config-cache --with-pydebug && make -j $(nproc)
    
    ./configure --config-cache --with-pydebug && make -j8
    
    PCbuild\build.bat -e -d
    

    See also more detailed instructions, how to install and build dependencies, and the platform-specific pages for Unix, macOS, and Windows.

  4. Run the tests:

    ./python -m test -j3
    
    ./python.exe -m test -j8
    

    Note

    Most macOS systems use ./python.exe in order to avoid filename conflicts with the Python directory.

    .\python.bat -m test -j3
    
  5. Create a new branch where your work for the issue will go, for example:

    git checkout -b fix-issue-12345 main
    

    If an issue does not already exist, please create it. Trivial issues (for example, typos) do not require an issue.

  6. Push the branch on your fork on GitHub and create a pull request. Include the issue number using gh-NNNNNN in the pull request title. For example:

    gh-12345: Fix some bug in spam module
    
  7. Add a News entry into the Misc/NEWS.d/ directory as individual file. The news entry can be created by using blurb-it, or the blurb tool and its blurb add command. Please read more about blurb in its repository.

Note

First time contributors will need to sign the Contributor Licensing Agreement (CLA) as described in the Licensing section of this guide.