Skip to content

Commit c55b95b

Browse files
Merge branch 'main' into pythongh-131535-docs-html-parser
2 parents cead7f2 + 3dfed23 commit c55b95b

File tree

861 files changed

+56063
-13294
lines changed

Some content is hidden

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

861 files changed

+56063
-13294
lines changed

.github/CODEOWNERS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Modules/Setup* @erlend-aasland
3030
Objects/set* @rhettinger
3131
Objects/dict* @methane @markshannon
3232
Objects/typevarobject.c @JelleZijlstra
33+
Objects/unionobject.c @JelleZijlstra
3334
Objects/type* @markshannon
3435
Objects/codeobject.c @markshannon
3536
Objects/frameobject.c @markshannon
@@ -187,7 +188,7 @@ Include/internal/pycore_time.h @pganssle @abalkin
187188

188189
# AST
189190
Python/ast.c @isidentical @JelleZijlstra @eclips4
190-
Python/ast_opt.c @isidentical @eclips4
191+
Python/ast_preprocess.c @isidentical @eclips4
191192
Parser/asdl.py @isidentical @JelleZijlstra @eclips4
192193
Parser/asdl_c.py @isidentical @JelleZijlstra @eclips4
193194
Lib/ast.py @isidentical @JelleZijlstra @eclips4
@@ -319,3 +320,9 @@ Lib/test/test__colorize.py @hugovk
319320

320321
# Fuzzing
321322
Modules/_xxtestfuzz/ @ammaraskar
323+
324+
# t-strings
325+
**/*interpolationobject* @lysnikolaou
326+
**/*templateobject* @lysnikolaou
327+
**/*templatelib* @lysnikolaou
328+
**/*tstring* @lysnikolaou

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
fail-fast: false
265265
matrix:
266266
os: [ubuntu-24.04]
267-
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2, 3.4.0]
267+
openssl_ver: [3.0.16, 3.1.8, 3.2.4, 3.3.3, 3.4.1]
268268
# See Tools/ssl/make_ssl_data.py for notes on adding a new version
269269
env:
270270
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -331,7 +331,7 @@ jobs:
331331
needs: build-context
332332
if: needs.build-context.outputs.run-tests == 'true'
333333
env:
334-
OPENSSL_VER: 3.0.15
334+
OPENSSL_VER: 3.0.16
335335
PYTHONSTRICTEXTENSIONBUILD: 1
336336
steps:
337337
- uses: actions/checkout@v4
@@ -422,8 +422,9 @@ jobs:
422422
# failing when executed from inside a virtual environment.
423423
"${VENV_PYTHON}" -m test \
424424
-W \
425-
-o \
425+
--slowest \
426426
-j4 \
427+
--timeout 900 \
427428
-x test_asyncio \
428429
-x test_multiprocessing_fork \
429430
-x test_multiprocessing_forkserver \
@@ -450,7 +451,7 @@ jobs:
450451
matrix:
451452
os: [ubuntu-24.04]
452453
env:
453-
OPENSSL_VER: 3.0.15
454+
OPENSSL_VER: 3.0.16
454455
PYTHONSTRICTEXTENSIONBUILD: 1
455456
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
456457
steps:

.github/workflows/jit.yml

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ jobs:
9595
with:
9696
python-version: '3.11'
9797

98+
# PCbuild downloads LLVM automatically:
9899
- name: Windows
99100
if: runner.os == 'Windows'
100101
run: |
101-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
102102
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
103103
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
104104
@@ -113,7 +113,7 @@ jobs:
113113
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
114114
brew install llvm@${{ matrix.llvm }}
115115
export SDKROOT="$(xcrun --show-sdk-path)"
116-
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '' }}
116+
./configure --enable-experimental-jit --enable-universalsdk --with-universal-archs=universal2 ${{ matrix.debug && '--with-pydebug' || '' }}
117117
make all --jobs 4
118118
./python.exe -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
119119
@@ -126,29 +126,30 @@ jobs:
126126
make all --jobs 4
127127
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
128128
129-
jit-with-disabled-gil:
130-
name: Free-Threaded (Debug)
131-
needs: interpreter
132-
runs-on: ubuntu-24.04
133-
timeout-minutes: 90
134-
strategy:
135-
fail-fast: false
136-
matrix:
137-
llvm:
138-
- 19
139-
steps:
140-
- uses: actions/checkout@v4
141-
with:
142-
persist-credentials: false
143-
- uses: actions/setup-python@v5
144-
with:
145-
python-version: '3.11'
146-
- name: Build with JIT enabled and GIL disabled
147-
run: |
148-
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
149-
export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
150-
./configure --enable-experimental-jit --with-pydebug --disable-gil
151-
make all --jobs 4
152-
- name: Run tests
153-
run: |
154-
./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3
129+
# XXX: GH-133171
130+
# jit-with-disabled-gil:
131+
# name: Free-Threaded (Debug)
132+
# needs: interpreter
133+
# runs-on: ubuntu-24.04
134+
# timeout-minutes: 90
135+
# strategy:
136+
# fail-fast: false
137+
# matrix:
138+
# llvm:
139+
# - 19
140+
# steps:
141+
# - uses: actions/checkout@v4
142+
# with:
143+
# persist-credentials: false
144+
# - uses: actions/setup-python@v5
145+
# with:
146+
# python-version: '3.11'
147+
# - name: Build with JIT enabled and GIL disabled
148+
# run: |
149+
# sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" ./llvm.sh ${{ matrix.llvm }}
150+
# export PATH="$(llvm-config-${{ matrix.llvm }} --bindir):$PATH"
151+
# ./configure --enable-experimental-jit --with-pydebug --disable-gil
152+
# make all --jobs 4
153+
# - name: Run tests
154+
# run: |
155+
# ./python -m test --multiprocess 0 --timeout 4500 --verbose2 --verbose3

