Skip to content

Commit 9ad15f4

Browse files
authored
Merge branch 'main' into getaddrinfo-docs
2 parents aa28524 + be763e5 commit 9ad15f4

File tree

1,179 files changed

+60749
-26565
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,179 files changed

+60749
-26565
lines changed

.azure-pipelines/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
trigger: ['main', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
1+
trigger: ['main', '3.*']
22

33
jobs:
44
- job: Prebuild

.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,js,rst,md,yml}]
3+
[*.{py,c,cpp,h,js,rst,md,yml,yaml}]
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-
[*.{js,yml}]
14+
[*.{js,yml,yaml}]
1515
indent_size = 2

.github/CODEOWNERS

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,16 @@ Objects/exceptions.c @iritkatriel
107107
# Hashing & cryptographic primitives
108108
**/*hashlib* @gpshead @tiran @picnixz
109109
**/*hashopenssl* @gpshead @tiran @picnixz
110-
**/*pyhash* @gpshead @tiran
111-
**/sha* @gpshead @tiran @picnixz
112-
Modules/md5* @gpshead @tiran @picnixz
113-
**/*blake* @gpshead @tiran @picnixz
114-
Modules/_hacl/** @gpshead
110+
**/*pyhash* @gpshead @tiran @picnixz
111+
Modules/*blake* @gpshead @tiran @picnixz
112+
Modules/*md5* @gpshead @tiran @picnixz
113+
Modules/*sha* @gpshead @tiran @picnixz
114+
Modules/_hacl/** @gpshead @picnixz
115115
**/*hmac* @gpshead @picnixz
116116

117+
# libssl
118+
**/*ssl* @gpshead @picnixz
119+
117120
# logging
118121
**/*logging* @vsajip
119122

@@ -185,6 +188,7 @@ Python/ast_opt.c @isidentical @eclips4
185188
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
186189
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
187190
Lib/ast.py @isidentical @JelleZijlstra @eclips4
191+
Lib/_ast_unparse.py @isidentical @JelleZijlstra @eclips4
188192
Lib/test/test_ast/ @eclips4
189193

190194
# Mock
@@ -309,3 +313,6 @@ Doc/reference/ @willingc @AA-Turner
309313
# Colorize
310314
Lib/_colorize.py @hugovk
311315
Lib/test/test__colorize.py @hugovk
316+
317+
# Fuzzing
318+
Modules/_xxtestfuzz/ @ammaraskar

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ Please read this comment in its entirety. It's quite important.
77
It should be in the following format:
88
99
```
10-
gh-NNNNN: Summary of the changes made
10+
gh-NNNNNN: Summary of the changes made
1111
```
1212
13-
Where: gh-NNNNN refers to the GitHub issue number.
13+
Where: gh-NNNNNN refers to the GitHub issue number.
1414
1515
Most PRs will require an issue number. Trivial changes, like fixing a typo, do not need an issue.
1616
@@ -20,11 +20,11 @@ If this is a backport PR (PR made against branches other than `main`),
2020
please ensure that the PR title is in the following format:
2121
2222
```
23-
[X.Y] <title from the original PR> (GH-NNNN)
23+
[X.Y] <title from the original PR> (GH-NNNNNN)
2424
```
2525
26-
Where: [X.Y] is the branch name, e.g. [3.6].
26+
Where: [X.Y] is the branch name, for example: [3.13].
2727
28-
GH-NNNN refers to the PR number from `main`.
28+
GH-NNNNNN refers to the PR number from `main`.
2929
3030
-->

.github/workflows/build.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,12 @@ jobs:
164164
- false
165165
- true
166166
include:
167-
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
167+
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
168+
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
168169
arch: arm64
169170
free-threading: false
170-
- os: windows-latest # FIXME(diegorusso): change to os: windows-aarch64
171+
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
172+
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
171173
arch: arm64
172174
free-threading: true
173175
- os: windows-latest
@@ -187,12 +189,18 @@ jobs:
187189
strategy:
188190
fail-fast: false
189191
matrix:
192+
os:
193+
- windows-latest
190194
arch:
191195
- x86
192196
- x64
193-
- arm64
197+
include:
198+
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
199+
- os: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
200+
arch: arm64
194201
uses: ./.github/workflows/reusable-windows-msi.yml
195202
with:
203+
os: ${{ matrix.os }}
196204
arch: ${{ matrix.arch }}
197205

198206
build-macos:

