Python Developer’s Guide¶
This guide is a comprehensive resource for contributing to Python – for both new and experienced contributors. It is maintained by the same community that maintains Python. We welcome your contributions to Python!
Quick reference¶
Here are the basic steps needed to get set up and contribute a patch. This is meant as a checklist, once you know the basics. For complete instructions please see the setup guide.
Install and set up Git and other dependencies (see the Git Setup page for detailed information).
Fork the CPython repository to your GitHub account and get the source code using:
git clone https://github.com/<your_username>/cpython cd cpython
Build Python:
./configure --with-pydebug && make -j
./configure --with-pydebug && make -j
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.
-
./python -m test -j3
./python.exe -m test -j3
Note: Most macOS systems use
./python.exein order to avoid filename conflicts with thePythondirectory..\python.bat -m test -j3
Create a new branch where your work for the issue will go, e.g.:
git checkout -b fix-issue-12345 main
If an issue does not already exist, please create it. Trivial issues (e.g. typo fixes) do not require any issue to be created.
Once you fixed the issue, run the tests, and the patchcheck:
make patchcheckmake patchcheck.\python.bat Tools\patchcheck\patchcheck.py
If everything is ok, commit.
Push the branch on your fork on GitHub and create a pull request. Include the issue number using
gh-NNNNin the pull request description. For example:gh-12345: Fix some bug in spam module
Add a News entry into the
Misc/NEWS.ddirectory as individual file. The news entry can be created by using blurb-it, or the blurb tool and itsblurb