Skip to content

Commit 288dc26

Browse files
committed
Merge branch 'main' into gh-128446
2 parents 61a087f + 808071b commit 288dc26

File tree

853 files changed

+44360
-33894
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

853 files changed

+44360
-33894
lines changed

.github/CODEOWNERS

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

77
# GitHub
8-
.github/** @ezio-melotti @hugovk
8+
.github/** @ezio-melotti @hugovk @AA-Turner
99

1010
# pre-commit
1111
.pre-commit-config.yaml @hugovk @AlexWaygood
12-
.ruff.toml @hugovk @AlexWaygood
12+
.ruff.toml @hugovk @AlexWaygood @AA-Turner
1313

1414
# Build system
1515
configure* @erlend-aasland @corona10
@@ -56,6 +56,14 @@ Tools/c-analyzer/ @ericsnowcurrently
5656
# dbm
5757
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
5858

59+
# Doc/ tools
60+
Doc/conf.py @AA-Turner @hugovk
61+
Doc/Makefile @AA-Turner @hugovk
62+
Doc/make.bat @AA-Turner @hugovk
63+
Doc/requirements.txt @AA-Turner @hugovk
64+
Doc/_static/** @AA-Turner @hugovk
65+
Doc/tools/** @AA-Turner @hugovk
66+
5967
# runtime state/lifecycle
6068
**/*pylifecycle* @ericsnowcurrently
6169
**/*pystate* @ericsnowcurrently
@@ -96,13 +104,14 @@ Doc/library/site.rst @FFY00
96104
Lib/test/test_except*.py @iritkatriel
97105
Objects/exceptions.c @iritkatriel
98106

99-
# Hashing
100-
**/*hashlib* @gpshead @tiran
107+
# Hashing & cryptographic primitives
108+
**/*hashlib* @gpshead @tiran @picnixz
101109
**/*pyhash* @gpshead @tiran
102-
**/sha* @gpshead @tiran
103-
Modules/md5* @gpshead @tiran
104-
**/*blake* @gpshead @tiran
110+
**/sha* @gpshead @tiran @picnixz
111+
Modules/md5* @gpshead @tiran @picnixz
112+
**/*blake* @gpshead @tiran @picnixz
105113
Modules/_hacl/** @gpshead
114+
**/*hmac* @gpshead @picnixz
106115

107116
# logging
108117
**/*logging* @vsajip
@@ -292,6 +301,10 @@ Lib/configparser.py @jaraco
292301
Lib/test/test_configparser.py @jaraco
293302

294303
# Doc sections
295-
Doc/reference/ @willingc
304+
Doc/reference/ @willingc @AA-Turner
296305

297306
**/*weakref* @kumaraditya303
307+
308+
# Colorize
309+
Lib/_colorize.py @hugovk
310+
Lib/test/test__colorize.py @hugovk

.github/actionlint.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
self-hosted-runner:
2-
labels: ["ubuntu-24.04-aarch64", "windows-aarch64"]
2+
labels: ["windows-aarch64"]
33

44
config-variables: null
55

66
paths:
77
.github/workflows/**/*.yml:
88
ignore:
99
- 1st argument of function call is not assignable
10-
- SC2(015|038|086|091|097|098|129|155)
10+
- SC2(015|038|086|091|097|098|129|155)

.github/workflows/build.yml

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ concurrency:
1818
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}-reusable
1919
cancel-in-progress: true
2020

21+
env:
22+
FORCE_COLOR: 1
23+
2124
jobs:
2225
check_source:
2326
name: Change detection
@@ -231,24 +234,31 @@ jobs:
231234
name: >-
232235
Ubuntu
233236
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
237+
${{ fromJSON(matrix.bolt) && '(bolt)' || '' }}
234238
needs: check_source
235239
if: needs.check_source.outputs.run_tests == 'true'
236240
strategy:
237241
matrix:
242+
bolt:
243+
- false
244+
- true
238245
free-threading:
239246
- false
240247
- true
241248
os:
242249
- ubuntu-24.04
243-
- ubuntu-24.04-aarch64
244-
is-fork: # only used for the exclusion trick
245-
- ${{ github.repository_owner != 'python' }}
250+
- ubuntu-24.04-arm
246251
exclude:
247-
- os: ubuntu-24.04-aarch64
248-
is-fork: true
252+
# Do not test BOLT with free-threading, to conserve resources
253+
- bolt: true
254+
free-threading: true
255+
# BOLT currently crashes during instrumentation on aarch64
256+
- os: ubuntu-24.04-arm
257+
bolt: true
249258
uses: ./.github/workflows/reusable-ubuntu.yml
250259
with:
251260
config_hash: ${{ needs.check_source.outputs.config_hash }}
261+
bolt-optimizations: ${{ matrix.bolt }}
252262
free-threading: ${{ matrix.free-threading }}
253263
os: ${{ matrix.os }}
254264

