Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# See https://help.github.com/articles/about-codeowners/
# for more info about CODEOWNERS file

# It uses the same pattern rule for gitignore file
# https://git-scm.com/docs/gitignore#_pattern_format

# asyncio
**/*asyncio* @1st1 @asvetlov

# Core
**/*context* @1st1
**/*genobject* @1st1
**/*hamt* @1st1

# Hashing
**/*hashlib* @python/crypto-team
**/*pyhash* @python/crypto-team

# Import (including importlib).
# Ignoring importlib.h so as to not get flagged on
# all pull requests that change the emitted
# bytecode.
**/*import*.c @python/import-team
**/*import*.py @python/import-team


# SSL
**/*ssl* @python/crypto-team

# CSPRNG
Python/bootstrap_hash.c @python/crypto-team

# Email and related
**/*mail* @python/email-team
**/*smtp* @python/email-team
**/*mime* @python/email-team
**/*imap* @python/email-team
**/*poplib* @python/email-team

# subprocess
**/*subprocess* @gpshead

# Windows
/PC/ @python/windows-team
/PCbuild/ @python/windows-team

# Windows installer packages
/Tools/msi/ @python/windows-team
/Tools/nuget/ @python/windows-team

**/*itertools* @rhettinger
**/*collections* @rhettinger
**/*random* @rhettinger
**/*queue* @rhettinger
**/*bisect* @rhettinger
**/*heapq* @rhettinger
**/*functools* @ncoghlan @rhettinger
**/*decimal* @rhettinger @skrah

**/*dataclasses* @ericvsmith

**/*idlelib* @terryjreedy

**/*typing* @gvanrossum @ilevkivskyi
67 changes: 67 additions & 0 deletions .github/CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
Contributing to Python
======================

Build Status
------------

- master

+ `Stable buildbots <http://buildbot.python.org/3.x.stable/>`_

- 3.7

+ `Stable buildbots <http://buildbot.python.org/3.7.stable/>`_

- 3.6

+ `Stable buildbots <http://buildbot.python.org/3.6.stable/>`_

- 2.7

+ `Stable buildbots <http://buildbot.python.org/2.7.stable/>`_


Thank You
---------
First off, thanks for contributing to the maintenance of the Python programming
language and the CPython interpreter! Even if your contribution is not
ultimately accepted, the fact you put time and effort into helping out is
greatly appreciated.


Contribution Guidelines
-----------------------
Please read the `devguide <https://devguide.python.org/>`_ for
guidance on how to contribute to this project. The documentation covers
everything from how to build the code to submitting a pull request. There are
also suggestions on how you can most effectively help the project.

Please be aware that our workflow does deviate slightly from the typical GitHub
project. Details on how to properly submit a pull request are covered in
`Lifecycle of a Pull Request <https://devguide.python.org/pullrequest/>`_.
We utilize various bots and status checks to help with this, so do follow the
comments they leave and their "Details" links, respectively. The key points of
our workflow that are not covered by a bot or status check are:

- All discussions that are not directly related to the code in the pull request
should happen on bugs.python.org
- Upon your first non-trivial pull request (which includes documentation changes),
feel free to add yourself to ``Misc/ACKS``


Setting Expectations
--------------------
Due to the fact that this project is entirely volunteer-run (i.e. no one is paid
to work on Python full-time), we unfortunately can make no guarantees as to if
or when a core developer will get around to reviewing your pull request.
If no core developer has done a review or responded to changes made because of a
"changes requested" review, please feel free to email python-dev to ask if
someone could take a look at your pull request.


Code of Conduct
---------------
All interactions for this project are covered by the
`PSF Code of Conduct <https://www.python.org/psf/codeofconduct/>`_. Everyone is
expected to be open, considerate, and respectful of others no matter their
position within the project.
15 changes: 9 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
## CPython Mirror
!!! If this is a backport PR (PR made against branches other than `master`),
please ensure that the PR title is in the following format:

https://github.com/python/cpython is a cpython mirror repository. Pull requests
are not accepted on this repo and will be automatically closed.
```
[X.Y] <title from the original PR> (GH-NNNN)
```

### Submit patches at https://bugs.python.org
Where: [X.Y] is the branch name, e.g. [3.7].

