Skip to content

Commit

Permalink
Merge branch 'main' into port-marshal-to-pep757/127936
Browse files Browse the repository at this point in the history
  • Loading branch information
skirpichev authored Jan 23, 2025
2 parents 9353013 + 1d485db commit 82cb784
Show file tree
Hide file tree
Showing 582 changed files with 30,472 additions and 27,778 deletions.
29 changes: 21 additions & 8 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
# https://git-scm.com/docs/gitignore#_pattern_format

# GitHub
.github/** @ezio-melotti @hugovk
.github/** @ezio-melotti @hugovk @AA-Turner

# pre-commit
.pre-commit-config.yaml @hugovk @AlexWaygood
.ruff.toml @hugovk @AlexWaygood
.ruff.toml @hugovk @AlexWaygood @AA-Turner

# Build system
configure* @erlend-aasland @corona10
Expand Down Expand Up @@ -56,6 +56,14 @@ Tools/c-analyzer/ @ericsnowcurrently
# dbm
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka

# Doc/ tools
Doc/conf.py @AA-Turner @hugovk
Doc/Makefile @AA-Turner @hugovk
Doc/make.bat @AA-Turner @hugovk
Doc/requirements.txt @AA-Turner @hugovk
Doc/_static/** @AA-Turner @hugovk
Doc/tools/** @AA-Turner @hugovk

# runtime state/lifecycle
**/*pylifecycle* @ericsnowcurrently
**/*pystate* @ericsnowcurrently
Expand Down Expand Up @@ -96,13 +104,14 @@ Doc/library/site.rst @FFY00
Lib/test/test_except*.py @iritkatriel
Objects/exceptions.c @iritkatriel

# Hashing
**/*hashlib* @gpshead @tiran
# Hashing & cryptographic primitives
**/*hashlib* @gpshead @tiran @picnixz
**/*pyhash* @gpshead @tiran
**/sha* @gpshead @tiran
Modules/md5* @gpshead @tiran
**/*blake* @gpshead @tiran
**/sha* @gpshead @tiran @picnixz
Modules/md5* @gpshead @tiran @picnixz
**/*blake* @gpshead @tiran @picnixz
Modules/_hacl/** @gpshead
**/*hmac* @gpshead @picnixz

# logging
**/*logging* @vsajip
Expand Down Expand Up @@ -292,6 +301,10 @@ Lib/configparser.py @jaraco
Lib/test/test_configparser.py @jaraco

# Doc sections
Doc/reference/ @willingc
Doc/reference/ @willingc @AA-Turner

**/*weakref* @kumaraditya303

# Colorize
Lib/_colorize.py @hugovk
Lib/test/test__colorize.py @hugovk
4 changes: 2 additions & 2 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
self-hosted-runner:
labels: ["ubuntu-24.04-aarch64", "windows-aarch64"]
labels: ["windows-aarch64"]

config-variables: null

paths:
.github/workflows/**/*.yml:
ignore:
- 1st argument of function call is not assignable
- SC2(015|038|086|091|097|098|129|155)
- SC2(015|038|086|091|097|098|129|155)
20 changes: 15 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
check_source:
name: Change detection
Expand Down Expand Up @@ -231,24 +234,31 @@ jobs:
name: >-
Ubuntu
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
needs: check_source
if: needs.check_source.outputs.run_tests == 'true'
strategy:
matrix:
bolt:
- false
- true
free-threading:
- false
- true
os:
- ubuntu-24.04
- ubuntu-24.04-aarch64
is-fork: # only used for the exclusion trick
- ${{ github.repository_owner != 'python' }}
- ubuntu-24.04-arm
exclude:
- os: ubuntu-24.04-aarch64
is-fork: true
# Do not test BOLT with free-threading, to conserve resources
- bolt: true
free-threading: true
# BOLT currently crashes during instrumentation on aarch64
- os: ubuntu-24.04-arm
bolt: true
uses: ./.github/workflows/reusable-ubuntu.yml
with:
config_hash: ${{ needs.check_source.outputs.config_hash }}
bolt-optimizations: ${{ matrix.bolt }}
free-threading: ${{ matrix.free-threading }}
os: ${{ matrix.os }}

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/jit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
FORCE_COLOR: 1

