Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 24e087b

Browse files
committed
Merge
2 parents e6acc2e + 0a6e1a4 commit 24e087b

File tree

647 files changed

+22167
-7138
lines changed

Some content is hidden

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

647 files changed

+22167
-7138
lines changed

.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
root = true
22

3-
[*.{py,c,cpp,h,rst,md,yml}]
3+
[*.{py,c,cpp,h,js,rst,md,yml}]
44
trim_trailing_whitespace = true
55
insert_final_newline = true
66
indent_style = space
@@ -11,5 +11,5 @@ indent_size = 4
1111
[*.rst]
1212
indent_size = 3
1313

14-
[*.yml]
14+
[*.{js,yml}]
1515
indent_size = 2

.github/CODEOWNERS

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ configure* @erlend-aasland @corona10
2121
**/*context* @1st1
2222
**/*genobject* @markshannon
2323
**/*hamt* @1st1
24+
**/*jit* @brandtbucher
2425
Objects/set* @rhettinger
2526
Objects/dict* @methane @markshannon
2627
Objects/typevarobject.c @JelleZijlstra
@@ -37,11 +38,37 @@ Python/ast_opt.c @isidentical
3738
Python/bytecodes.c @markshannon @gvanrossum
3839
Python/optimizer*.c @markshannon @gvanrossum
3940
Lib/test/test_patma.py @brandtbucher
40-
Lib/test/test_peepholer.py @brandtbucher
4141
Lib/test/test_type_*.py @JelleZijlstra
4242
Lib/test/test_capi/test_misc.py @markshannon @gvanrossum
4343
Tools/c-analyzer/ @ericsnowcurrently
4444