.github/workflows/mypy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ on:
88
pull_request:
99
paths:
1010
- ".github/workflows/mypy.yml"
11+
- "Lib/_colorize.py"
1112
- "Lib/_pyrepl/**"
1213
- "Lib/test/libregrtest/**"
14+
- "Lib/tomllib/**"
15+
- "Misc/mypy/**"
1316
- "Tools/build/generate_sbom.py"
1417
- "Tools/cases_generator/**"
1518
- "Tools/clinic/**"
@@ -42,6 +45,7 @@ jobs:
4245
target: [
4346
"Lib/_pyrepl",
4447
"Lib/test/libregrtest",
48+
"Lib/tomllib",
4549
"Tools/build",
4650
"Tools/cases_generator",
4751
"Tools/clinic",

.github/workflows/reusable-context.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ jobs:
9797
run: python Tools/build/compute-changes.py
9898
env:
9999
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
100+
CCF_TARGET_REF: ${{ github.base_ref || github.event.repository.default_branch }}
101+
CCF_HEAD_REF: ${{ github.event.pull_request.head.sha || github.sha }}
100102

101103
- name: Compute hash for config cache key
102104
id: config-hash

.github/workflows/reusable-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
run: |
6767
set -Eeuo pipefail
6868
# Build docs with the nit-picky option; write warnings to file
69-
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --keep-going --warning-file sphinx-warnings.txt" html
69+
make -C Doc/ PYTHON=../python SPHINXOPTS="--quiet --nitpicky --fail-on-warning --warning-file sphinx-warnings.txt" html
7070
- name: 'Check warnings'
7171
if: github.event_name == 'pull_request'
7272
run: |
@@ -101,4 +101,4 @@ jobs:
101101
run: make -C Doc/ PYTHON=../python venv
102102
# Use "xvfb-run" since some doctest tests open GUI windows
103103
- name: 'Run documentation doctest'
104-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning --keep-going" doctest
104+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXERRORHANDLING="--fail-on-warning" doctest

.github/zizmor.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ rules:
44
dangerous-triggers:
55
ignore:
66
- documentation-links.yml
7+
unpinned-uses:
8+
config:
9+
policies:
10+
"*": ref-pin

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ Tools/unicode/data/
138138
# hendrikmuhs/ccache-action@v1
139139
/.ccache
140140
/cross-build/
141-
/jit_stencils.h
141+
/jit_stencils*.h
142142
/platform
143143
/profile-clean-stamp
144144
/profile-run-stamp
145145
/profile-bolt-stamp
146+
/profile-gen-stamp
146147
/pybuilddir.txt
147148
/pyconfig.h
148149
/python-config

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# This file sets the canonical name for contributors to the repository.
22
# Documentation: https://git-scm.com/docs/gitmailmap
3+
Willow Chargin <[email protected]>
34

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.11.4
3+
rev: v0.11.8
44
hooks:
55
- id: ruff
66
name: Run Ruff (lint) on Doc/
@@ -11,9 +11,9 @@ repos:
1111
args: [--exit-non-zero-on-fix]
1212
files: ^Lib/test/
1313
- id: ruff
14-
name: Run Ruff (lint) on Tools/build/check_warnings.py
14+
name: Run Ruff (lint) on Tools/build/
1515
args: [--exit-non-zero-on-fix, --config=Tools/build/.ruff.toml]
16-
files: ^Tools/build/check_warnings.py
16+
files: ^Tools/build/
1717
- id: ruff
1818
name: Run Ruff (lint) on Argument Clinic
1919
args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml]
@@ -22,14 +22,14 @@ repos:
2222
name: Run Ruff (format) on Doc/
2323
args: [--check]
2424
files: ^Doc/
25+
- id: ruff-format
26+
name: Run Ruff (format) on Tools/build/check_warnings.py
27+
args: [--check, --config=Tools/build/.ruff.toml]
28+
files: ^Tools/build/check_warnings.py
2529

2630
- repo: https://github.com/psf/black-pre-commit-mirror
27-
rev: 24.10.0
31+
rev: 25.1.0
2832
hooks:
29-
- id: black
30-
name: Run Black on Tools/build/check_warnings.py
31-
files: ^Tools/build/check_warnings.py
32-
args: [--line-length=79]
3333
- id: black
3434
name: Run Black on Tools/jit/
3535
files: ^Tools/jit/
@@ -49,7 +49,7 @@ repos:
4949
types_or: [c, inc, python, rst]
5050

