Skip to content

Commit 0480053

Browse files
committed
Merge branch 'main' of github.com:python/cpython into gh-102251
2 parents 695fd16 + 6a80664 commit 0480053

File tree

628 files changed

+34715
-34642
lines changed

Some content is hidden

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

628 files changed

+34715
-34642
lines changed

.azure-pipelines/ci.yml

+2-16
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,6 @@ jobs:
1414
- template: ./prebuild-checks.yml
1515

1616

17-
- job: Docs_PR
18-
displayName: Docs PR
19-
dependsOn: Prebuild
20-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
21-
22-
pool:
23-
vmImage: ubuntu-22.04
24-
25-
steps:
26-
- template: ./docs-steps.yml
27-
parameters:
28-
upload: true
29-
30-
3117
- job: macOS_CI_Tests
3218
displayName: macOS CI Tests
3319
dependsOn: Prebuild
@@ -57,7 +43,7 @@ jobs:
5743
variables:
5844
testRunTitle: '$(build.sourceBranchName)-linux'
5945
testRunPlatform: linux
60-
openssl_version: 1.1.1t
46+
openssl_version: 1.1.1u
6147

6248
steps:
6349
- template: ./posix-steps.yml
@@ -83,7 +69,7 @@ jobs:
8369
variables:
8470
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8571
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1t
72+
openssl_version: 1.1.1u
8773

8874
steps:
8975
- template: ./posix-steps.yml

.azure-pipelines/docs-steps.yml

-47
This file was deleted.

.azure-pipelines/pr.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,6 @@ jobs:
1414
- template: ./prebuild-checks.yml
1515

1616

17-
- job: Docs_PR
18-
displayName: Docs PR
19-
dependsOn: Prebuild
20-
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
21-
22-
pool:
23-
vmImage: ubuntu-22.04
24-
25-
steps:
26-
- template: ./docs-steps.yml
27-
28-
2917
- job: macOS_PR_Tests
3018
displayName: macOS PR Tests
3119
dependsOn: Prebuild
@@ -57,7 +45,7 @@ jobs:
5745
variables:
5846
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5947
testRunPlatform: linux
60-
openssl_version: 1.1.1t
48+
openssl_version: 1.1.1u
6149

6250
steps:
6351
- template: ./posix-steps.yml
@@ -83,7 +71,7 @@ jobs:
8371
variables:
8472
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8573
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1t
74+
openssl_version: 1.1.1u
8775

8876
steps:
8977
- template: ./posix-steps.yml

.azure-pipelines/prebuild-checks.yml

-12
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,6 @@ steps:
1111
displayName: Fetch comparison tree
1212
condition: and(succeeded(), variables['System.PullRequest.TargetBranch'])
1313

14-
- script: |
15-
if ! git diff --name-only $(diffTarget) | grep -qE '(\.rst$|^Doc|^Misc)'
16-
then
17-
echo "No docs were updated: docs.run=false"
18-
echo "##vso[task.setvariable variable=run;isOutput=true]false"
19-
else
20-
echo "Docs were updated: docs.run=true"
21-
echo "##vso[task.setvariable variable=run;isOutput=true]true"
22-
fi
23-
displayName: Detect documentation changes
24-
name: docs
25-
2614
- script: |
2715
if ! git diff --name-only $(diffTarget) | grep -qvE '(\.rst$|^Doc|^Misc)'
2816
then

.github/CODEOWNERS

+7-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Python/traceback.c @iritkatriel
6868
/Tools/build/parse_html5_entities.py @ezio-melotti
6969

