Skip to content

Commit a3973f0

Browse files
authored
Merge branch 'main' into pythongh-103501
2 parents 37a0e1f + ba8aa1f commit a3973f0

File tree

642 files changed

+50680
-38888
lines changed

Some content is hidden

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

642 files changed

+50680
-38888
lines changed

.github/CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Doc/c-api/stable.rst @encukou
151151

152152
**/*idlelib* @terryjreedy
153153

154-
**/*typing* @gvanrossum @Fidget-Spinner @JelleZijlstra @AlexWaygood
154+
**/*typing* @gvanrossum @JelleZijlstra @AlexWaygood
155155

156156
**/*ftplib @giampaolo
157157
**/*shutil @giampaolo

.github/ISSUE_TEMPLATE/bug.yml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ body:
3939
- "3.10"
4040
- "3.11"
4141
- "3.12"
42+
- "3.13"
4243
- "CPython main branch"
4344
validations:
4445
required: true

.github/workflows/build.yml

+54-150
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
- '3.10'
1414
- '3.9'
1515
- '3.8'
16-
- '3.7'
1716
pull_request:
1817
branches:
1918
- 'main'
@@ -22,7 +21,6 @@ on:
2221
- '3.10'
2322
- '3.9'
2423
- '3.8'
25-
- '3.7'
2624

2725
permissions:
2826
contents: read
@@ -128,14 +126,14 @@ jobs:
128126
if: needs.check_source.outputs.run_tests == 'true'
129127
steps:
130128
- uses: actions/checkout@v4
129+
- uses: actions/setup-python@v4
130+
with:
131+
python-version: '3.x'
131132
- name: Restore config.cache
132133
uses: actions/cache@v3
133134
with:
134135
path: config.cache
135-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
136-
- uses: actions/setup-python@v4
137-
with:
138-
python-version: '3.x'
136+
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}-${{ env.pythonLocation }}
139137
- name: Install Dependencies
140138
run: sudo ./.github/workflows/posix-deps-apt.sh
141139
- name: Add ccache to PATH
@@ -180,159 +178,63 @@ jobs:
180178
if: github.event_name == 'pull_request' # $GITHUB_EVENT_NAME
181179
run: make check-c-globals
182180

183-
build_win32:
184-
name: 'Windows (x86)'
185-
runs-on: windows-latest
186-
timeout-minutes: 60
181+
build_windows:
182+
name: 'Windows'
187183
needs: check_source
188184
if: needs.check_source.outputs.run_tests == 'true'
189-
env:
190-
IncludeUwp: 'true'
191-
steps:
192-
- uses: actions/checkout@v4
193-
- name: Build CPython
194-
run: .\PCbuild\build.bat -e -d -p Win32
195-
- name: Display build info
196-
run: .\python.bat -m test.pythoninfo
197-
- name: Tests
198-
run: .\PCbuild\rt.bat -p Win32 -d -q --fast-ci
185+
uses: ./.github/workflows/reusable-windows.yml
199186

200-
build_win_amd64:
201-
name: 'Windows (x64)'
202-
runs-on: windows-latest
203-
timeout-minutes: 60
187+
build_windows_free_threaded:
188+
name: 'Windows (free-threaded)'
204189
needs: check_source
205-
if: needs.check_source.outputs.run_tests == 'true'
206-
env:
207-
IncludeUwp: 'true'
208-
steps:
209-
- uses: actions/checkout@v4
210-
- name: Register MSVC problem matcher
211-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
212-
- name: Build CPython
213-
run: .\PCbuild\build.bat -e -d -p x64
214-
- name: Display build info
215-
run: .\python.bat -m test.pythoninfo
216-
- name: Tests
217-
run: .\PCbuild\rt.bat -p x64 -d -q --fast-ci
218-
219-
build_win_arm64:
220-
name: 'Windows (arm64)'
221-
runs-on: windows-latest
222-
timeout-minutes: 60
223-
needs: check_source
224-
if: needs.check_source.outputs.run_tests == 'true'
225-
env:
226-
IncludeUwp: 'true'
227-
steps:
228-
- uses: actions/checkout@v4
229-
- name: Register MSVC problem matcher
230-
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
231-
- name: Build CPython
232-
run: .\PCbuild\build.bat -e -d -p arm64
190+
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
191+
uses: ./.github/workflows/reusable-windows.yml
192+
with:
193+
free-threaded: true
233194

234195
build_macos:
235196
name: 'macOS'
236-
runs-on: macos-latest
237-
timeout-minutes: 60
238197
needs: check_source
239198
if: needs.check_source.outputs.run_tests == 'true'
240-
env:
241-
HOMEBREW_NO_ANALYTICS: 1
242-
HOMEBREW_NO_AUTO_UPDATE: 1
243-
HOMEBREW_NO_INSTALL_CLEANUP: 1
244-
PYTHONSTRICTEXTENSIONBUILD: 1
245-
steps:
246-
- uses: actions/checkout@v4
247-
- name: Restore config.cache
248-
uses: actions/cache@v3
249-
with:
250-
path: config.cache
251-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
252-
- name: Install Homebrew dependencies
253-
run: brew install pkg-config [email protected] xz gdbm tcl-tk
254-
- name: Configure CPython
255-
run: |
256-
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
257-
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
258-
./configure \
259-
--config-cache \
260-
--with-pydebug \
261-
--prefix=/opt/python-dev \
262-
--with-openssl="$(brew --prefix [email protected])"
263-
- name: Build CPython
264-
run: make -j4
265-
- name: Display build info
266-
run: make pythoninfo
267-
- name: Tests
268-
run: make test
199+
uses: ./.github/workflows/reusable-macos.yml
200+
with:
201+
config_hash: ${{ needs.check_source.outputs.config_hash }}
202+
203+
build_macos_free_threaded:
204+
name: 'macOS (free-threaded)'
205+
needs: check_source
206+
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
207+
uses: ./.github/workflows/reusable-macos.yml
208+
with:
209+
config_hash: ${{ needs.check_source.outputs.config_hash }}
210+
free-threaded: true
269211

270212
build_ubuntu:
271213
name: 'Ubuntu'
272-
runs-on: ubuntu-20.04
273-
timeout-minutes: 60
274214
needs: check_source
275215
if: needs.check_source.outputs.run_tests == 'true'
276-
env:
277-
OPENSSL_VER: 3.0.11
278-
PYTHONSTRICTEXTENSIONBUILD: 1
279-
steps:
280-
- uses: actions/checkout@v4
281-
- name: Register gcc problem matcher
282-
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
283-
- name: Install Dependencies
284-
run: sudo ./.github/workflows/posix-deps-apt.sh
285-
- name: Configure OpenSSL env vars
286-
run: |
287-
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
288-
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
289-
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
290-
- name: 'Restore OpenSSL build'
291-
id: cache-openssl
292-
uses: actions/cache@v3
293-
with:
294-
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
295-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
296-
- name: Install OpenSSL
297-
if: steps.cache-openssl.outputs.cache-hit != 'true'
298-
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
299-
- name: Add ccache to PATH
300-
run: |
301-
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
302-
- name: Configure ccache action
303-
uses: hendrikmuhs/[email protected]
304-
- name: Setup directory envs for out-of-tree builds
305-
run: |
306-
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
307-
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
308-
- name: Create directories for read-only out-of-tree builds
309-
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
310-
- name: Bind mount sources read-only
311-
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
312-
- name: Restore config.cache
313-
uses: actions/cache@v3
314-
with:
315-
path: ${{ env.CPYTHON_BUILDDIR }}/config.cache
316-
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
317-
- name: Configure CPython out-of-tree
318-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
319-
run: |
216+
uses: ./.github/workflows/reusable-ubuntu.yml
217+
with:
218+
config_hash: ${{ needs.check_source.outputs.config_hash }}
219+
options: |
320220
../cpython-ro-srcdir/configure \
321221
--config-cache \
322222
--with-pydebug \
323223
--with-openssl=$OPENSSL_DIR
324-
- name: Build CPython out-of-tree
325-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
326-
run: make -j4
327-
- name: Display build info
328-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
329-
run: make pythoninfo
330-
- name: Remount sources writable for tests
331-
# some tests write to srcdir, lack of pyc files slows down testing
332-
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
333-
- name: Tests
334-
working-directory: ${{ env.CPYTHON_BUILDDIR }}
335-
run: xvfb-run make test
224+
225+
build_ubuntu_free_threaded:
226+
name: 'Ubuntu (free-threaded)'
227+
needs: check_source
228+
if: needs.check_source.outputs.run_tests == 'true' && contains(github.event.pull_request.labels.*.name, 'topic-free-threaded')
229+
uses: ./.github/workflows/reusable-ubuntu.yml
230+
with:
231+
config_hash: ${{ needs.check_source.outputs.config_hash }}
232+
options: |
233+
../cpython-ro-srcdir/configure \
234+
--config-cache \
235+
--with-pydebug \
236+
--with-openssl=$OPENSSL_DIR \
237+
--disable-gil
336238
337239
build_ubuntu_ssltests:
338240
name: 'Ubuntu SSL tests with OpenSSL'
@@ -598,12 +500,13 @@ jobs:
598500
- check_source # Transitive dependency, needed to access `run_tests` value
599501
- check-docs
600502
- check_generated_files
601-
- build_win32
602-
- build_win_amd64
603-
- build_win_arm64
604503
- build_macos
504+
- build_macos_free_threaded
605505
- build_ubuntu
506+
- build_ubuntu_free_threaded
606507
- build_ubuntu_ssltests
508+
- build_windows
509+
- build_windows_free_threaded
607510
- test_hypothesis
608511
- build_asan
609512
- cifuzz
@@ -615,10 +518,10 @@ jobs:
615518
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe
616519
with:
617520
allowed-failures: >-
618-
build_macos,
521+
build_macos_free_threaded,
522+
build_ubuntu_free_threaded,
619523
build_ubuntu_ssltests,
620-
build_win32,
621-
build_win_arm64,
524+
build_windows_free_threaded,
622525
cifuzz,
623526
test_hypothesis,
624527
allowed-skips: >-
@@ -633,12 +536,13 @@ jobs:
633536
needs.check_source.outputs.run_tests != 'true'
634537
&& '
635538
check_generated_files,
636-
build_win32,
637-
build_win_amd64,
638-
build_win_arm64,
639539
build_macos,
540+
build_macos_free_threaded,
640541
build_ubuntu,
542+
build_ubuntu_free_threaded,
641543
build_ubuntu_ssltests,
544+
build_windows,
545+
build_windows_free_threaded,
642546
build_asan,
643547
'
644548
|| ''

.github/workflows/new-bugs-announce-notifier.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
runs-on: ubuntu-latest
1414
timeout-minutes: 10
1515
steps:
16-
- uses: actions/setup-node@v3
16+
- uses: actions/setup-node@v4
1717
with:
18-
node-version: 14
18+
node-version: 20
1919
- run: npm install mailgun.js form-data
2020
- name: Send notification
2121
uses: actions/github-script@v6

.github/workflows/reusable-macos.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
config_hash:
5+
required: true
6+
type: string
7+
free-threaded:
8+
required: false
9+
type: boolean
10+
default: false
11+
12+
jobs:
13+
build_macos:
14+
name: 'build and test'
15+
runs-on: macos-latest
16+
timeout-minutes: 60
17+
env:
18+
HOMEBREW_NO_ANALYTICS: 1
19+
HOMEBREW_NO_AUTO_UPDATE: 1
20+
HOMEBREW_NO_INSTALL_CLEANUP: 1
21+
PYTHONSTRICTEXTENSIONBUILD: 1
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Restore config.cache
25+
uses: actions/cache@v3
26+
with:
27+
path: config.cache
28+
key: ${{ github.job }}-${{ runner.os }}-${{ inputs.config_hash }}
29+
- name: Install Homebrew dependencies
30+
run: brew install pkg-config [email protected] xz gdbm tcl-tk
31+
- name: Configure CPython
32+
run: |
33+
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
34+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
35+
./configure \
36+
--config-cache \
37+
--with-pydebug \
38+
${{ inputs.free-threaded && '--disable-gil' || '' }} \
39+
--prefix=/opt/python-dev \
40+
--with-openssl="$(brew --prefix [email protected])"
41+
- name: Build CPython
42+
run: make -j4
43+
- name: Display build info
44+
run: make pythoninfo
45+
- name: Tests
46+
run: make test

0 commit comments

Comments
 (0)