@@ -502,26 +512,59 @@ jobs:
502512
run: xvfb-run make ci
503513

504514
build_tsan:
505-
name: 'Thread sanitizer'
515+
name: >-
516+
Thread sanitizer
517+
${{ fromJSON(matrix.free-threading) && '(free-threading)' || '' }}
506518
needs: check_source
507519
if: needs.check_source.outputs.run_tests == 'true'
520+
strategy:
521+
matrix:
522+
free-threading:
523+
- false
524+
- true
508525
uses: ./.github/workflows/reusable-tsan.yml
509526
with:
510527
config_hash: ${{ needs.check_source.outputs.config_hash }}
511-
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
512-
suppressions_path: Tools/tsan/supressions.txt
513-
tsan_logs_artifact_name: tsan-logs-default
528+
free-threading: ${{ matrix.free-threading }}
514529

515-
build_tsan_free_threading:
516-
name: 'Thread sanitizer (free-threading)'
530+
cross-build-linux:
531+
name: Cross build Linux
532+
runs-on: ubuntu-latest
517533
needs: check_source
518534
if: needs.check_source.outputs.run_tests == 'true'
519-
uses: ./.github/workflows/reusable-tsan.yml
520-
with:
521-
config_hash: ${{ needs.check_source.outputs.config_hash }}
522-
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
523-
suppressions_path: Tools/tsan/suppressions_free_threading.txt
524-
tsan_logs_artifact_name: tsan-logs-free-threading
535+
steps:
536+
- uses: actions/checkout@v4
537+
with:
538+
persist-credentials: false
539+
- name: Runner image version
540+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
541+
- name: Restore config.cache
542+
uses: actions/cache@v4
543+
with:
544+
path: config.cache
545+
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}
546+
- name: Register gcc problem matcher
547+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
548+
- name: Set build dir
549+
run:
550+
# an absolute path outside of the working directoy
551+
echo "BUILD_DIR=$(realpath ${{ github.workspace }}/../build)" >> "$GITHUB_ENV"
552+
- name: Install Dependencies
553+
run: sudo ./.github/workflows/posix-deps-apt.sh
554+
- name: Configure host build
555+
run: ./configure --prefix="$BUILD_DIR/host-python"
556+
- name: Install host Python
557+
run: make -j8 install
558+
- name: Run test subset with host build
559+
run: |
560+
"$BUILD_DIR/host-python/bin/python3" -m test test_sysconfig test_site test_embed
561+
- name: Configure cross build
562+
run: ./configure --prefix="$BUILD_DIR/cross-python" --with-build-python="$BUILD_DIR/host-python/bin/python3"
563+
- name: Install cross Python
564+
run: make -j8 install
565+
- name: Run test subset with host build
566+
run: |
567+
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
525568
526569
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
527570
cifuzz:
@@ -581,7 +624,6 @@ jobs:
581624
- test_hypothesis
582625
- build_asan
583626
- build_tsan
584-
- build_tsan_free_threading
585627
- cifuzz
586628

587629
runs-on: ubuntu-latest
@@ -615,7 +657,6 @@ jobs:
615657
build_windows,
616658
build_asan,
617659
build_tsan,
618-
build_tsan_free_threading,
619660
'
620661
|| ''
621662
}}

.github/workflows/jit.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ concurrency:
2525
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
2626
cancel-in-progress: true
2727

28+
env:
29+
FORCE_COLOR: 1
30+
2831
jobs:
2932
interpreter:
3033
name: Interpreter (Debug)
@@ -83,8 +86,7 @@ jobs:
8386
runner: ubuntu-24.04
8487
- target: aarch64-unknown-linux-gnu/gcc
8588
architecture: aarch64
86-
# Forks don't have access to our paid AArch64 runners. These jobs are skipped below:
87-
runner: ${{ github.repository_owner == 'python' && 'ubuntu-24.04-aarch64' || 'ubuntu-24.04' }}
89+
runner: ubuntu-24.04-arm
8890
steps:
8991
- uses: actions/checkout@v4
9092
with:
@@ -123,8 +125,7 @@ jobs:
123125
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124126
125127
- name: Native Linux
126-
# Forks don't have access to our paid AArch64 runners. Skip those:
127-
if: runner.os == 'Linux' && (matrix.architecture == 'x86_64' || github.repository_owner == 'python')
128+
if: runner.os == 'Linux'
128129
run: |
129130
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
130131
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"

.github/workflows/reusable-change-detection.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,22 @@ jobs:
8888
# into the PR branch anyway.
8989
#
9090
# https://github.com/python/core-workflow/issues/373
91-
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
91+
grep_ignore_args=(
92+
# file extensions
93+
-e '\.md$'
94+
-e '\.rst$'
95+
# top-level folders
96+
-e '^Doc/'
97+
-e '^Misc/'
98+
# configuration files
99+
-e '^\.github/CODEOWNERS$'
100+
-e '^\.pre-commit-config\.yaml$'
101+
-e '\.ruff\.toml$'
102+
-e 'mypy\.ini$'
103+
)
104+
git diff --name-only "origin/$GITHUB_BASE_REF.." \
105+
| grep -qvE "${grep_ignore_args[@]}" \
106+
&& echo "run-tests=true" >> "$GITHUB_OUTPUT" || true
92107
fi
93108
94109
# Check if we should run hypothesis tests