7070
# Import (including importlib).
71-
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
71+
**/*import* @brettcannon @ericsnowcurrently @ncoghlan @warsaw
7272
**/*importlib/resources/* @jaraco @warsaw @FFY00
7373
**/importlib/metadata/* @jaraco @warsaw
7474

@@ -118,6 +118,12 @@ Lib/ast.py @isidentical
118118
/Lib/test/test_subprocess.py @gpshead
119119
/Modules/*subprocess* @gpshead
120120

121+
# Limited C API & stable ABI
122+
Tools/build/stable_abi.py @encukou
123+
Misc/stable_abi.toml @encukou
124+
Doc/data/*.abi @encukou
125+
Doc/c-api/stable.rst @encukou
126+
121127
# Windows
122128
/PC/ @python/windows-team
123129
/PCbuild/ @python/windows-team

.github/workflows/build.yml

+13-26
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,9 @@ jobs:
8787
with:
8888
filter: |
8989
Doc/**
90-
# Temporarily skip paths with spaces
91-
# (i.e. "C API", "Core and Builtins")
92-
# to avoid "Error: One of your files includes a space".
93-
# Pending https://github.com/python/core-workflow/issues/186
94-
# Misc/**
95-
Misc/NEWS.d/next/Build/**
96-
Misc/NEWS.d/next/Documentation/**
97-
Misc/NEWS.d/next/IDLE/**
98-
Misc/NEWS.d/next/Library/**
99-
Misc/NEWS.d/next/Security/**
100-
Misc/NEWS.d/next/Tests/**
101-
Misc/NEWS.d/next/Tools-Demos/**
102-
Misc/NEWS.d/next/Windows/**
103-
Misc/NEWS.d/next/macOS/**
90+
Misc/**
10491
.github/workflows/reusable-docs.yml
92+
format: csv # works for paths with spaces
10593
- name: Check for docs changes
10694
if: >-
10795
github.event_name == 'pull_request'
@@ -136,10 +124,10 @@ jobs:
136124
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
137125
- name: Configure ccache action
138126
uses: hendrikmuhs/[email protected]
139-
- name: Check Autoconf version 2.69 and aclocal 1.16.3
127+
- name: Check Autoconf and aclocal versions
140128
run: |
141-
grep "Generated by GNU Autoconf 2.69" configure
142-
grep "aclocal 1.16.3" aclocal.m4
129+
grep "Generated by GNU Autoconf 2.71" configure
130+
grep "aclocal 1.16.4" aclocal.m4
143131
grep -q "runstatedir" configure
144132
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
145133
- name: Configure CPython
@@ -232,17 +220,16 @@ jobs:
232220
path: config.cache
233221
key: ${{ github.job }}-${{ runner.os }}-${{ needs.check_source.outputs.config_hash }}
234222
- name: Install Homebrew dependencies
235-
run: brew install pkg-config openssl@1.1 xz gdbm tcl-tk
223+
run: brew install pkg-config openssl@3.0 xz gdbm tcl-tk
236224
- name: Configure CPython
237225
run: |
238-
CFLAGS="-I$(brew --prefix gdbm)/include -I$(brew --prefix xz)/include" \
239-
LDFLAGS="-L$(brew --prefix gdbm)/lib -I$(brew --prefix xz)/lib" \
240-
PKG_CONFIG_PATH="$(brew --prefix tcl-tk)/lib/pkgconfig" \
226+
GDBM_CFLAGS="-I$(brew --prefix gdbm)/include" \
227+
GDBM_LIBS="-L$(brew --prefix gdbm)/lib -lgdbm" \
241228
./configure \
242229
--config-cache \
243230
--with-pydebug \
244231
--prefix=/opt/python-dev \
245-
--with-openssl="$(brew --prefix openssl@1.1)"
232+
--with-openssl="$(brew --prefix openssl@3.0)"
246233
- name: Build CPython
247234
run: make -j4
248235
- name: Display build info
@@ -257,7 +244,7 @@ jobs:
257244
needs: check_source
258245
if: needs.check_source.outputs.run_tests == 'true'
259246
env:
260-
OPENSSL_VER: 1.1.1t
247+
OPENSSL_VER: 1.1.1u
261248
PYTHONSTRICTEXTENSIONBUILD: 1
262249
steps:
263250
- uses: actions/checkout@v3
@@ -326,7 +313,7 @@ jobs:
326313
strategy:
327314
fail-fast: false
328315
matrix:
329-
openssl_ver: [1.1.1t, 3.0.8, 3.1.0-beta1]
316+
openssl_ver: [1.1.1u, 3.0.9, 3.1.1]
330317
env:
331318
OPENSSL_VER: ${{ matrix.openssl_ver }}
332319
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -378,7 +365,7 @@ jobs:
378365
needs: check_source
379366
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
380367
env:
381-
OPENSSL_VER: 1.1.1t
368+
OPENSSL_VER: 1.1.1u
382369
PYTHONSTRICTEXTENSIONBUILD: 1
383370
steps:
384371
- uses: actions/checkout@v3
@@ -487,7 +474,7 @@ jobs:
487474
needs: check_source
488475
if: needs.check_source.outputs.run_tests == 'true'
489476
env:
490-
OPENSSL_VER: 1.1.1t
477+
OPENSSL_VER: 1.1.1u
491478
PYTHONSTRICTEXTENSIONBUILD: 1
492479
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
493480
steps:

.github/workflows/reusable-docs.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ jobs:
2828
cache-dependency-path: 'Doc/requirements.txt'
2929
- name: 'Install build dependencies'
3030
run: make -C Doc/ venv
31-
- name: 'Check documentation'
32-
run: make -C Doc/ check
3331
- name: 'Build HTML documentation'
3432
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
3533

@@ -40,12 +38,14 @@ jobs:
4038
uses: Ana06/[email protected]
4139
with:
4240
filter: "Doc/**"
41+
format: csv # works for paths with spaces
4342
- name: 'Build changed files in nit-picky mode'
4443
if: github.event_name == 'pull_request'
4544
continue-on-error: true
4645
run: |
46+
set -Eeuo pipefail
4747
# Mark files the pull request modified
48-
touch ${{ steps.changed_files.outputs.added_modified }}
48+
python Doc/tools/touch-clean-files.py --clean '${{ steps.changed_files.outputs.added_modified }}'
4949
# Build docs with the '-n' (nit-picky) option; convert warnings to annotations
5050
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n --keep-going" html 2>&1 |
5151
python Doc/tools/warnings-to-gh-actions.py
@@ -59,8 +59,6 @@ jobs:
5959
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
6060
6161
# This build doesn't use problem matchers or check annotations
62-
# It also does not run 'make check', as sphinx-lint is not installed into the
63-
# environment.
6462
build_doc_oldest_supported_sphinx:
6563
name: 'Docs (Oldest Sphinx)'
6664
runs-on: ubuntu-latest

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,11 @@ repos:
55
- id: check-yaml
66
- id: trailing-whitespace
77
types_or: [c, python, rst]
8+
9+
- repo: https://github.com/sphinx-contrib/sphinx-lint
10+
rev: v0.6.7
11+
hooks:
12+
- id: sphinx-lint
13+
args: [--enable=default-role]
14+
files: ^Doc/
15+
types: [rst]

Doc/Makefile

+3-5
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,9 @@ dist:
216216
rm dist/python-$(DISTVERSION)-docs-texinfo.tar
217217

218218
.PHONY: check
219-
check:
220-
# Check the docs and NEWS files with sphinx-lint.
221-
# Ignore the tools and venv dirs and check that the default role is not used.
222-
$(SPHINXLINT) -i tools -i $(VENVDIR) --enable default-role
223-
$(SPHINXLINT) --enable default-role ../Misc/NEWS.d/next/
219+
check: venv
220+
$(VENVDIR)/bin/python3 -m pre_commit --version > /dev/null || $(VENVDIR)/bin/python3 -m pip install pre-commit
221+
$(VENVDIR)/bin/python3 -m pre_commit run --all-files
224222

225223
.PHONY: serve
226224
serve:

Doc/c-api/abstract.rst

-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,3 @@ but whose items have not been set to some non-\ ``NULL`` value yet.
2424
mapping.rst
2525
iter.rst
2626
buffer.rst
27-
objbuffer.rst

Doc/c-api/arg.rst

+16-8
Original file line numberDiff line numberDiff line change
@@ -439,16 +439,24 @@ API Functions
439439
.. versionadded:: 3.2
440440
441441
442-
.. XXX deprecated, will be removed
443442
.. c:function:: int PyArg_Parse(PyObject *args, const char *format, ...)
444443
445-
Function used to deconstruct the argument lists of "old-style" functions ---
446-
these are functions which use the :const:`METH_OLDARGS` parameter parsing
447-
method, which has been removed in Python 3. This is not recommended for use
448-
in parameter parsing in new code, and most code in the standard interpreter
449-
has been modified to no longer use this for that purpose. It does remain a
450-
convenient way to decompose other tuples, however, and may continue to be
451-
used for that purpose.
444+
Parse the parameter of a function that takes a single positional parameter
445+
into a local variable. Returns true on success; on failure, it returns
446+
false and raises the appropriate exception.
447+
448+
Example::
449+
450+
// Function using METH_O calling convention
451+
static PyObject*
452+
my_function(PyObject *module, PyObject *arg)
453+
{
454+
int value;
455+
if (!PyArg_Parse(arg, "i:my_function", &value)) {
456+
return NULL;
457+
}
458+
// ... use value ...
459+
}
452460
453461
454462
.. c:function:: int PyArg_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, ...)

0 commit comments

Comments
 (0)