Getting started

Getting started

Quick reference

Set up Git

Fork and clone the repo

Build Python

Run the tests

Create issues and pull requests

Create issues for nontrivial changes

Create work branches

Document your changes

Create pull requests

Work on your pull request

Don’t force-push

Setup and building

Install Git

Get the source code

Install pre-commit as a Git hook

Compile and build

Unix

Clang

Optimization

Windows

WASI

Emscripten

Android

iOS

Install dependencies

Regenerate configure

Regenerate the ABI dump

Troubleshoot the build

Avoid recreating auto-generated files

Editors and tools

Directory structure

Using a container

Contribute using GitHub Codespaces

What is GitHub Codespaces?

Create a CPython codespace

Use Codespaces locally

Using the dev container directly

Using the pre-built container image

Building yourself

Fixing “easy” issues (and beyond)

Git bootcamp and cheat sheet

Forking CPython GitHub repository

Cloning a forked CPython repository

Configure the remotes

Listing the remote repositories

Setting up your name and email address

Enabling autocrlf on Windows

Creating and switching branches

Deleting branches

Renaming branch

Staging and committing files

Reverting changes

Stashing changes

Comparing changes

Pushing changes

Creating a pull request

Linking to issues and pull requests

Updating your CPython fork

Applying a patch to Git

Checking out others’ pull requests

Accepting and merging a pull request

Cancelling an automatic merge

Backporting merged changes

Editing a pull request prior to merging

GitHub CLI

Git worktree

Setting up Git worktree

Using Git worktree

Lifecycle of a pull request

Introduction

Step-by-step guide

Resolving merge conflicts

Don’t force-push

Making good PRs

Updating NEWS and What’s New in Python

Changes that require NEWS entries

Changes that require “What’s New in Python” entries

How to add a NEWS entry

How to write a NEWS entry

Copyrights

Typo fixes

patchcheck

Making good commits

Licensing

Why do I need to sign the CLA again?

Submitting

Converting an existing patch from b.p.o to GitHub

Reviewing

How to review a pull request

Leaving a pull request review on GitHub

Dismissing review from another core team member

Keeping continuous integration green

Update branch button

Committing/rejecting

Crediting

Where to get help

Discourse

Ask #python-dev

Core mentorship

File a bug

Guidelines for using AI tools

Considerations for success

Acceptable uses

Unacceptable uses