.github/workflows/reusable-docs.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
continue-on-error: true
6666
run: |
6767
set -Eeuo pipefail
68-
# Build docs with the '-n' (nit-picky) option; write warnings to file
69-
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going -w sphinx-warnings.txt" html
68+
# Build docs with the nit-picky option; write warnings to file
69+
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
7070
- name: 'Check warnings'
7171
if: github.event_name == 'pull_request'
7272
run: |
@@ -76,26 +76,6 @@ jobs:
7676
--fail-if-improved \
7777
--fail-if-new-news-nit
7878
79-
# This build doesn't use problem matchers or check annotations
80-
build_doc_oldest_supported_sphinx:
81-
name: 'Docs (Oldest Sphinx)'
82-
runs-on: ubuntu-latest
83-
timeout-minutes: 60
84-
steps:
85-
- uses: actions/checkout@v4
86-
with:
87-
persist-credentials: false
88-
- name: 'Set up Python'
89-
uses: actions/setup-python@v5
90-
with:
91-
python-version: '3.13' # known to work with Sphinx 7.2.6
92-
cache: 'pip'
93-
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
94-
- name: 'Install build dependencies'
95-
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
96-
- name: 'Build HTML documentation'
97-
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
98-
9979
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
10080
doctest:
10181
name: 'Doctest'
@@ -121,4 +101,4 @@ jobs:
121101
run: make -C Doc/ PYTHON=../python venv
122102
# Use "xvfb-run" since some doctest tests open GUI windows
123103
- name: 'Run documentation doctest'
124-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="-W --keep-going" doctest
104+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest

.github/workflows/reusable-macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
required: true
1616
type: string
1717

18+
env:
19+
FORCE_COLOR: 1
20+
1821
jobs:
1922
build_macos:
2023
name: build and test (${{ inputs.os }})

.github/workflows/reusable-tsan.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,20 @@ on:
66
config_hash:
77
required: true
88
type: string
9-
options:
10-
required: true
11-
type: string
12-
suppressions_path:
13-
description: 'A repo relative path to the suppressions file'
14-
required: true
15-
type: string
16-
tsan_logs_artifact_name:
17-
description: 'Name of the TSAN logs artifact. Must be unique for each job.'
18-
required: true
19-
type: string
9+
free-threading:
10+
description: Whether to use free-threaded mode
11+
required: false
12+
type: boolean
13+
default: false
14+
15+
env:
16+
FORCE_COLOR: 1
2017

2118
jobs:
2219
build_tsan_reusable:
2320
name: 'Thread sanitizer'
2421
runs-on: ubuntu-24.04
2522
timeout-minutes: 60
26-
env:
27-
OPTIONS: ${{ inputs.options }}
28-
SUPPRESSIONS_PATH: ${{ inputs.suppressions_path }}
2923
steps:
3024
- uses: actions/checkout@v4
3125
with:
@@ -52,7 +46,11 @@ jobs:
5246
sudo sysctl -w vm.mmap_rnd_bits=28
5347
- name: TSAN Option Setup
5448
run: |
55-
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${SUPPRESSIONS_PATH} handle_segv=0" >> "$GITHUB_ENV"
49+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/Tools/tsan/suppressions${{
50+
fromJSON(inputs.free-threading)
51+
&& '_free_threading'
52+
|| ''
53+
}}.txt handle_segv=0" >> "$GITHUB_ENV"
5654
echo "CC=clang" >> "$GITHUB_ENV"
5755
echo "CXX=clang++" >> "$GITHUB_ENV"
5856
- name: Add ccache to PATH
@@ -64,7 +62,12 @@ jobs:
6462
save: ${{ github.event_name == 'push' }}
6563
max-size: "200M"
6664
- name: Configure CPython
67-
run: "${OPTIONS}"
65+
run: >-
66+
./configure
67+
--config-cache
68+
--with-thread-sanitizer
69+
--with-pydebug
70+
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
6871
- name: Build CPython
6972
run: make -j4
7073
- name: Display build info
@@ -78,6 +81,11 @@ jobs:
7881
if: always()
7982
uses: actions/upload-artifact@v4
8083
with:
81-
name: ${{ inputs.tsan_logs_artifact_name }}
84+
name: >-
85+
tsan-logs-${{
86+
fromJSON(inputs.free-threading)
87+
&& 'free-threading'
88+
|| 'default'
89+
}}
8290
path: tsan_log.*
8391
if-no-files-found: ignore

0 commit comments

Comments
 (0)