5151
- repo: https://github.com/python-jsonschema/check-jsonschema
52-
rev: 0.31.0
52+
rev: 0.33.0
5353
hooks:
5454
- id: check-dependabot
5555
- id: check-github-workflows
@@ -61,7 +61,7 @@ repos:
6161
- id: actionlint
6262

6363
- repo: https://github.com/woodruffw/zizmor-pre-commit
64-
rev: v1.1.1
64+
rev: v1.6.0
6565
hooks:
6666
- id: zizmor
6767

.ruff.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Default settings for Ruff in CPython
2+
3+
# PYTHON_FOR_REGEN
4+
target-version = "py310"
5+
6+
# PEP 8
7+
line-length = 79
8+
9+
# Enable automatic fixes by default.
10+
# To override this, use ``fix = false`` in a subdirectory's config file
11+
# or ``--no-fix`` on the command line.
12+
fix = true

Android/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@ it:
2525
`android-sdk/cmdline-tools/latest`.
2626
* `export ANDROID_HOME=/path/to/android-sdk`
2727

28-
The `android.py` script also requires the following commands to be on the `PATH`:
28+
The `android.py` script will automatically use the SDK's `sdkmanager` to install
29+
any packages it needs.
30+
31+
The script also requires the following commands to be on the `PATH`:
2932

3033
* `curl`
3134
* `java` (or set the `JAVA_HOME` environment variable)
32-
* `tar`
3335

3436

3537
## Building
@@ -97,7 +99,7 @@ similar to the `Android` directory of the CPython source tree.
9799
The Python test suite can be run on Linux, macOS, or Windows:
98100

99101
* On Linux, the emulator needs access to the KVM virtualization interface, and
100-
a DISPLAY environment variable pointing at an X server.
102+
a DISPLAY environment variable pointing at an X server. Xvfb is acceptable.
101103

102104
The test suite can usually be run on a device with 2 GB of RAM, but this is
103105
borderline, so you may need to increase it to 4 GB. As of Android

Android/android.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -138,19 +138,19 @@ def make_build_python(context):
138138
run(["make", "-j", str(os.cpu_count())])
139139

140140

141-
def unpack_deps(host):
141+
def unpack_deps(host, prefix_dir):
142142
deps_url = "https://github.com/beeware/cpython-android-source-deps/releases/download"
143143
for name_ver in ["bzip2-1.0.8-2", "libffi-3.4.4-3", "openssl-3.0.15-4",
144144
"sqlite-3.49.1-0", "xz-5.4.6-1"]:
145145
filename = f"{name_ver}-{host}.tar.gz"
146146
download(f"{deps_url}/{name_ver}/{filename}")
147-
run(["tar", "-xf", filename])
147+
shutil.unpack_archive(filename, prefix_dir)
148148
os.remove(filename)
149149

150150

151151
def download(url, target_dir="."):
152152
out_path = f"{target_dir}/{basename(url)}"
153-
run(["curl", "-Lf", "-o", out_path, url])
153+
run(["curl", "-Lf", "--retry", "5", "--retry-all-errors", "-o", out_path, url])
154154
return out_path
155155

156156

@@ -162,8 +162,7 @@ def configure_host_python(context):
162162
prefix_dir = host_dir / "prefix"
163163
if not prefix_dir.exists():
164164
prefix_dir.mkdir()
165-
os.chdir(prefix_dir)
166-
unpack_deps(context.host)
165+
unpack_deps(context.host, prefix_dir)
167166

168167
os.chdir(host_dir)
169168
command = [
@@ -241,16 +240,15 @@ def setup_sdk():
241240
# the Gradle wrapper is not included in the CPython repository. Instead, we
242241
# extract it from the Gradle GitHub repository.
243242
def setup_testbed():
244-
# The Gradle version used for the build is specified in
245-
# testbed/gradle/wrapper/gradle-wrapper.properties. This wrapper version
246-
# doesn't need to match, as any version of the wrapper can download any
247-
# version of Gradle.
248-
version = "8.9.0"
249243
paths = ["gradlew", "gradlew.bat", "gradle/wrapper/gradle-wrapper.jar"]
250-
251244
if all((TESTBED_DIR / path).exists() for path in paths):
252245
return
253246

247+
# The wrapper version isn't important, as any version of the wrapper can
248+
# download any version of Gradle. The Gradle version actually used for the
249+
# build is specified in testbed/gradle/wrapper/gradle-wrapper.properties.
250+
version = "8.9.0"
251+
254252
for path in paths:
255253
out_path = TESTBED_DIR / path
256254
out_path.parent.mkdir(exist_ok=True)

Doc/.ruff.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
extend = "../.ruff.toml" # Inherit the project-wide settings
2+
13
target-version = "py312" # Align with the version in oldest_supported_sphinx
2-
fix = true
3-
output-format = "full"
4-
line-length = 79
54
extend-exclude = [
65
"includes/*",
76
# Temporary exclusions:

0 commit comments

Comments
 (0)