jobs:
interpreter:
name: Interpreter (Debug)
Expand Down Expand Up @@ -83,8 +86,7 @@ jobs:
runner: ubuntu-24.04
- target: aarch64-unknown-linux-gnu/gcc
architecture: aarch64
# Forks don't have access to our paid AArch64 runners. These jobs are skipped below:
runner: ${{ github.repository_owner == 'python' && 'ubuntu-24.04-aarch64' || 'ubuntu-24.04' }}
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -123,8 +125,7 @@ jobs:
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
- name: Native Linux
# Forks don't have access to our paid AArch64 runners. Skip those:
if: runner.os == 'Linux' && (matrix.architecture == 'x86_64' || github.repository_owner == 'python')
if: runner.os == 'Linux'
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/reusable-change-detection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,22 @@ jobs:
# into the PR branch anyway.
#
# https://github.com/python/core-workflow/issues/373
git diff --name-only "origin/$GITHUB_BASE_REF.." | grep -qvE '(\.rst$|^Doc|^Misc|^\.pre-commit-config\.yaml$|\.ruff\.toml$|\.md$|mypy\.ini$)' && echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
grep_ignore_args=(
# file extensions
-e '\.md$'
-e '\.rst$'
# top-level folders
-e '^Doc/'
-e '^Misc/'
# configuration files
-e '^\.github/CODEOWNERS$'
-e '^\.pre-commit-config\.yaml$'
-e '\.ruff\.toml$'
-e 'mypy\.ini$'
)
git diff --name-only "origin/$GITHUB_BASE_REF.." \
| grep -qvE "${grep_ignore_args[@]}" \
&& echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
fi
# Check if we should run hypothesis tests
Expand Down
26 changes: 3 additions & 23 deletions .github/workflows/reusable-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ jobs:
continue-on-error: true
run: |
set -Eeuo pipefail
# Build docs with the '-n' (nit-picky) option; write warnings to file
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going -w sphinx-warnings.txt" html
# Build docs with the nit-picky option; write warnings to file
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
- name: 'Check warnings'
if: github.event_name == 'pull_request'
run: |
Expand All @@ -76,26 +76,6 @@ jobs:
--fail-if-improved \
--fail-if-new-news-nit
# This build doesn't use problem matchers or check annotations
build_doc_oldest_supported_sphinx:
name: 'Docs (Oldest Sphinx)'
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: 'Set up Python'
uses: actions/setup-python@v5
with:
python-version: '3.13' # known to work with Sphinx 7.2.6
cache: 'pip'
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
- name: 'Install build dependencies'
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
- name: 'Build HTML documentation'
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html

# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
doctest:
name: 'Doctest'
Expand All @@ -121,4 +101,4 @@ jobs:
run: make -C Doc/ PYTHON=../python venv
# Use "xvfb-run" since some doctest tests open GUI windows
- name: 'Run documentation doctest'
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest
3 changes: 3 additions & 0 deletions .github/workflows/reusable-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ on:
required: true
type: string

env:
FORCE_COLOR: 1

jobs:
build_macos:
name: build and test (${{ inputs.os }})
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-tsan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ on:
required: true
type: string

env:
FORCE_COLOR: 1

jobs:
build_tsan_reusable:
name: 'Thread sanitizer'
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/reusable-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ on:
config_hash:
required: true
type: string
bolt-optimizations:
description: Whether to enable BOLT optimizations
required: false
type: boolean
default: false
free-threading:
description: Whether to use free-threaded mode
required: false
Expand All @@ -16,13 +21,15 @@ on:
required: true
type: string

env:
FORCE_COLOR: 1

jobs:
build_ubuntu_reusable:
name: build and test (${{ inputs.os }})
timeout-minutes: 60
runs-on: ${{ inputs.os }}
env:
FORCE_COLOR: 1
OPENSSL_VER: 3.0.15
PYTHONSTRICTEXTENSIONBUILD: 1
TERM: linux
Expand All @@ -34,6 +41,12 @@ jobs:
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
- name: Install dependencies
run: sudo ./.github/workflows/posix-deps-apt.sh
- name: Install Clang and BOLT
if: ${{ fromJSON(inputs.bolt-optimizations) }}
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh 19
sudo apt-get install bolt-19
echo PATH="$(llvm-config-19 --bindir):$PATH" >> $GITHUB_ENV
- name: Configure OpenSSL env vars
run: |
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
Expand Down Expand Up @@ -73,14 +86,18 @@ jobs:
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ inputs.config_hash }}
- name: Configure CPython out-of-tree
working-directory: ${{ env.CPYTHON_BUILDDIR }}
# `test_unpickle_module_race` writes to the source directory, which is
# read-only during builds — so we exclude it from profiling with BOLT.
run: >-
PROFILE_TASK='-m test --pgo --ignore test_unpickle_module_race'
../cpython-ro-srcdir/configure
--config-cache
--with-pydebug
--enable-slower-safety
--enable-safety
--with-openssl="$OPENSSL_DIR"
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
${{ fromJSON(inputs.bolt-optimizations) && '--enable-bolt' || '' }}
- name: Build CPython out-of-tree
if: ${{ inputs.free-threading }}
working-directory: ${{ env.CPYTHON_BUILDDIR }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-wasi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
required: true
type: string

env:
FORCE_COLOR: 1

jobs:
build_wasi_reusable:
name: 'build and test'
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/reusable-windows-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ on:
permissions:
contents: read

env:
FORCE_COLOR: 1

jobs:
build:
name: installer for ${{ inputs.arch }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
default: false

env:
FORCE_COLOR: 1
IncludeUwp: >-
true
Expand Down
10 changes: 4 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.2
rev: v0.9.1
hooks:
- id: ruff
name: Run Ruff (lint) on Doc/
Expand Down Expand Up @@ -29,12 +29,10 @@ repos:
- id: black
name: Run Black on Tools/build/check_warnings.py
files: ^Tools/build/check_warnings.py
language_version: python3.12
args: [--line-length=79]
- id: black
name: Run Black on Tools/jit/
files: ^Tools/jit/
language_version: python3.12

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
Expand All @@ -51,19 +49,19 @@ repos:
types_or: [c, inc, python, rst]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.30.0
rev: 0.31.0
hooks:
- id: check-dependabot
- id: check-github-workflows
- id: check-readthedocs

- repo: https://github.com/rhysd/actionlint
rev: v1.7.4
rev: v1.7.7
hooks:
- id: actionlint

- repo: https://github.com/woodruffw/zizmor-pre-commit
rev: v0.8.0
rev: v1.1.1
hooks:
- id: zizmor

Expand Down
Loading

0 comments on commit 82cb784

Please sign in to comment.