Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9007edf

Browse filesBrowse files
Merge branch 'main' into fix-module-breakpoint
2 parents 0cb7fe7 + e97910c commit 9007edf
Copy full SHA for 9007edf

File tree

Expand file treeCollapse file tree

753 files changed

+28470
-23198
lines changed
Filter options

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

753 files changed

+28470
-23198
lines changed

‎.devcontainer/Dockerfile

Copy file name to clipboardExpand all lines: .devcontainer/Dockerfile
-24Lines changed: 0 additions & 24 deletions
This file was deleted.

‎.devcontainer/devcontainer.json

Copy file name to clipboardExpand all lines: .devcontainer/devcontainer.json
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
{
2-
"build": {
3-
"dockerfile": "Dockerfile"
4-
},
2+
"image": "ghcr.io/python/devcontainer:2024.09.25.11038928730",
53
"onCreateCommand": [
64
// Install common tooling.
75
"dnf",

‎.github/CODEOWNERS

Copy file name to clipboardExpand all lines: .github/CODEOWNERS
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ Doc/c-api/stable.rst @encukou
207207
**/*bisect* @rhettinger
208208
**/*heapq* @rhettinger
209209
**/*functools* @rhettinger
210-
**/*decimal* @rhettinger
211210

212211
**/*dataclasses* @ericvsmith
213212

@@ -281,3 +280,5 @@ Lib/test/test_configparser.py @jaraco
281280

282281
# Doc sections
283282
Doc/reference/ @willingc
283+
284+
**/*weakref* @kumaraditya303

‎.github/ISSUE_TEMPLATE/crash.yml

Copy file name to clipboardExpand all lines: .github/ISSUE_TEMPLATE/crash.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ body:
3232
- "3.10"
3333
- "3.11"
3434
- "3.12"
35+
- "3.13"
3536
- "CPython main branch"
3637
validations:
3738
required: true

‎.github/workflows/build.yml

Copy file name to clipboardExpand all lines: .github/workflows/build.yml
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,14 @@ jobs:
195195

196196
build_ubuntu_ssltests:
197197
name: 'Ubuntu SSL tests with OpenSSL'
198-
runs-on: ubuntu-22.04
198+
runs-on: ${{ matrix.os }}
199199
timeout-minutes: 60
200200
needs: check_source
201201
if: needs.check_source.outputs.run_tests == 'true'
202202
strategy:
203203
fail-fast: false
204204
matrix:
205+
os: [ubuntu-22.04]
205206
openssl_ver: [3.0.15, 3.1.7, 3.2.3, 3.3.2]
206207
env:
207208
OPENSSL_VER: ${{ matrix.openssl_ver }}
@@ -231,7 +232,7 @@ jobs:
231232
uses: actions/cache@v4
232233
with:
233234
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
234-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
235236
- name: Install OpenSSL
236237
if: steps.cache-openssl.outputs.cache-hit != 'true'
237238
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
@@ -410,7 +411,7 @@ jobs:
410411
uses: actions/cache@v4
411412
with:
412413
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
413-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
414415
- name: Install OpenSSL
415416
if: steps.cache-openssl.outputs.cache-hit != 'true'
416417
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux

‎.github/workflows/jit.yml

Copy file name to clipboardExpand all lines: .github/workflows/jit.yml
+3-5Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,17 +110,15 @@ jobs:
110110
- name: Native Windows
111111
if: runner.os == 'Windows' && matrix.architecture != 'ARM64'
112112
run: |
113-
choco upgrade llvm -y
114-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
113+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
115114
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '--pgo' }} -p ${{ matrix.architecture }}
116115
./PCbuild/rt.bat ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }} -q --multiprocess 0 --timeout 4500 --verbose2 --verbose3
117116
118117
# No PGO or tests (yet):
119118
- name: Emulated Windows
120119
if: runner.os == 'Windows' && matrix.architecture == 'ARM64'
121120
run: |
122-
choco upgrade llvm -y
123-
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}
121+
choco install llvm --allow-downgrade --no-progress --version ${{ matrix.llvm }}.1.0
124122
./PCbuild/build.bat --experimental-jit ${{ matrix.debug && '-d' || '' }} -p ${{ matrix.architecture }}
125123
126124
- name: Native macOS
@@ -159,7 +157,7 @@ jobs:
159157
CC="${{ matrix.compiler == 'clang' && 'clang --target=$HOST' || '$HOST-gcc' }}" \
160158
CPP="$CC --preprocess" \
161159
HOSTRUNNER=qemu-${{ matrix.architecture }} \
162-
./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
160+
./configure --enable-experimental-jit ${{ matrix.debug && '--with-pydebug' || '--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
163161
make all --jobs 4
164162
./python -m test --ignorefile=Tools/jit/ignore-tests-emulated-linux.txt --multiprocess 0 --timeout 4500 --verbose2 --verbose3
165163

‎.github/workflows/reusable-change-detection.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-change-detection.yml
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
---
2-
3-
name: Change detection
1+
name: Reusable change detection
42

53
on: # yamllint disable-line rule:truthy
64
workflow_call:

‎.github/workflows/reusable-docs.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-docs.yml
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Docs
1+
name: Reusable Docs
22

33
on:
44
workflow_call:
@@ -95,7 +95,7 @@ jobs:
9595
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
9696
doctest:
9797
name: 'Doctest'
98-
runs-on: ubuntu-latest
98+
runs-on: ubuntu-22.04
9999
timeout-minutes: 60
100100
steps:
101101
- uses: actions/checkout@v4

‎.github/workflows/reusable-macos.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-macos.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable macOS
2+
13
on:
24
workflow_call:
35
inputs:

‎.github/workflows/reusable-tsan.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-tsan.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Thread Sanitizer
2+
13
on:
24
workflow_call:
35
inputs:

‎.github/workflows/reusable-ubuntu.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-ubuntu.yml
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Ubuntu
2+
13
on:
24
workflow_call:
35
inputs:
@@ -14,7 +16,11 @@ jobs:
1416
build_ubuntu_reusable:
1517
name: 'build and test'
1618
timeout-minutes: 60
17-
runs-on: ubuntu-22.04
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
os: [ubuntu-22.04]
1824
env:
1925
FORCE_COLOR: 1
2026
OPENSSL_VER: 3.0.15
@@ -36,7 +42,7 @@ jobs:
3642
uses: actions/cache@v4
3743
with:
3844
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
39-
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
45+
key: ${{ matrix.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
4046
- name: Install OpenSSL
4147
if: steps.cache-openssl.outputs.cache-hit != 'true'
4248
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux

‎.github/workflows/reusable-wasi.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-wasi.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable WASI
2+
13
on:
24
workflow_call:
35
inputs:

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

Copy file name to clipboardExpand all lines: .github/workflows/reusable-windows-msi.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: TestsMSI
1+
name: Reusable Windows MSI
22

33
on:
44
workflow_call:

‎.github/workflows/reusable-windows.yml

Copy file name to clipboardExpand all lines: .github/workflows/reusable-windows.yml
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
name: Reusable Windows
2+
13
on:
24
workflow_call:
35
inputs:

‎.pre-commit-config.yaml

Copy file name to clipboardExpand all lines: .pre-commit-config.yaml
+10-1Lines changed: 10 additions & 1 deletion
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.4.10
3+
rev: v0.6.7
44
hooks:
55
- id: ruff
66
name: Run Ruff (lint) on Doc/
@@ -10,6 +10,10 @@ repos:
1010
name: Run Ruff (lint) on Lib/test/
1111
args: [--exit-non-zero-on-fix]
1212
files: ^Lib/test/
13+
- id: ruff
14+
name: Run Ruff (lint) on Tools/build/check_warnings.py
15+
args: [--exit-non-zero-on-fix, --config=Tools/build/.ruff.toml]
16+
files: ^Tools/build/check_warnings.py
1317
- id: ruff
1418
name: Run Ruff (lint) on Argument Clinic
1519
args: [--exit-non-zero-on-fix, --config=Tools/clinic/.ruff.toml]
@@ -22,6 +26,11 @@ repos:
2226
- repo: https://github.com/psf/black-pre-commit-mirror
2327
rev: 24.8.0
2428
hooks:
29+
- id: black
30+
name: Run Black on Tools/build/check_warnings.py
31+
files: ^Tools/build/check_warnings.py
32+
language_version: python3.12
33+
args: [--line-length=79]
2534
- id: black
2635
name: Run Black on Tools/jit/
2736
files: ^Tools/jit/

‎Android/README.md

Copy file name to clipboardExpand all lines: Android/README.md
+12-11Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
# Python for Android
22

33
These instructions are only needed if you're planning to compile Python for
4-
Android yourself. Most users should *not* need to do this. If you're looking to
5-
use Python on Android, one of the following tools will provide a much more
6-
approachable user experience:
7-
8-
* [Briefcase](https://briefcase.readthedocs.io), from the BeeWare project
9-
* [Buildozer](https://buildozer.readthedocs.io), from the Kivy project
10-
* [Chaquopy](https://chaquo.com/chaquopy/)
4+
Android yourself. Most users should *not* need to do this. Instead, use one of
5+
the tools listed in `Doc/using/android.rst`, which will provide a much easier
6+
experience.
117

128

139
## Prerequisites
@@ -89,10 +85,10 @@ The test suite can be run on Linux, macOS, or Windows:
8985
The test suite can usually be run on a device with 2 GB of RAM, but this is
9086
borderline, so you may need to increase it to 4 GB. As of Android
9187
Studio Koala, 2 GB is the default for all emulators, although the user interface
92-
may indicate otherwise. The effective setting is `hw.ramSize` in
93-
~/.android/avd/*.avd/hardware-qemu.ini, whereas Android Studio displays the
94-
value from config.ini. Changing the value in Android Studio will update both of
95-
these files.
88+
may indicate otherwise. Locate the emulator's directory under `~/.android/avd`,
89+
and find `hw.ramSize` in both config.ini and hardware-qemu.ini. Either set these
90+
manually to the same value, or use the Android Studio Device Manager, which will
91+
update both files.
9692

9793
Before running the test suite, follow the instructions in the previous section
9894
to build the architecture you want to test. Then run the test script in one of
@@ -133,3 +129,8 @@ Every time you run `android.py test`, changes in pure-Python files in the
133129
repository's `Lib` directory will be picked up immediately. Changes in C files,
134130
and architecture-specific files such as sysconfigdata, will not take effect
135131
until you re-run `android.py make-host` or `build`.
132+
133+
134+
## Using in your own app
135+
136+
See `Doc/using/android.rst`.

‎Doc/Makefile

Copy file name to clipboardExpand all lines: Doc/Makefile
+36-4Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,26 @@ venv:
182182
echo "The venv has been created in the $(VENVDIR) directory"; \
183183
fi
184184

185+
.PHONY: dist-no-html
186+
dist-no-html: dist-text dist-pdf dist-epub dist-texinfo
187+
185188
.PHONY: dist
186189
dist:
187190
rm -rf dist
188191
mkdir -p dist
189-
192+
$(MAKE) dist-html
193+
$(MAKE) dist-text
194+
$(MAKE) dist-pdf
195+
$(MAKE) dist-epub
196+
$(MAKE) dist-texinfo
197+
198+
.PHONY: dist-html
199+
dist-html:
190200
# archive the HTML
191201
@echo "Building HTML..."
202+
mkdir -p dist
203+
rm -rf build/html
204+
find dist -name 'python-$(DISTVERSION)-docs-html*' -exec rm -rf {} \;
192205
$(MAKE) html
193206
cp -pPR build/html dist/python-$(DISTVERSION)-docs-html
194207
tar -C dist -cf dist/python-$(DISTVERSION)-docs-html.tar python-$(DISTVERSION)-docs-html
@@ -198,8 +211,13 @@ dist:
198211
rm dist/python-$(DISTVERSION)-docs-html.tar
199212
@echo "Build finished and archived!"
200213

214+
.PHONY: dist-text
215+
dist-text:
201216
# archive the text build
202217
@echo "Building text..."
218+
mkdir -p dist
219+
rm -rf build/text
220+
find dist -name 'python-$(DISTVERSION)-docs-text*' -exec rm -rf {} \;
203221
$(MAKE) text
204222
cp -pPR build/text dist/python-$(DISTVERSION)-docs-text
205223
tar -C dist -cf dist/python-$(DISTVERSION)-docs-text.tar python-$(DISTVERSION)-docs-text
@@ -209,9 +227,13 @@ dist:
209227
rm dist/python-$(DISTVERSION)-docs-text.tar
210228
@echo "Build finished and archived!"
211229

230+
.PHONY: dist-pdf
231+
dist-pdf:
212232
# archive the A4 latex
213233
@echo "Building LaTeX (A4 paper)..."
234+
mkdir -p dist
214235
rm -rf build/latex
236+
find dist -name 'python-$(DISTVERSION)-docs-pdf*' -exec rm -rf {} \;
215237
$(MAKE) latex PAPER=a4
216238
# remove zip & bz2 dependency on all-pdf,
217239
# as otherwise the full latexmk process is run twice.
@@ -222,16 +244,24 @@ dist:
222244
cp build/latex/docs-pdf.tar.bz2 dist/python-$(DISTVERSION)-docs-pdf-a4.tar.bz2
223245
@echo "Build finished and archived!"
224246

247+
.PHONY: dist-epub
248+
dist-epub:
225249
# copy the epub build
226250
@echo "Building EPUB..."
251+
mkdir -p dist
227252
rm -rf build/epub
253+
rm -f dist/python-$(DISTVERSION)-docs.epub
228254
$(MAKE) epub
229255
cp -pPR build/epub/Python.epub dist/python-$(DISTVERSION)-docs.epub
230256
@echo "Build finished and archived!"
231257

258+
.PHONY: dist-texinfo
259+
dist-texinfo:
232260
# archive the texinfo build
233261
@echo "Building Texinfo..."
262+
mkdir -p dist
234263
rm -rf build/texinfo
264+
find dist -name 'python-$(DISTVERSION)-docs-texinfo*' -exec rm -rf {} \;
235265
$(MAKE) texinfo
236266
$(MAKE) info --directory=build/texinfo
237267
cp -pPR build/texinfo dist/python-$(DISTVERSION)-docs-texinfo
@@ -275,13 +305,15 @@ serve:
275305

276306
# for development releases: always build
277307
.PHONY: autobuild-dev
308+
autobuild-dev: DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py --short)
278309
autobuild-dev:
279-
$(MAKE) dist SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
310+
$(MAKE) dist-no-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1' DISTVERSION=$(DISTVERSION)
280311

281-
# for quick rebuilds (HTML only)
312+
# for HTML-only rebuilds
282313
.PHONY: autobuild-dev-html
314+
autobuild-dev-html: DISTVERSION = $(shell $(PYTHON) tools/extensions/patchlevel.py --short)
283315
autobuild-dev-html:
284-
$(MAKE) html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1'
316+
$(MAKE) dist-html SPHINXOPTS='$(SPHINXOPTS) -Ea -A daily=1' DISTVERSION=$(DISTVERSION)
285317

286318
# for stable releases: only build if not in pre-release stage (alpha, beta)
287319
# release candidate downloads are okay, since the stable tree can be in that stage

‎Doc/c-api/code.rst

Copy file name to clipboardExpand all lines: Doc/c-api/code.rst
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ bound into a function.
3232
3333
.. c:function:: Py_ssize_t PyCode_GetNumFree(PyCodeObject *co)
3434
35-
Return the number of free variables in a code object.
35+
Return the number of :term:`free (closure) variables <closure variable>`
36+
in a code object.
3637
3738
.. c:function:: int PyUnstable_Code_GetFirstFree(PyCodeObject *co)
3839
39-
Return the position of the first free variable in a code object.
40+
Return the position of the first :term:`free (closure) variable <closure variable>`
41+
in a code object.
4042
4143
.. versionchanged:: 3.13
4244
@@ -144,7 +146,8 @@ bound into a function.
144146
145147
Equivalent to the Python code ``getattr(co, 'co_freevars')``.
146148
Returns a new reference to a :c:type:`PyTupleObject` containing the names of
147-
the free variables. On error, ``NULL`` is returned and an exception is raised.
149+
the :term:`free (closure) variables <closure variable>`. On error, ``NULL`` is returned
150+
and an exception is raised.
148151
149152
.. versionadded:: 3.11
150153

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.