.github/workflows/jit.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ jobs:
7474
runner: windows-latest
7575
- target: aarch64-pc-windows-msvc/msvc
7676
architecture: ARM64
77-
runner: windows-latest
77+
# Forks don't have access to Windows on Arm runners. These jobs are skipped below:
78+
runner: ${{ github.repository_owner == 'python' && 'windows-aarch64' || 'windows-latest' }}
7879
- target: x86_64-apple-darwin/clang
7980
architecture: x86_64
8081
runner: macos-13
@@ -95,25 +96,19 @@ jobs:
9596
with:
9697
python-version: '3.11'
9798

98-
- name: Native Windows
99-
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
99+
- name: Windows
100+
# Forks don't have access to Windows on Arm runners. Skip those:
101+
if: runner.os == 'Windows' && (matrix.architecture != 'ARM64' || github.repository_owner == 'python')
100102
run: |
101103
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
102104
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
103105
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
104106
105-
# No tests (yet):
106-
- name: Emulated Windows
107-
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
108-
run: |
109-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
110-
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
111-
112107
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
113108
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
114109
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
115110
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
116-
- name: Native macOS
111+
- name: macOS
117112
if: runner.os == 'macOS'
118113
run: |
119114
brew update
@@ -124,7 +119,7 @@ jobs:
124119
make all --jobs 4
125120
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
126121
127-
- name: Native Linux
122+
- name: Linux
128123
if: runner.os == 'Linux'
129124
run: |
130125
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}

.github/workflows/mypy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ jobs:
5959
cache: pip
6060
cache-dependency-path: Tools/requirements-dev.txt
6161
- run: pip install -r Tools/requirements-dev.txt
62+
- run: python3 Misc/mypy/make_symlinks.py --symlink
6263
- run: mypy --config-file ${{ matrix.target }}/mypy.ini

.github/workflows/reusable-windows-msi.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ name: Reusable Windows MSI
33
on:
44
workflow_call:
55
inputs:
6+
os:
7+
description: OS to run on
8+
required: true
9+
type: string
610
arch:
711
description: CPU architecture
812
required: true
@@ -17,7 +21,7 @@ env:
1721
jobs:
1822
build:
1923
name: installer for ${{ inputs.arch }}
20-
runs-on: windows-latest
24+
runs-on: ${{ inputs.os }}
2125
timeout-minutes: 60
2226
env:
2327
ARCH: ${{ inputs.arch }}
@@ -27,5 +31,7 @@ jobs:
2731
with:
2832
persist-credentials: false
2933
- name: Build CPython installer
34+
# Forks don't have access to Windows on Arm runners. Skip those:
35+
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
3036
run: ./Tools/msi/build.bat --doc -"${ARCH}"
3137
shell: bash

.github/workflows/reusable-windows.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ env:
2424
2525
jobs:
2626
build:
27-
name: ${{ inputs.arch == 'arm64' && 'build' || 'build and test' }} (${{ inputs.arch }})
27+
name: Build and test (${{ inputs.arch }})
2828
runs-on: ${{ inputs.os }}
2929
timeout-minutes: 60
3030
env:
@@ -37,17 +37,21 @@ jobs:
3737
if: inputs.arch != 'Win32'
3838
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
3939
- name: Build CPython
40+
# Forks don't have access to Windows on Arm runners. Skip those:
41+
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
4042
run: >-
4143
.\\PCbuild\\build.bat
4244
-e -d -v
4345
-p "${ARCH}"
4446
${{ fromJSON(inputs.free-threading) && '--disable-gil' || '' }}
4547
shell: bash
46-
- name: Display build info # FIXME(diegorusso): remove the `if`
47-
if: inputs.arch != 'arm64'
48+
- name: Display build info
49+
# Forks don't have access to Windows on Arm runners. Skip those:
50+
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
4851
run: .\\python.bat -m test.pythoninfo
49-
- name: Tests # FIXME(diegorusso): remove the `if`
50-
if: inputs.arch != 'arm64'
52+
- name: Tests
53+
# Forks don't have access to Windows on Arm runners. Skip those:
54+
if: inputs.arch != 'arm64' || github.repository_owner == 'python'
5155
run: >-
5256
.\\PCbuild\\rt.bat
5357
-p "${ARCH}"