45+
# dbm
46+
**/*dbm* @corona10 @erlend-aasland @serhiy-storchaka
47+
48+
# runtime state/lifecycle
49+
**/*pylifecycle* @ericsnowcurrently
50+
**/*pystate* @ericsnowcurrently
51+
**/*preconfig* @ericsnowcurrently
52+
**/*initconfig* @ericsnowcurrently
53+
**/*pathconfig* @ericsnowcurrently
54+
**/*sysmodule* @ericsnowcurrently
55+
**/*bltinmodule* @ericsnowcurrently
56+
**/*gil* @ericsnowcurrently
57+
Include/internal/pycore_runtime.h @ericsnowcurrently
58+
Include/internal/pycore_interp.h @ericsnowcurrently
59+
Include/internal/pycore_tstate.h @ericsnowcurrently
60+
Include/internal/pycore_*_state.h @ericsnowcurrently
61+
Include/internal/pycore_*_init.h @ericsnowcurrently
62+
Include/internal/pycore_atexit.h @ericsnowcurrently
63+
Include/internal/pycore_freelist.h @ericsnowcurrently
64+
Include/internal/pycore_global_objects.h @ericsnowcurrently
65+
Include/internal/pycore_obmalloc.h @ericsnowcurrently
66+
Include/internal/pycore_pymem.h @ericsnowcurrently
67+
Modules/main.c @ericsnowcurrently
68+
Programs/_bootstrap_python.c @ericsnowcurrently
69+
Programs/python.c @ericsnowcurrently
70+
Tools/build/generate_global_objects.py @ericsnowcurrently
71+
4572
# Exceptions
4673
Lib/traceback.py @iritkatriel
4774
Lib/test/test_except*.py @iritkatriel
@@ -76,7 +103,20 @@ Modules/_hacl/** @gpshead
76103
# Import (including importlib).
77104
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
78105
/Python/import.c @kumaraditya303
79-
**/*importlib/resources/* @jaraco @warsaw @FFY00
106+
Python/dynload_*.c @ericsnowcurrently
107+
**/*freeze* @ericsnowcurrently
108+
**/*frozen* @ericsnowcurrently
109+
**/*modsupport* @ericsnowcurrently
110+
**/*modulefinder* @ericsnowcurrently
111+
**/*moduleobject* @ericsnowcurrently
112+
**/*multiphase* @ericsnowcurrently
113+
**/*pkgutil* @ericsnowcurrently
114+
**/*pythonrun* @ericsnowcurrently
115+
**/*runpy* @ericsnowcurrently
116+
**/*singlephase* @ericsnowcurrently
117+
Lib/test/test_module/ @ericsnowcurrently
118+
Doc/c-api/module.rst @ericsnowcurrently
119+
**/*importlib/resources/* @jaraco @warsaw @FFY00
80120
**/importlib/metadata/* @jaraco @warsaw
81121

82122
# Dates and times
@@ -190,11 +230,13 @@ Doc/c-api/stable.rst @encukou
190230
**/*zipfile/_path/* @jaraco
191231

192232
# Argument Clinic
193-
/Tools/clinic/** @erlend-aasland @AlexWaygood
194-
/Lib/test/test_clinic.py @erlend-aasland @AlexWaygood
233+
/Tools/clinic/** @erlend-aasland
234+
/Lib/test/test_clinic.py @erlend-aasland
195235
Doc/howto/clinic.rst @erlend-aasland
196236

197237
# Subinterpreters
238+
**/*interpreteridobject.* @ericsnowcurrently
239+
**/*crossinterp* @ericsnowcurrently
198240
Lib/test/support/interpreters/ @ericsnowcurrently
199241
Modules/_xx*interp*module.c @ericsnowcurrently
200242
Lib/test/test_interpreters/ @ericsnowcurrently

.github/workflows/build.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
with:
133133
python-version: '3.x'
134134
- name: Restore config.cache
135-
uses: actions/cache@v3
135+
uses: actions/cache@v4
136136
with:
137137
path: config.cache
138138
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
@@ -250,7 +250,7 @@ jobs:
250250
strategy:
251251
fail-fast: false
252252
matrix:
253-
openssl_ver: [1.1.1w, 3.0.11, 3.1.3]
253+
openssl_ver: [1.1.1w, 3.0.13, 3.1.5, 3.2.1]
254254
env:
255255
OPENSSL_VER: ${{ matrix.openssl_ver }}
256256
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -259,7 +259,7 @@ jobs:
259259
steps:
260260
- uses: actions/checkout@v4
261261
- name: Restore config.cache
262-
uses: actions/cache@v3
262+
uses: actions/cache@v4
263263
with:
264264
path: config.cache
265265
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -274,7 +274,7 @@ jobs:
274274
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
275275
- name: 'Restore OpenSSL build'
276276
id: cache-openssl
277-
uses: actions/cache@v3
277+
uses: actions/cache@v4
278278
with:
279279
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
280280
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -304,7 +304,7 @@ jobs:
304304
needs: check_source
305305
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
306306
env:
307-
OPENSSL_VER: 3.0.11
307+
OPENSSL_VER: 3.0.13
308308
PYTHONSTRICTEXTENSIONBUILD: 1
309309
steps:
310310
- uses: actions/checkout@v4
@@ -319,7 +319,7 @@ jobs:
319319
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
320320
- name: 'Restore OpenSSL build'
321321
id: cache-openssl
322-
uses: actions/cache@v3
322+
uses: actions/cache@v4
323323
with:
324324
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
325325
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -342,7 +342,7 @@ jobs:
342342
- name: Bind mount sources read-only
343343
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
344344
- name: Restore config.cache
345-
uses: actions/cache@v3
345+
uses: actions/cache@v4
346346
with:
347347
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
348348
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -375,7 +375,7 @@ jobs:
375375
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -r ${GITHUB_WORKSPACE}/Tools/requirements-hypothesis.txt
376376
- name: 'Restore Hypothesis database'
377377
id: cache-hypothesis-database
378-
uses: actions/cache@v3
378+
uses: actions/cache@v4
379379
with:
380380
path: ./hypothesis
381381
key: hypothesis-database-${{ github.head_ref || github.run_id }}
@@ -415,13 +415,13 @@ jobs:
415415
needs: check_source
416416
if: needs.check_source.outputs.run_tests == 'true'
417417
env:
418-
OPENSSL_VER: 3.0.11
418+
OPENSSL_VER: 3.0.13
419419
PYTHONSTRICTEXTENSIONBUILD: 1
420420
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
421421
steps:
422422
- uses: actions/checkout@v4
423423
- name: Restore config.cache
424-
uses: actions/cache@v3
424+
uses: actions/cache@v4
425425
with:
426426
path: config.cache
427427
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
@@ -440,7 +440,7 @@ jobs:
440440
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
441441
- name: 'Restore OpenSSL build'
442442
id: cache-openssl
443-
uses: actions/cache@v3
443+
uses: actions/cache@v4
444444
with:
445445
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
446446
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

.github/workflows/jit.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: JIT
2+
on:
3+
pull_request:
4+
paths:
5+
- '**jit**'
6+
- 'Python/bytecodes.c'
7+
push:
8+
paths:
9+
- '**jit**'
10+
- 'Python/bytecodes.c'
11+
workflow_dispatch:
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
jit:
19+
name: ${{ matrix.target }} (${{ matrix.debug && 'Debug' || 'Release' }})
20+
runs-on: ${{ matrix.runner }}
21+
timeout-minutes: 60
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
target:
26+
- i686-pc-windows-msvc/msvc
27+
- x86_64-pc-windows-msvc/msvc
28+
- x86_64-apple-darwin/clang
29+
- aarch64-apple-darwin/clang
30+
- x86_64-unknown-linux-gnu/gcc
31+
- x86_64-unknown-linux-gnu/clang
32+
- aarch64-unknown-linux-gnu/gcc
33+
- aarch64-unknown-linux-gnu/clang
34+
debug:
35+
- true
36+
- false
37+
llvm:
38+
- 16
39+
include:
40+
- target: i686-pc-windows-msvc/msvc
41+
architecture: Win32
42+
runner: windows-latest
43+
compiler: msvc
44+
- target: x86_64-pc-windows-msvc/msvc
45+
architecture: x64
46+
runner: windows-latest
47+
compiler: msvc
48+
- target: x86_64-apple-darwin/clang
49+
architecture: x86_64
50+
runner: macos-13
51+
compiler: clang
52+
- target: aarch64-apple-darwin/clang
53+
architecture: aarch64
54+
runner: macos-14
55+
compiler: clang
56+
- target: x86_64-unknown-linux-gnu/gcc
57+
architecture: x86_64
58+
runner: ubuntu-latest
59+
compiler: gcc
60+
- target: x86_64-unknown-linux-gnu/clang
61+
architecture: x86_64
62+
runner: ubuntu-latest
63+
compiler: clang
64+
- target: aarch64-unknown-linux-gnu/gcc
65+
architecture: aarch64
66+
runner: ubuntu-latest
67+
compiler: gcc
68+
# These fail because of emulation, not because of the JIT:
69+
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
70+
- target: aarch64-unknown-linux-gnu/clang
71+
architecture: aarch64
72+
runner: ubuntu-latest
73+
compiler: clang
74+
# These fail because of emulation, not because of the JIT:
75+
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
76+
env:
77+
CC: ${{ matrix.compiler }}
78+
steps:
79+
- uses: actions/checkout@v4
80+
- uses: actions/setup-python@v5
81+
with:
82+
python-version: '3.11'
83+
84+
- name: Windows
85+
if: runner.os == 'Windows'
86+
run: |
87+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
88+
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
89+
./PCbuild/rt.bat ${{ matrix.debug && '-d' }} -p ${{ matrix.architecture }} -q --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
90+
91+
- name: macOS
92+
if: runner.os == 'macOS'
93+
run: |
94+
brew install llvm@${{ matrix.llvm }}
95+
export SDKROOT="$(xcrun --show-sdk-path)"
96+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
97+
make all --jobs 4
98+
./python.exe -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
99+
100+
- name: Native Linux
101+
if: runner.os == 'Linux' && matrix.architecture == 'x86_64'
102+
run: |
103+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
104+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
105+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--enable-optimizations --with-lto' }}
106+
make all --jobs 4
107+
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3
108+
109+
- name: Emulated Linux
110+
if: runner.os == 'Linux' && matrix.architecture != 'x86_64'
111+
run: |
112+
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
113+
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
114+
./configure --prefix="$(pwd)/../build"
115+
make install --jobs 4
116+
make clean --jobs 4
117+
export HOST=${{ matrix.architecture }}-linux-gnu
118+
sudo apt install --yes "gcc-$HOST" qemu-user
119+
${{ !matrix.debug && matrix.compiler == 'clang' && './configure --enable-optimizations' || '' }}
120+
${{ !matrix.debug && matrix.compiler == 'clang' && 'make profile-run-stamp --jobs 4' || '' }}
121+
export CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}"
122+
export CPP="$CC --preprocess"
123+
export HOSTRUNNER=qemu-${{ matrix.architecture }}
124+
export QEMU_LD_PREFIX="/usr/$HOST"
125+
./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
126+
make all --jobs 4
127+
./python -m test --exclude ${{ matrix.exclude }} --multiprocess 0 --timeout 3600 --verbose2 --verbose3

.github/workflows/mypy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
- "Tools/build/generate_sbom.py"
1313
- "Tools/cases_generator/**"
1414
- "Tools/clinic/**"
15+
- "Tools/jit/**"
1516
- "Tools/peg_generator/**"
1617
- "Tools/requirements-dev.txt"
1718
- "Tools/wasm/**"
@@ -38,6 +39,7 @@ jobs:
3839
"Tools/build/",
3940
"Tools/cases_generator",
4041
"Tools/clinic",
42+
"Tools/jit",
4143
"Tools/peg_generator",
4244
"Tools/wasm",
4345
]

.github/workflows/require-pr-label.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
label:
1313
name: DO-NOT-MERGE / unresolved review
14+
if: github.repository_owner == 'python'
1415
runs-on: ubuntu-latest
1516
timeout-minutes: 10
1617

.github/workflows/reusable-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
timeout-minutes: 60
9090
steps:
9191
- uses: actions/checkout@v4
92-
- uses: actions/cache@v3
92+
- uses: actions/cache@v4
9393
with:
9494
path: ~/.cache/pip
9595
key: ubuntu-doc-${{ hashFiles('Doc/requirements.txt') }}

.github/workflows/reusable-macos.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,27 @@ on:
1212
jobs:
1313
build_macos:
1414
name: 'build and test'
15-
runs-on: macos-latest
1615
timeout-minutes: 60
1716
env:
1817
HOMEBREW_NO_ANALYTICS: 1
1918
HOMEBREW_NO_AUTO_UPDATE: 1
2019
HOMEBREW_NO_INSTALL_CLEANUP: 1
2120
PYTHONSTRICTEXTENSIONBUILD: 1
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [
25+
"macos-14", # M1
26+
"macos-13", # Intel
27+
]
28+
runs-on: ${{ matrix.os }}
2229
steps:
2330
- uses: actions/checkout@v4
2431
- name: Restore config.cache
25-
uses: actions/cache@v3
32+
uses: actions/cache@v4
2633
with:
2734
path: config.cache
28-
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
35+
key: ${{ github.job }}-${{ matrix.os }}-${{ inputs.config_hash }}
2936
- name: Install Homebrew dependencies
3037
run: brew install pkg-config [email protected] xz gdbm tcl-tk
3138
- name: Configure CPython

0 commit comments

Comments
 (0)