For additional information about contributing to CPython, see the
[developer's guide](https://docs.python.org/devguide/#contributing).
GH-NNNN refers to the PR number from `master`.

PLEASE: Remove this headline!!!
38 changes: 0 additions & 38 deletions .github/appveyor.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/codecov.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/posix-deps-zypp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/sh
set -eu

zypper --non-interactive refresh

# The container can have newer libraries than the repositories' matching -devel
# packages. Allow the solver to downgrade dependencies rather than cancel.
# Install build tools explicitly: build patterns pull in a full base system,
# including packages that conflict with the container's busybox replacements.
# Python 3.6 needs OpenSSL 1.1 headers rather than Leap's default OpenSSL 3.
# GDB needs the UTF-32 converters supplied by glibc-locale-base.
zypper --non-interactive install --auto-agree-with-licenses \
--allow-downgrade --no-recommends \
autoconf automake gcc gcc-c++ make patch pkg-config python3 \
binutils diffutils findutils gdb glibc-locale-base gzip libtool perl tar which \
libabigail-tools xorg-x11-server-Xvfb xvfb-run \
cantarell-fonts google-droid-fonts google-inconsolata-fonts dejavu-fonts \
libffi-devel \
xz-devel \
bzip2 \
zlib-devel \
libbz2-devel \
ncurses-devel \
readline-devel \
sqlite3-devel \
libopenssl-1_1-devel \
gdbm-devel \
tk-devel \
libuuid-devel \
lcov
129 changes: 129 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Tests

# Cancel in-progress runs for the same PR.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:

jobs:
check_source:
name: 'Check for source changes'
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check.outputs.run_tests }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1000
- name: Check for source changes
id: check
run: |
if [ -z "$GITHUB_BASE_REF" ]; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
git fetch origin $GITHUB_BASE_REF --depth=1
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> "$GITHUB_OUTPUT" || true
fi

opensuse-tests:
name: '${{ matrix.name }} (openSUSE Leap)'
runs-on: ubuntu-latest
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
# Use a specific image version for reproducible builds
container:
image: opensuse/leap:15.6
strategy:
fail-fast: false
matrix:
include:
- name: 'Check ABI'
task: 'abi'
- name: 'Check Generated Files'
task: 'generated-files'
- name: 'Build and Test'
task: 'build-and-test'

env:
OPENSSL_VER: 1.1.1u

steps:

- name: Install Git and Tar
run: |
zypper ref
zypper -n install -y git-core tar

- uses: actions/checkout@v4

- name: Trust the checked-out workspace
# checkout configures a temporary HOME, not the HOME used by shell steps.
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Install All Dependencies
run: sh -x ./.github/posix-deps-zypp.sh

- name: 'Restore OpenSSL build'
if: matrix.task == 'build-and-test'
id: cache-openssl
uses: actions/cache@v4
with:
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
key: opensuse-leap-multissl-openssl-${{ env.OPENSSL_VER }}

# === Steps for ABI Check ===
- name: Build CPython for ABI Check
if: matrix.task == 'abi'
env:
CFLAGS: -g3 -O0
run: |
./configure --enable-shared --with-fpectl
make -j4

- name: Check for changes in the ABI
if: matrix.task == 'abi'
run: make check-abidump

# === Steps for Generated Files Check ===
- name: Build CPython for Generated Files Check
if: matrix.task == 'generated-files'
run: |
./configure --with-pydebug
make -j4 regen-all

- name: Check for changes in generated files
if: matrix.task == 'generated-files'
run: |
git status --short
git diff --exit-code

- name: Check exported libpython symbols
if: matrix.task == 'generated-files'
run: make smelly

# === Steps for Full Build and Test ===
- name: Install OpenSSL
if: matrix.task == 'build-and-test' && steps.cache-openssl.outputs.cache-hit != 'true'
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $OPENSSL_VER --system Linux

- name: Configure CPython
if: matrix.task == 'build-and-test'
run: |
autoconf -Wall
autoheader -Wall
./configure --with-pydebug --with-openssl=$PWD/multissl/openssl/$OPENSSL_VER

- name: Build CPython
if: matrix.task == 'build-and-test'
run: make -j4

- name: Display build info
if: matrix.task == 'build-and-test'
run: make pythoninfo

- name: Run tests
if: matrix.task == 'build-and-test'
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
Loading
Loading