.github/workflows/tail-call.yml

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@ name: Tail calling interpreter
22
on:
33
pull_request:
44
paths:
5+
- '.github/workflows/tail-call.yml'
56
- 'Python/bytecodes.c'
67
- 'Python/ceval.c'
78
- 'Python/ceval_macros.h'
89
- 'Python/generated_cases.c.h'
910
push:
1011
paths:
12+
- '.github/workflows/tail-call.yml'
1113
- 'Python/bytecodes.c'
1214
- 'Python/ceval.c'
1315
- 'Python/ceval_macros.h'
@@ -35,22 +37,22 @@ jobs:
3537
target:
3638
# Un-comment as we add support for more platforms for tail-calling interpreters.
3739
# - i686-pc-windows-msvc/msvc
38-
# - x86_64-pc-windows-msvc/msvc
40+
- x86_64-pc-windows-msvc/msvc
3941
# - aarch64-pc-windows-msvc/msvc
4042
- x86_64-apple-darwin/clang
4143
- aarch64-apple-darwin/clang
4244
- x86_64-unknown-linux-gnu/gcc
4345
- aarch64-unknown-linux-gnu/gcc
4446
- free-threading
4547
llvm:
46-
- 19
48+
- 20
4749
include:
4850
# - target: i686-pc-windows-msvc/msvc
4951
# architecture: Win32
5052
# runner: windows-latest
51-
# - target: x86_64-pc-windows-msvc/msvc
52-
# architecture: x64
53-
# runner: windows-latest
53+
- target: x86_64-pc-windows-msvc/msvc
54+
architecture: x64
55+
runner: windows-latest
5456
# - target: aarch64-pc-windows-msvc/msvc
5557
# architecture: ARM64
5658
# runner: windows-latest
@@ -79,41 +81,51 @@ jobs:
7981

8082
- name: Native Windows (debug)
8183
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
84+
shell: cmd
8285
run: |
8386
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
84-
./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
85-
./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
87+
set PlatformToolset=clangcl
88+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
89+
set LLVMInstallDir=C:\Program Files\LLVM
90+
call ./PCbuild/build.bat --tail-call-interp -d -p ${{ matrix.architecture }}
91+
call ./PCbuild/rt.bat -d -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
8692
8793
# No tests (yet):
8894
- name: Emulated Windows (release)
8995
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
96+
shell: cmd
9097
run: |
9198
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
99+
set PlatformToolset=clangcl
100+
set LLVMToolsVersion=${{ matrix.llvm }}.1.0
101+
set LLVMInstallDir=C:\Program Files\LLVM
92102
./PCbuild/build.bat --tail-call-interp -p ${{ matrix.architecture }}
93103
94104
# The `find` line is required as a result of https://github.com/actions/runner-images/issues/9966.
95105
# This is a bug in the macOS runner image where the pre-installed Python is installed in the same
96106
# directory as the Homebrew Python, which causes the build to fail for macos-13. This line removes
97107
# the symlink to the pre-installed Python so that the Homebrew Python is used instead.
98-
- name: Native macOS (debug)
108+
# Note: when a new LLVM is released, the homebrew installation directory changes, so the builds will fail.
109+
# We either need to upgrade LLVM or change the directory being pointed to.
110+
- name: Native macOS (release)
99111
if: runner.os == 'macOS'
100112
run: |
101113
brew update
102114
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
103115
brew install llvm@${{ matrix.llvm }}
104116
export SDKROOT="$(xcrun --show-sdk-path)"
105-
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
106117
export PATH="/usr/local/opt/llvm/bin:$PATH"
107-
CC=clang-19 ./configure --with-tail-call-interp --with-pydebug
118+
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
119+
CC=clang-20 ./configure --with-tail-call-interp
108120
make all --jobs 4
109121
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
110122
111-
- name: Native Linux (release)
123+
- name: Native Linux (debug)
112124
if: runner.os == 'Linux' && matrix.target != 'free-threading'
113125
run: |
114126
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
115127
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
116-
CC=clang-19 ./configure --with-tail-call-interp
128+
CC=clang-20 ./configure --with-tail-call-interp --with-pydebug
117129
make all --jobs 4
118130
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
119131
@@ -122,7 +134,7 @@ jobs:
122134
run: |
123135
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
124136
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
125-
CC=clang-19 ./configure --with-tail-call-interp --disable-gil
137+
CC=clang-20 ./configure --with-tail-call-interp --disable-gil
126138
make all --jobs 4
127139
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128140

0 commit comments

Comments
 (0)