Skip to content

Commit a506cbe

Browse files
authored
Merge branch 'main' into exec_doco
2 parents d339d8f + 9d6366b commit a506cbe

File tree

852 files changed

+20475
-8011
lines changed

Some content is hidden

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

852 files changed

+20475
-8011
lines changed

.azure-pipelines/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
displayName: Pre-build checks
66

77
pool:
8-
vmImage: ubuntu-22.04
8+
vmImage: ubuntu-24.04
99

1010
steps:
1111
- template: ./prebuild-checks.yml

.github/CODEOWNERS

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ configure* @erlend-aasland @corona10
1616
Makefile.pre.in @erlend-aasland
1717
Modules/Setup* @erlend-aasland
1818

19+
# argparse
20+
**/*argparse* @savannahostrowski
21+
1922
# asyncio
20-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
23+
**/*asyncio* @1st1 @asvetlov @kumaraditya303 @willingc
2124

2225
# Core
2326
**/*context* @1st1
2427
**/*genobject* @markshannon
2528
**/*hamt* @1st1
26-
**/*jit* @brandtbucher
29+
**/*jit* @brandtbucher @savannahostrowski
2730
Objects/set* @rhettinger
2831
Objects/dict* @methane @markshannon
2932
Objects/typevarobject.c @JelleZijlstra
@@ -88,7 +91,6 @@ Objects/exceptions.c @iritkatriel
8891
**/sha* @gpshead @tiran
8992
Modules/md5* @gpshead @tiran
9093
**/*blake* @gpshead @tiran
91-
Modules/_blake2/** @gpshead @tiran
9294
Modules/_hacl/** @gpshead
9395

9496
# logging
@@ -255,8 +257,8 @@ Modules/_interp*module.c @ericsnowcurrently
255257
Lib/test/test_interpreters/ @ericsnowcurrently
256258

257259
# Android
258-
**/*Android* @mhsmith
259-
**/*android* @mhsmith
260+
**/*Android* @mhsmith @freakboy3742
261+
**/*android* @mhsmith @freakboy3742
260262

261263
# iOS (but not termios)
262264
**/iOS* @freakboy3742
@@ -267,7 +269,7 @@ Lib/test/test_interpreters/ @ericsnowcurrently
267269
**/*-ios* @freakboy3742
268270

269271
# WebAssembly
270-
/Tools/wasm/ @brettcannon
272+
/Tools/wasm/ @brettcannon @freakboy3742
271273

272274
# SBOM
273275
/Misc/externals.spdx.json @sethmlarson
@@ -281,4 +283,4 @@ Lib/test/test_configparser.py @jaraco
281283
# Doc sections
282284
Doc/reference/ @willingc
283285

284-
**/*weakref* @kumaraditya303
286+
**/*weakref* @kumaraditya303

.github/workflows/build.yml

Lines changed: 85 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,55 @@ jobs:
4040
if: fromJSON(needs.check_source.outputs.run-docs)
4141
uses: ./.github/workflows/reusable-docs.yml
4242

43+
check_autoconf_regen:
44+
name: 'Check if Autoconf files are up to date'
45+
# Don't use ubuntu-latest but a specific version to make the job
46+
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47+
runs-on: ubuntu-24.04
48+
container:
49+
image: ghcr.io/python/autoconf:2024.11.11.11786316759
50+
timeout-minutes: 60
51+
needs: check_source
52+
if: needs.check_source.outputs.run_tests == 'true'
53+
steps:
54+
- name: Install Git
55+
run: |
56+
apt install git -yq
57+
git config --global --add safe.directory "$GITHUB_WORKSPACE"
58+
- uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 1
61+
- name: Runner image version
62+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
63+
- name: Check Autoconf and aclocal versions
64+
run: |
65+
grep "Generated by GNU Autoconf 2.71" configure
66+
grep "aclocal 1.16.5" aclocal.m4
67+
grep -q "runstatedir" configure
68+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
69+
- name: Regenerate autoconf files
70+
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
71+
run: autoreconf -ivf -Werror
72+
- name: Check for changes
73+
run: |
74+
git add -u
75+
changes=$(git status --porcelain)
76+
# Check for changes in regenerated files
77+
if test -n "$changes"; then
78+
echo "Generated files not up to date."
79+
echo "Perhaps you forgot to run make regen-configure ;)"
80+
echo "configure files must be regenerated with a specific version of autoconf."
81+
echo "$changes"
82+
echo ""
83+
git diff --staged || true
84+
exit 1
85+
fi
86+
4387
check_generated_files:
4488
name: 'Check if generated files are up to date'
4589
# Don't use ubuntu-latest but a specific version to make the job
4690
# reproducible: to get the same tools versions (autoconf, aclocal, ...)
47-
runs-on: ubuntu-22.04
91+
runs-on: ubuntu-24.04
4892
timeout-minutes: 60
4993
needs: check_source
5094
if: needs.check_source.outputs.run_tests == 'true'
@@ -54,7 +98,7 @@ jobs:
5498
with:
5599
python-version: '3.x'
56100
- name: Runner image version
57-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
101+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
58102
- name: Restore config.cache
59103
uses: actions/cache@v4
60104
with:
@@ -64,24 +108,15 @@ jobs:
64108
- name: Install Dependencies
65109
run: sudo ./.github/workflows/posix-deps-apt.sh
66110
- name: Add ccache to PATH
67-
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
111+
run: echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
68112
- name: Configure ccache action
69113
uses: hendrikmuhs/ccache-action@v1.2
70114
with:
71115
save: false
72-
- name: Check Autoconf and aclocal versions
73-
run: |
74-
grep "Generated by GNU Autoconf 2.71" configure
75-
grep "aclocal 1.16.5" aclocal.m4
76-
grep -q "runstatedir" configure
77-
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
78116
- name: Configure CPython
79117
run: |
80118
# Build Python with the libpython dynamic library
81119
./configure --config-cache --with-pydebug --enable-shared
82-
- name: Regenerate autoconf files
83-
# Same command used by Tools/build/regen-configure.sh ($AUTORECONF)
84-
run: autoreconf -ivf -Werror
85120
- name: Build CPython
86121
run: |
87122
make -j4 regen-all
@@ -202,7 +237,7 @@ jobs:
202237
strategy:
203238
fail-fast: false
204239
matrix:
205-
os: [ubuntu-22.04]
240+
os: [ubuntu-24.04]
206241
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
207242
env:
208243
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -212,7 +247,7 @@ jobs:
212247
steps:
213248
- uses: actions/checkout@v4
214249
- name: Runner image version
215-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
250+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
216251
- name: Restore config.cache
217252
uses: actions/cache@v4
218253
with:
@@ -224,9 +259,9 @@ jobs:
224259
run: sudo ./.github/workflows/posix-deps-apt.sh
225260
- name: Configure OpenSSL env vars
226261
run: |
227-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
228-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
229-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
262+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
263+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
264+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
230265
- name: 'Restore OpenSSL build'
231266
id: cache-openssl
232267
uses: actions/cache@v4
@@ -235,16 +270,16 @@ jobs:
235270
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
236271
- name: Install OpenSSL
237272
if: steps.cache-openssl.outputs.cache-hit != 'true'
238-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
273+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
239274
- name: Add ccache to PATH
240275
run: |
241-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
276+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
242277
- name: Configure ccache action
243278
uses: hendrikmuhs/ccache-action@v1.2
244279
with:
245280
save: false
246281
- name: Configure CPython
247-
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl=$OPENSSL_DIR
282+
run: ./configure CFLAGS="-fdiagnostics-format=json" --config-cache --enable-slower-safety --with-pydebug --with-openssl="$OPENSSL_DIR"
248283
- name: Build CPython
249284
run: make -j4
250285
- name: Display build info
@@ -262,7 +297,7 @@ jobs:
262297

263298
test_hypothesis:
264299
name: "Hypothesis tests on Ubuntu"
265-
runs-on: ubuntu-22.04
300+
runs-on: ubuntu-24.04
266301
timeout-minutes: 60
267302
needs: check_source
268303
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
@@ -277,9 +312,9 @@ jobs:
277312
run: sudo ./.github/workflows/posix-deps-apt.sh
278313
- name: Configure OpenSSL env vars
279314
run: |
280-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
281-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
282-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
315+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
316+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
317+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
283318
- name: 'Restore OpenSSL build'
284319
id: cache-openssl
285320
uses: actions/cache@v4
@@ -288,24 +323,24 @@ jobs:
288323
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
289324
- name: Install OpenSSL
290325
if: steps.cache-openssl.outputs.cache-hit != 'true'
291-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
326+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
292327
- name: Add ccache to PATH
293328
run: |
294-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
329+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
295330
- name: Configure ccache action
296331
uses: hendrikmuhs/ccache-action@v1.2
297332
with:
298333
save: false
299334
- name: Setup directory envs for out-of-tree builds
300335
run: |
301-
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
302-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
336+
echo "CPYTHON_RO_SRCDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-ro-srcdir)" >> "$GITHUB_ENV"
337+
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
303338
- name: Create directories for read-only out-of-tree builds
304-
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
339+
run: mkdir -p "$CPYTHON_RO_SRCDIR" "$CPYTHON_BUILDDIR"
305340
- name: Bind mount sources read-only
306-
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
341+
run: sudo mount --bind -o ro "$GITHUB_WORKSPACE" "$CPYTHON_RO_SRCDIR"
307342
- name: Runner image version
308-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
343+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
309344
- name: Restore config.cache
310345
uses: actions/cache@v4
311346
with:
@@ -318,7 +353,7 @@ jobs:
318353
--config-cache \
319354
--with-pydebug \
320355
--enable-slower-safety \
321-
--with-openssl=$OPENSSL_DIR
356+
--with-openssl="$OPENSSL_DIR"
322357
- name: Build CPython out-of-tree
323358
working-directory: ${{ env.CPYTHON_BUILDDIR }}
324359
run: make -j4
@@ -327,18 +362,18 @@ jobs:
327362
run: make pythoninfo
328363
- name: Remount sources writable for tests
329364
# some tests write to srcdir, lack of pyc files slows down testing
330-
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
365+
run: sudo mount "$CPYTHON_RO_SRCDIR" -oremount,rw
331366
- name: Setup directory envs for out-of-tree builds
332367
run: |
333-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
368+
echo "CPYTHON_BUILDDIR=$(realpath -m "${GITHUB_WORKSPACE}"/../cpython-builddir)" >> "$GITHUB_ENV"
334369
- name: "Create hypothesis venv"
335370
working-directory: ${{ env.CPYTHON_BUILDDIR }}
336371
run: |
337372
VENV_LOC=$(realpath -m .)/hypovenv
338373
VENV_PYTHON=$VENV_LOC/bin/python
339-
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
340-
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
341-
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt
374+
echo "HYPOVENV=${VENV_LOC}" >> "$GITHUB_ENV"
375+
echo "VENV_PYTHON=${VENV_PYTHON}" >> "$GITHUB_ENV"
376+
./python -m venv "$VENV_LOC" && "$VENV_PYTHON" -m pip install -r "${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt"
342377
- name: 'Restore Hypothesis database'
343378
id: cache-hypothesis-database
344379
uses: actions/cache@v4
@@ -376,18 +411,21 @@ jobs:
376411

377412
build_asan:
378413
name: 'Address sanitizer'
379-
runs-on: ubuntu-22.04
414+
runs-on: ${{ matrix.os }}
380415
timeout-minutes: 60
381416
needs: check_source
382417
if: needs.check_source.outputs.run_tests == 'true'
418+
strategy:
419+
matrix:
420+
os: [ubuntu-24.04]
383421
env:
384422
OPENSSL_VER: 3.0.15
385423
PYTHONSTRICTEXTENSIONBUILD: 1
386424
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
387425
steps:
388426
- uses: actions/checkout@v4
389427
- name: Runner image version
390-
run: echo "IMAGE_VERSION=${ImageVersion}" >> $GITHUB_ENV
428+
run: echo "IMAGE_VERSION=${ImageVersion}" >> "$GITHUB_ENV"
391429
- name: Restore config.cache
392430
uses: actions/cache@v4
393431
with:
@@ -403,9 +441,9 @@ jobs:
403441
version: 10
404442
- name: Configure OpenSSL env vars
405443
run: |
406-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
407-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
408-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
444+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> "$GITHUB_ENV"
445+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> "$GITHUB_ENV"
446+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> "$GITHUB_ENV"
409447
- name: 'Restore OpenSSL build'
410448
id: cache-openssl
411449
uses: actions/cache@v4
@@ -414,10 +452,10 @@ jobs:
414452
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
415453
- name: Install OpenSSL
416454
if: steps.cache-openssl.outputs.cache-hit != 'true'
417-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
455+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory "$MULTISSL_DIR" --openssl "$OPENSSL_VER" --system Linux
418456
- name: Add ccache to PATH
419457
run: |
420-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
458+
echo "PATH=/usr/lib/ccache:$PATH" >> "$GITHUB_ENV"
421459
- name: Configure ccache action
422460
uses: hendrikmuhs/ccache-action@v1.2
423461
with:
@@ -430,7 +468,7 @@ jobs:
430468
- name: Display build info
431469
run: make pythoninfo
432470
- name: Tests
433-
run: xvfb-run make test
471+
run: xvfb-run make ci
434472

435473
build_tsan:
436474
name: 'Thread sanitizer'
@@ -501,6 +539,7 @@ jobs:
501539
needs:
502540
- check_source # Transitive dependency, needed to access `run_tests` value
503541
- check-docs
542+
- check_autoconf_regen
504543
- check_generated_files
505544
- build_macos
506545
- build_ubuntu
@@ -536,6 +575,7 @@ jobs:
536575
${{
537576
needs.check_source.outputs.run_tests != 'true'
538577
&& '
578+
check_autoconf_regen,
539579
check_generated_files,
540580
build_macos,
541581
build_ubuntu,

0 commit comments

Comments
 (0)