Skip to content

Commit c653873

Browse files
committed
Merge branch 'main' into intern-dataclass-field-names
2 parents ec25382 + 5b941e5 commit c653873

File tree

1,077 files changed

+48103
-17414
lines changed

Some content is hidden

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

1,077 files changed

+48103
-17414
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/library/fedora:37
1+
FROM docker.io/library/fedora:40
22

33
ENV CC=clang
44

.github/CODEOWNERS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,18 @@ Lib/test/support/interpreters/ @ericsnowcurrently
243243
Modules/_xx*interp*module.c @ericsnowcurrently
244244
Lib/test/test_interpreters/ @ericsnowcurrently
245245

246+
# Android
247+
**/*Android* @mhsmith
248+
**/*android* @mhsmith
249+
250+
# iOS (but not termios)
251+
**/iOS* @freakboy3742
252+
**/ios* @freakboy3742
253+
**/*_iOS* @freakboy3742
254+
**/*_ios* @freakboy3742
255+
**/*-iOS* @freakboy3742
256+
**/*-ios* @freakboy3742
257+
246258
# WebAssembly
247259
/Tools/wasm/ @brettcannon
248260

.github/workflows/build.yml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,11 @@ on:
88
push:
99
branches:
1010
- 'main'
11-
- '3.12'
12-
- '3.11'
13-
- '3.10'
14-
- '3.9'
15-
- '3.8'
11+
- '3.*'
1612
pull_request:
1713
branches:
1814
- 'main'
19-
- '3.12'
20-
- '3.11'
21-
- '3.10'
22-
- '3.9'
23-
- '3.8'
15+
- '3.*'
2416

