Skip to content

Commit 283f1eb

Browse files
Merge branch 'main' into test_tk
2 parents 6ed9f3e + 3581c7a commit 283f1eb

File tree

504 files changed

+22698
-9684
lines changed

Some content is hidden

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

504 files changed

+22698
-9684
lines changed

‎.azure-pipelines/ci.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(build.sourceBranchName)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1l
60+
openssl_version: 1.1.1m
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1l
86+
openssl_version: 1.1.1m
8787

8888
steps:
8989
- template: ./posix-steps.yml

‎.azure-pipelines/pr.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
variables:
5858
testRunTitle: '$(system.pullRequest.TargetBranch)-linux'
5959
testRunPlatform: linux
60-
openssl_version: 1.1.1l
60+
openssl_version: 1.1.1m
6161

6262
steps:
6363
- template: ./posix-steps.yml
@@ -83,7 +83,7 @@ jobs:
8383
variables:
8484
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
8585
testRunPlatform: linux-coverage
86-
openssl_version: 1.1.1l
86+
openssl_version: 1.1.1m
8787

8888
steps:
8989
- template: ./posix-steps.yml

‎.github/CODEOWNERS‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ Lib/ast.py @isidentical
130130

131131
**/*typing* @gvanrossum @Fidget-Spinner
132132

133+
**/*asyncore @giampaolo
134+
**/*asynchat @giampaolo
133135
**/*ftplib @giampaolo
134136
**/*shutil @giampaolo
135137

‎.github/workflows/build.yml‎

Lines changed: 42 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@ jobs:
6464
- uses: actions/setup-python@v2
6565
- name: Install Dependencies
6666
run: sudo ./.github/workflows/posix-deps-apt.sh
67+
- name: Add ccache to PATH
68+
run: echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
69+
- name: Configure ccache action
70+
uses: hendrikmuhs/ccache-action@v1
71+
- name: Check Autoconf version 2.69 and aclocal 1.16.3
72+
run: |
73+
grep "Generated by GNU Autoconf 2.69" configure
74+
grep "aclocal 1.16.3" aclocal.m4
75+
grep -q "runstatedir" configure
76+
grep -q "PKG_PROG_PKG_CONFIG" aclocal.m4
77+
- name: Regenerate autoconf files
78+
run: docker run --rm -v $(pwd):/src quay.io/tiran/cpython_autoconf:269
6779
- name: Build CPython
6880
run: |
6981
# Build Python with the libpython dynamic library
@@ -75,20 +87,19 @@ jobs:
7587
git add -u
7688
changes=$(git status --porcelain)
7789
# Check for changes in regenerated files
78-
if ! test -z "$changes"
79-
then
80-
echo "Generated files not up to date. Perhaps you forgot to run make regen-all or build.bat --regen ;)"
90+
if test -n "$changes"; then
91+
echo "Generated files not up to date."
92+
echo "Perhaps you forgot to run make regen-all or build.bat --regen. ;)"
93+
echo "configure files must be regenerated with a specific version of autoconf."
8194
echo "$changes"
95+
echo ""
96+
git diff --staged || true
8297
exit 1
8398
fi
8499
- name: Check exported libpython symbols
85100
run: make smelly
86101
- name: Check limited ABI symbols
87102
run: make check-limited-abi
88-
- name: Check Autoconf version 2.69
89-
run: |
90-
grep "Generated by GNU Autoconf 2.69" configure
91-
grep "PKG_PROG_PKG_CONFIG" aclocal.m4
92103

93104
build_win32:
94105
name: 'Windows (x86)'
@@ -152,7 +163,7 @@ jobs:
152163
needs: check_source
153164
if: needs.check_source.outputs.run_tests == 'true'
154165
env:
155-
OPENSSL_VER: 1.1.1l
166+
OPENSSL_VER: 1.1.1m
156167
PYTHONSTRICTEXTENSIONBUILD: 1
157168
steps:
158169
- uses: actions/checkout@v2
@@ -167,7 +178,7 @@ jobs:
167178
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
168179
- name: 'Restore OpenSSL build'
169180
id: cache-openssl
170-
uses: actions/[email protected].6
181+
uses: actions/[email protected].7
171182
with:
172183
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
173184
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -179,13 +190,28 @@ jobs:
179190
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
180191
- name: Configure ccache action
181192
uses: hendrikmuhs/ccache-action@v1
182-
- name: Configure CPython
183-
run: ./configure --with-pydebug --with-openssl=$OPENSSL_DIR
184-
- name: Build CPython
193+
- name: Setup directory envs for out-of-tree builds
194+
run: |
195+
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
196+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
197+
- name: Create directories for read-only out-of-tree builds
198+
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
199+
- name: Bind mount sources read-only
200+
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
201+
- name: Configure CPython out-of-tree
202+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
203+
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
204+
- name: Build CPython out-of-tree
205+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
185206
run: make -j4
186207
- name: Display build info
208+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
187209
run: make pythoninfo
210+
- name: Remount sources writable for tests
211+
# some tests write to srcdir, lack of pyc files slows down testing
212+
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
188213
- name: Tests
214+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
189215
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
190216

191217
build_ubuntu_ssltests:
@@ -196,7 +222,7 @@ jobs:
196222
strategy:
197223
fail-fast: false
198224
matrix:
199-
openssl_ver: [1.1.1l, 3.0.0]
225+
openssl_ver: [1.1.1m, 3.0.1]
200226
env:
201227
OPENSSL_VER: ${{ matrix.openssl_ver }}
202228
MULTISSL_DIR: ${{ github.workspace }}/multissl
@@ -215,7 +241,7 @@ jobs:
215241
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
216242
- name: 'Restore OpenSSL build'
217243
id: cache-openssl
218-
uses: actions/[email protected].6
244+
uses: actions/[email protected].7
219245
with:
220246
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
221247
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
@@ -243,7 +269,7 @@ jobs:
243269
needs: check_source
244270
if: needs.check_source.outputs.run_tests == 'true'
245271
env:
246-
OPENSSL_VER: 1.1.1l
272+
OPENSSL_VER: 1.1.1m
247273
PYTHONSTRICTEXTENSIONBUILD: 1
248274
ASAN_OPTIONS: detect_leaks=0:allocator_may_return_null=1:handle_segv=0
249275
steps:
@@ -259,7 +285,7 @@ jobs:
259285
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
260286
- name: 'Restore OpenSSL build'
261287
id: cache-openssl
262-
uses: actions/[email protected].6
288+
uses: actions/[email protected].7
263289
with:
264290
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
265291
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}

‎.github/workflows/doc.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,15 @@ jobs:
3838
run: make -j4
3939
- name: 'Install build dependencies'
4040
run: make -C Doc/ PYTHON=../python venv
41-
- name: 'Build documentation'
42-
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest html
41+
# Run "check doctest html" as 3 steps to get a more readable output
42+
# in the web UI
43+
- name: 'Check documentation'
44+
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" check
45+
# Use "xvfb-run" since some doctest tests open GUI windows
46+
- name: 'Run documentation doctest'
47+
run: xvfb-run make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" doctest
48+
- name: 'Build HTML documentation'
49+
run: make -C Doc/ PYTHON=../python SPHINXOPTS="-q -W --keep-going -j4" html
4350
- name: 'Upload'
4451
uses: actions/[email protected]
4552
with:

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ Tools/unicode/data/
115115
/config.log
116116
/config.status
117117
/config.status.lineno
118+
# hendrikmuhs/ccache-action@v1
119+
/.ccache
118120
/platform
119121
/profile-clean-stamp
120122
/profile-run-stamp

‎Doc/c-api/apiabiversion.rst‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,14 @@ See :ref:`stable` for a discussion of API and ABI stability across versions.
5858
Thus ``3.4.1a2`` is hexversion ``0x030401a2`` and ``3.10.0`` is
5959
hexversion ``0x030a00f0``.
6060

61+
This version is also available via the symbol :data:`Py_Version`.
62+
63+
.. c:var:: const unsigned long Py_Version
64+
65+
The Python runtime version number encoded in a single constant integer, with
66+
the same format as the :c:macro:`PY_VERSION_HEX` macro.
67+
This contains the Python version used at run time.
68+
69+
.. versionadded:: 3.11
6170

6271
All the given macros are defined in :source:`Include/patchlevel.h`.

‎Doc/c-api/buffer.rst‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -470,27 +470,27 @@ Buffer-related functions
470470
.. versionadded:: 3.9
471471
472472
473-
.. c:function:: int PyBuffer_IsContiguous(Py_buffer *view, char order)
473+
.. c:function:: int PyBuffer_IsContiguous(const Py_buffer *view, char order)
474474
475475
Return ``1`` if the memory defined by the *view* is C-style (*order* is
476476
``'C'``) or Fortran-style (*order* is ``'F'``) :term:`contiguous` or either one
477477
(*order* is ``'A'``). Return ``0`` otherwise. This function always succeeds.
478478
479479
480-
.. c:function:: void* PyBuffer_GetPointer(Py_buffer *view, Py_ssize_t *indices)
480+
.. c:function:: void* PyBuffer_GetPointer(const Py_buffer *view, const Py_ssize_t *indices)
481481
482482
Get the memory area pointed to by the *indices* inside the given *view*.
483483
*indices* must point to an array of ``view->ndim`` indices.
484484
485485
486-
.. c:function:: int PyBuffer_FromContiguous(Py_buffer *view, void *buf, Py_ssize_t len, char fort)
486+
.. c:function:: int PyBuffer_FromContiguous(const Py_buffer *view, const void *buf, Py_ssize_t len, char fort)
487487
488488
Copy contiguous *len* bytes from *buf* to *view*.
489489
*fort* can be ``'C'`` or ``'F'`` (for C-style or Fortran-style ordering).
490490
``0`` is returned on success, ``-1`` on error.
491491
492492
493-
.. c:function:: int PyBuffer_ToContiguous(void *buf, Py_buffer *src, Py_ssize_t len, char order)
493+
.. c:function:: int PyBuffer_ToContiguous(void *buf, const Py_buffer *src, Py_ssize_t len, char order)
494494
495495
Copy *len* bytes from *src* to its contiguous representation in *buf*.
496496
*order* can be ``'C'`` or ``'F'`` or ``'A'`` (for C-style or Fortran-style

‎Doc/c-api/capsule.rst‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,14 @@ Refer to :ref:`using-capsules` for more information on using these objects.
103103
Import a pointer to a C object from a capsule attribute in a module. The
104104
*name* parameter should specify the full name to the attribute, as in
105105
``module.attribute``. The *name* stored in the capsule must match this
106-
string exactly. If *no_block* is true, import the module without blocking
107-
(using :c:func:`PyImport_ImportModuleNoBlock`). If *no_block* is false,
108-
import the module conventionally (using :c:func:`PyImport_ImportModule`).
106+
string exactly.
109107
110108
Return the capsule's internal *pointer* on success. On failure, set an
111109
exception and return ``NULL``.
112110
111+
.. versionchanged:: 3.3
112+
*no_block* has no effect anymore.
113+
113114
114115
.. c:function:: int PyCapsule_IsValid(PyObject *capsule, const char *name)
115116

‎Doc/c-api/init.rst‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,8 @@ Process-wide parameters
553553
period. The returned string points into static storage; the caller should not
554554
modify its value. The value is available to Python code as :data:`sys.version`.
555555
556+
See also the :data:`Py_Version` constant.
557+
556558
557559
.. c:function:: const char* Py_GetPlatform()
558560

0 commit comments

Comments
 (0)