Navigation

Python Developer’s Guide¶

Quick Start¶

Here is a list of the basic steps necessary to get set up and make a patch:

  1. Get a clone of CPython with hg clone hg.python.org/cpython.

  2. On UNIX, run ./configure --with-pydebug && make -j2 to build Python.

    On Windows, load the project file PCbuild\pcbuild.sln in Visual Studio, select Debug, and Build ‣ Build Solution.

  3. Run the tests with ./python -m test -j3 (use ./python.exe on most Mac OS X systems and PCbuild\python_d.exe on Windows; replace test with test.regrtest for 2.7).

  4. Make the patch.

  5. Submit it to the issue tracker.

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 Python Mentors group is available to help guide new contributors through the process. The Developer FAQ is another useful source of information.

Guide for contributing to Python:

  • Getting Set Up

  • Where to Get Help

  • Lifecycle of a Patch

  • Running & Writing Tests

  • Beginner tasks to become familiar with the development process
    • Helping with Documentation
    • Increase Test Coverage
  • Advanced tasks for once you are comfortable
    • Silence Warnings From the Test Suite
    • Fixing issues found by the buildbots
    • Fixing “easy” Issues (and Beyond)
  • Using the Issue Tracker and Helping Triage Issues
    • Triaging an Issue
  • Following Python’s Development

  • How to Become a Core Developer
    • Committing and Pushing Changes
    • Development Cycle
    • Continuous Integration

It is recommended that the above documents be read in the order listed. 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:

  • Adding to the Stdlib
  • Changing the Python Language

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 example that may be of interest are:

  • PyPy: A Python interpreter focused on high speed (JIT-compiled) operation on major platforms
  • Jython: A Python interpreter focused on good integration with the Java Virtual Machine (JVM) environment
  • IronPython: A Python interpreter focused on good integration with the Common Language Runtime (CLR) provided by .NET and Mono
  • Stackless: A Python interpreter focused on providing lightweight microthreads while remaining largely compatible with CPython specific extension modules

Resources¶

  • Anyone can clone this guide from hg.python.org/devguide/. Core developers should use ssh://hg@hg.python.org/devguide instead, so that they can push back their edits to the server.

  • Coding style guides
    • PEP 7 (Style Guide for C Code)
    • PEP 8 (Style Guide for Python Code)
  • Issue tracker
    • Meta tracker (issue tracker for the issue tracker)
    • Experts Index
    • Firefox search engine plug-in
  • Buildbot status

  • Source code
    • Browse online
    • Snapshot of py3k
    • Daily OS X installer
  • Tool support
    • Emacs support
    • gdb Support
    • Various tools with configuration files as found in the Misc directory
  • Help with ...
    • Changing CPython’s Grammar
    • Design of CPython’s Compiler
  • Python Developer FAQ

  • PEPs (Python Enhancement Proposals)

  • python.org maintenance

  • Developer Log

  • Search this guide

Table Of Contents

  • Python Developer’s Guide
    • Quick Start
    • Quick Links
    • Contributing
    • Proposing changes to Python itself
    • Other Interpreter Implementations
    • Resources

Next topic

Getting Set Up

This Page

  • Show Source

Navigation

© Copyright 2011-2012, Python Software Foundation. Created using Sphinx 1.0.6.
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.