Python Developer’s Guide (original) (raw)

View this page

Edit this page

Toggle table of contents sidebar

This guide is a comprehensive resource for contributingto Python – for both new and experienced contributors. It ismaintained 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 pull request. This is meant as a checklist, once you know the basics. 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 repositoryto your GitHub account and get the source code using:
    git clone https://github.com//cpython
    cd cpython
  3. Build Python:
    Unix
    ./configure --with-pydebug && make -j $(nproc)
    macOS
    ./configure --with-pydebug && make -j8
    Windows
    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:
    Unix
    macOS
    Note: Most macOS systems use./python.exe in order to avoid filename conflicts with the Python directory.
    Windows
  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, typo fixes) do not require any issue to be created.
  6. Once you fixed the issue, run the tests, and the patchcheck:
    Unix
    macOS
    Windows
    .\python.bat Tools\patchcheck\patchcheck.py
    If everything is ok, commit.
  7. Push the branch on your fork on GitHub and create a pull request. Include the issue number using gh-NNNN in the pull request description. For example:
    gh-12345: Fix some bug in spam module
  8. 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 addcommand. Please read more about blurb in itsrepository.

Note

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

Quick links

Here are some links that you probably will reference frequently while contributing to Python:

Contributing

We encourage everyone to contribute to Python and that’s why we have put up this developer’s guide. If you still have questions after reviewing the material in this guide, then the Core Python Mentorship group is available to help guide new contributors through the process.

A number of individuals from the Python community have contributed to a series of excellent guides at Open Source Guides.

Core developers and contributors alike will find the following guides useful:

Guide for contributing to Python:

We recommend that the documents in this guide be read as needed. You can stop where you feel comfortable and begin contributing immediately without reading and understanding these documents all at once. If you do choose to skip around within the documentation, be aware that it is written assuming preceding documentation has been read so you may find it necessary to backtrack to fill in missing concepts and terminology.

Proposing changes to Python itself

Improving Python’s code, documentation and tests are ongoing tasks that are never going to be “finished”, as Python operates as part of an ever-evolving system of technology. An even more challenging ongoing task than these necessary maintenance activities is finding ways to make Python, in the form of the standard library and the language definition, an even better tool in a developer’s toolkit.

While these kinds of change are much rarer than those described above, they do happen and that process is also described as part of this guide:

Other interpreter implementations

This guide is specifically for contributing to the Python reference interpreter, also known as CPython (while most of the standard library is written in Python, the interpreter core is written in C and integrates most easily with the C and C++ ecosystems).

There are other Python implementations, each with a different focus. Like CPython, they always have more things they would like to do than they have developers to work on them. Some major examples that may be of interest are:

Key resources

Additional resources

Code of conduct

Please note that all interactions onPython Software Foundation-supported infrastructure is coveredby the PSF Code of Conduct, which includes all infrastructure used in the development of Python itself (for example, mailing lists, issue trackers, GitHub, etc.). In general this means everyone is expected to be open, considerate, and respectful of others no matter what their position is within the project.

Status of Python branches

Moved to Status of Python versions

Full table of contents