Movatterモバイル変換


[0]ホーム

URL:


ContentsMenuExpandLight modeDark modeAuto light/dark, in light modeAuto light/dark, in dark modeSkip to content
Python Developer's Guide
Logo
Python Developer's Guide
Back to top

Python Developer’s Guide

This guide is a comprehensive resource forcontributingtoPython – for both new and experienced contributors. It ismaintained by the samecommunity 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 completeinstructions please see thesetup guide.

  1. Install and set upGit and other dependencies(see theGit Setup page for detailed information).

  2. Forkthe CPython repositoryto your GitHub account andget the source code using:

    gitclonehttps://github.com/<your_username>/cpythoncdcpython
  3. Build Python:

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

    See alsomore detailed instructions,how to install and build dependencies,and the platform-specific pages forUnix,macOS, andWindows.

  4. Run the tests:

    ./python-mtest-j3
    ./python.exe-mtest-j8

    Note:Most macOS systems use./python.exe in order to avoid filename conflicts withthePython directory.

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

    gitcheckout-bfix-issue-12345main

    If an issue does not already exist, pleasecreate it. Trivial issues (for example, typo fixes) donot require any issue to be created.

  6. Once you fixed the issue, run the tests, and the patchcheck:

    makepatchcheck
    makepatchcheck
    .\python.bat Tools\patchcheck\patchcheck.py

    If everything is ok, commit.

  7. Push the branch on your fork on GitHub andcreate a pull request. Include the issue number usinggh-NNNN in thepull request description. For example:

    gh-12345: Fix some bug in spam module
  8. Add a News entry into theMisc/NEWS.d directory as individual file. Thenews entry can be created by usingblurb-it,or theblurb tool and itsblurbaddcommand. Please read more aboutblurb in itsrepository.

Note

First time contributors will need to sign the Contributor LicensingAgreement (CLA) as described in theLicensing section ofthis guide.

Quick links

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

Contributing

We encourage everyone to contribute to Python and that’s why we have put up thisdeveloper’s guide. If you still have questions after reviewing the material inthis guide, then theCore Python Mentorship group is available to help guide newcontributors through the process.

A number of individuals from the Python community have contributed to a seriesof excellent guides atOpen Source Guides.

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

Guide for contributing to Python:

Werecommend that the documents in this guide be read as needed. Youcan stop where you feel comfortable and begin contributing immediately withoutreading and understanding these documents all at once. If you do choose to skiparound within the documentation, be aware that it is written assuming precedingdocumentation has been read so you may find it necessary to backtrack to fill inmissing concepts and terminology.

Proposing changes to Python itself

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

While these kinds of change are much rarer than those described above, they dohappen 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 andC++ ecosystems).

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

  • PyPy: A Python interpreter focused on high speed (JIT-compiled) operationon major platforms

  • Jython: A Python interpreter focused on good integration with the JavaVirtual Machine (JVM) environment

  • IronPython: A Python interpreter focused on good integration with theCommon Language Runtime (CLR) provided by .NET and Mono

  • Stackless: A Python interpreter focused on providing lightweightmicrothreads while remaining largely compatible with CPython specificextension modules

  • MicroPython: A tiny Python interpreter with small subset of the Pythonstandard library that is optimised to run on microcontrollers and inconstrained environments.

  • CircuitPython: A fork of MicroPython designed to simplify experimentingand learning to code on low-cost microcontroller boards.

Key resources

Additional resources

Code of conduct

Please note that all interactions onPython Software Foundation-supportedinfrastructure iscoveredby thePSF 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, andrespectful of others no matter what their position is within the project.

Status of Python branches

Moved toStatus of Python versions

Full table of contents

On this page

[8]ページ先頭

©2009-2025 Movatter.jp