2517
permissions:
2618
contents: read
@@ -137,6 +129,7 @@ jobs:
137129
uses: actions/cache@v4
138130
with:
139131
path: config.cache
132+
# Include env.pythonLocation in key to avoid changes in environment when setup-python updates Python
140133
key: ${{ github.job }}-${{ runner.os }}-${{ env.IMAGE_VERSION }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
141134
- name: Install Dependencies
142135
run: sudo ./.github/workflows/posix-deps-apt.sh
@@ -217,7 +210,7 @@ jobs:
217210
with:
218211
config_hash: ${{ needs.check_source.outputs.config_hash }}
219212
free-threading: true
220-
# macos-14 is M1
213+
# macos-14-large is Intel with 12 cores (most parallelism)
221214
os-matrix: '["macos-14"]'
222215

223216
build_ubuntu:
@@ -249,7 +242,7 @@ jobs:
249242
250243
build_ubuntu_ssltests:
251244
name: 'Ubuntu SSL tests with OpenSSL'
252-
runs-on: ubuntu-20.04
245+
runs-on: ubuntu-22.04
253246
timeout-minutes: 60
254247
needs: check_source
255248
if: needs.check_source.outputs.run_tests == 'true'
@@ -315,7 +308,7 @@ jobs:
315308

316309
test_hypothesis:
317310
name: "Hypothesis tests on Ubuntu"
318-
runs-on: ubuntu-20.04
311+
runs-on: ubuntu-22.04
319312
timeout-minutes: 60
320313
needs: check_source
321314
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
@@ -428,7 +421,7 @@ jobs:
428421

429422
build_asan:
430423
name: 'Address sanitizer'
431-
runs-on: ubuntu-20.04
424+
runs-on: ubuntu-22.04
432425
timeout-minutes: 60
433426
needs: check_source
434427
if: needs.check_source.outputs.run_tests == 'true'
@@ -492,6 +485,8 @@ jobs:
492485
with:
493486
config_hash: ${{ needs.check_source.outputs.config_hash }}
494487
options: ./configure --config-cache --with-thread-sanitizer --with-pydebug
488+
suppressions_path: Tools/tsan/supressions.txt
489+
tsan_logs_artifact_name: tsan-logs-default
495490

496491
build_tsan_free_threading:
497492
name: 'Thread sanitizer (free-threading)'
@@ -501,6 +496,8 @@ jobs:
501496
with:
502497
config_hash: ${{ needs.check_source.outputs.config_hash }}
503498
options: ./configure --config-cache --disable-gil --with-thread-sanitizer --with-pydebug
499+
suppressions_path: Tools/tsan/suppressions_free_threading.txt
500+
tsan_logs_artifact_name: tsan-logs-free-threading
504501

505502
# CIFuzz job based on https://google.github.io/oss-fuzz/getting-started/continuous-integration/
506503
cifuzz:

.github/workflows/jit.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- 'Python/optimizer*.c'
1313
workflow_dispatch:
1414

15+
permissions:
16+
contents: read
17+
1518
concurrency:
1619
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1720
cancel-in-progress: true
@@ -20,7 +23,7 @@ jobs:
2023
jit:
2124
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
2225
runs-on: ${{ matrix.runner }}
23-
timeout-minutes: 75
26+
timeout-minutes: 90
2427
strategy:
2528
fail-fast: false
2629
matrix:
@@ -38,7 +41,7 @@ jobs:
3841
- true
3942
- false
4043
llvm:
41-
- 16
44+
- 18
4245
include:
4346
- target: i686-pc-windows-msvc/msvc
4447
architecture: Win32
@@ -72,14 +75,10 @@ jobs:
7275
architecture: aarch64
7376
runner: ubuntu-latest
7477
compiler: gcc
75-
# These fail because of emulation, not because of the JIT:
76-
exclude: test_unix_events test_init test_process_pool test_shutdown test_multiprocessing_fork test_cmd_line test_faulthandler test_os test_perf_profiler test_posix test_signal test_socket test_subprocess test_threading test_venv test_external_inspection
7778
- target: aarch64-unknown-linux-gnu/clang
7879
architecture: aarch64
7980
runner: ubuntu-latest
8081
compiler: clang
81-
# These fail because of emulation, not because of the JIT:
82-
exclude: test_unix_events test_init test_process_pool test_shutdown test_multiprocessing_fork test_cmd_line test_faulthandler test_os test_perf_profiler test_posix test_signal test_socket test_subprocess test_threading test_venv test_external_inspection
8382
env:
8483
CC: ${{ matrix.compiler }}
8584
steps:
@@ -91,37 +90,43 @@ jobs:
9190
- name: Native Windows
9291
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
9392
run: |
93+
choco upgrade llvm -y
9494
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
9595
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
96-
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
96+
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
9797
9898
# No PGO or tests (yet):
9999
- name: Emulated Windows
100100
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
101101
run: |
102+
choco upgrade llvm -y
102103
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
103104
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
104105
105106
- name: Native macOS
106107
if: runner.os == 'macOS'
107108
run: |
109+
brew update
108110
brew install llvm@${{ matrix.llvm }}
109111
SDKROOT="$(xcrun --show-sdk-path)" \
110112
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
111113
make all --jobs 4
112-
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
114+
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
113115
116+
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
114117
- name: Native Linux
115118
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
116119
run: |
117120
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
118121
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
119-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
122+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations' }}
120123
make all --jobs 4
121-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
124+
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
122125
126+
# --with-lto has been removed temporarily as a result of an open issue in LLVM 18 (see https://github.com/llvm/llvm-project/issues/87553)
123127
- name: Emulated Linux
124128
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
129+
# The --ignorefile on ./python -m test is used to exclude tests known to fail when running on an emulated Linux.
125130
run: |
126131
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
127132
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
@@ -136,6 +141,6 @@ jobs:
136141
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
137142
CPP="$CC --preprocess" \
138143
HOSTRUNNER=qemu-${{ matrix.architecture }} \
139-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
144+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations ' }} --build=x86_64-linux-gnu --host="$HOST" --with-build-python=../build/bin/python3 --with-pkg-config=no ac_cv_buggy_getaddrinfo=no ac_cv_file__dev_ptc=no ac_cv_file__dev_ptmx=yes
140145
make all --jobs 4
141-
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 4500 --verbose2 --verbose3
146+
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/mypy.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
pull_request:
99
paths:
1010
- ".github/workflows/mypy.yml"
11+
- "Lib/_pyrepl/**"
1112
- "Lib/test/libregrtest/**"
1213
- "Tools/build/generate_sbom.py"
1314
- "Tools/cases_generator/**"
@@ -35,8 +36,9 @@ jobs:
3536
strategy:
3637
matrix:
3738
target: [
39+
"Lib/_pyrepl",
3840
"Lib/test/libregrtest",
39-
"Tools/build/",
41+
"Tools/build",
4042
"Tools/cases_generator",
4143
"Tools/clinic",
4244
"Tools/jit",

.github/workflows/posix-deps-apt.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ apt-get -yq install \
1515
libgdbm-dev \
1616
libgdbm-compat-dev \
1717
liblzma-dev \
18+
libmpdec-dev \
1819
libncurses5-dev \
1920
libreadline6-dev \
2021
libsqlite3-dev \

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
- name: 'Set up Python'
7575
uses: actions/setup-python@v5
7676
with:
77-
python-version: '3.11' # known to work with Sphinx 4.2
77+
python-version: '3.12' # known to work with Sphinx 6.2.1
7878
cache: 'pip'
7979
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
8080
- name: 'Install build dependencies'

.github/workflows/reusable-macos.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
HOMEBREW_NO_INSTALL_CLEANUP: 1
2323
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
2424
PYTHONSTRICTEXTENSIONBUILD: 1
25+
TERM: linux
2526
strategy:
2627
fail-fast: false
2728
matrix:
@@ -49,7 +50,7 @@ jobs:
4950
--prefix=/opt/python-dev \
5051
--with-openssl="$(brew --prefix [email protected])"
5152
- name: Build CPython
52-
run: make -j4
53+
run: make -j8
5354
- name: Display build info
5455
run: make pythoninfo
5556
- name: Tests

.github/workflows/reusable-tsan.yml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
options:
88
required: true
99
type: string
10+
suppressions_path:
11+
description: 'A repo relative path to the suppressions file'
12+
required: true
13+
type: string
14+
tsan_logs_artifact_name:
15+
description: 'Name of the TSAN logs artifact. Must be unique for each job.'
16+
required: true
17+
type: string
1018

1119
jobs:
1220
build_tsan_reusable:
@@ -25,12 +33,19 @@ jobs:
2533
- name: Install Dependencies
2634
run: |
2735
sudo ./.github/workflows/posix-deps-apt.sh
28-
sudo apt install -y clang
36+
# Install clang-18
37+
wget https://apt.llvm.org/llvm.sh
38+
chmod +x llvm.sh
39+
sudo ./llvm.sh 18
40+
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-18 100
41+
sudo update-alternatives --set clang /usr/bin/clang-18
42+
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-18 100
43+
sudo update-alternatives --set clang++ /usr/bin/clang++-18
2944
# Reduce ASLR to avoid TSAN crashing
3045
sudo sysctl -w vm.mmap_rnd_bits=28
3146
- name: TSAN Option Setup
3247
run: |
33-
echo "TSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/Tools/tsan/supressions.txt" >> $GITHUB_ENV
48+
echo "TSAN_OPTIONS=log_path=${GITHUB_WORKSPACE}/tsan_log suppressions=${GITHUB_WORKSPACE}/${{ inputs.suppressions_path }} handle_segv=0" >> $GITHUB_ENV
3449
echo "CC=clang" >> $GITHUB_ENV
3550
echo "CXX=clang++" >> $GITHUB_ENV
3651
- name: Add ccache to PATH
@@ -49,3 +64,13 @@ jobs:
4964
run: make pythoninfo
5065
- name: Tests
5166
run: ./python -m test --tsan -j4
67+
- name: Display TSAN logs
68+
if: always()
69+
run: find ${GITHUB_WORKSPACE} -name 'tsan_log.*' | xargs head -n 1000
70+
- name: Archive TSAN logs
71+
if: always()
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: ${{ inputs.tsan_logs_artifact_name }}
75+
path: tsan_log.*
76+
if-no-files-found: ignore

.github/workflows/reusable-ubuntu.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,12 @@ jobs:
1212
build_ubuntu_reusable:
1313
name: 'build and test'
1414
timeout-minutes: 60
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
env:
17+
FORCE_COLOR: 1
1718
OPENSSL_VER: 3.0.13
1819
PYTHONSTRICTEXTENSIONBUILD: 1
20+
TERM: linux
1921
steps:
2022
- uses: actions/checkout@v4
2123
- name: Register gcc problem matcher

0 commit comments

Comments
 (0)