Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef7b10d

Browse files
authored
Merge branch 'main' into bpo-14817
2 parents ee762ab + 25db95d commit ef7b10d

File tree

988 files changed

+43919
-22955
lines changed

Some content is hidden

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

988 files changed

+43919
-22955
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ ENV WASMTIME_HOME=/opt/wasmtime
99
ENV WASMTIME_VERSION=7.0.0
1010
ENV WASMTIME_CPU_ARCH=x86_64
1111

12-
RUN dnf -y --nodocs install git clang xz python3-blurb dnf-plugins-core && \
13-
dnf -y --nodocs builddep python3 && \
12+
RUN dnf -y --nodocs --setopt=install_weak_deps=False install /usr/bin/{blurb,clang,curl,git,ln,tar,xz} 'dnf-command(builddep)' && \
13+
dnf -y --nodocs --setopt=install_weak_deps=False builddep python3 && \
1414
dnf -y clean all
1515

1616
RUN mkdir ${WASI_SDK_PATH} && \

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ Lib/test/test_importlib/resources/data01/* noeol
3232
Lib/test/test_importlib/resources/namespacedata01/* noeol
3333
Lib/test/xmltestdata/* noeol
3434

35+
# Shell scripts should have LF even on Windows because of Cygwin
36+
Lib/venv/scripts/common/activate text eol=lf
37+
Lib/venv/scripts/posix/* text eol=lf
38+
3539
# CRLF files
3640
[attr]dos text eol=crlf
3741

.github/CODEOWNERS

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@
77
# GitHub
88
.github/** @ezio-melotti @hugovk
99

10+
# pre-commit
11+
.pre-commit-config.yaml @hugovk @AlexWaygood
12+
1013
# Build system
1114
configure* @erlend-aasland @corona10
1215

1316
# asyncio
14-
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303
17+
**/*asyncio* @1st1 @asvetlov @gvanrossum @kumaraditya303 @willingc
1518

1619
# Core
1720
**/*context* @1st1
@@ -25,6 +28,8 @@ Objects/frameobject.c @markshannon
2528
Objects/call.c @markshannon
2629
Python/ceval.c @markshannon
2730
Python/compile.c @markshannon @iritkatriel
31+
Python/assemble.c @markshannon @iritkatriel
32+
Python/flowgraph.c @markshannon @iritkatriel
2833
Python/ast_opt.c @isidentical
2934
Lib/test/test_patma.py @brandtbucher
3035
Lib/test/test_peepholer.py @brandtbucher
@@ -61,11 +66,7 @@ Python/traceback.c @iritkatriel
6166
/Tools/build/parse_html5_entities.py @ezio-melotti
6267

6368
# Import (including importlib).
64-
# Ignoring importlib.h so as to not get flagged on
65-
# all pull requests that change the emitted
66-
# bytecode.
67-
**/*import*.c @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
68-
**/*import*.py @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
69+
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6970
**/*importlib/resources/* @jaraco @warsaw @FFY00
7071
**/importlib/metadata/* @jaraco @warsaw
7172

.github/workflows/build.yml

Lines changed: 110 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ jobs:
3333
check_source:
3434
name: 'Check for source changes'
3535
runs-on: ubuntu-latest
36+
timeout-minutes: 10
3637
outputs:
3738
run_tests: ${{ steps.check.outputs.run_tests }}
39+
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
3840
steps:
3941
- uses: actions/checkout@v3
4042
- name: Check for source changes
@@ -60,9 +62,21 @@ jobs:
6062
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
6163
fi
6264
65+
# Check if we should run hypothesis tests
66+
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
67+
echo $GIT_BRANCH
68+
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
69+
echo "Branch too old for hypothesis tests"
70+
echo "run_hypothesis=false" >> $GITHUB_OUTPUT
71+
else
72+
echo "Run hypothesis tests"
73+
echo "run_hypothesis=true" >> $GITHUB_OUTPUT
74+
fi
75+
6376
check_generated_files:
6477
name: 'Check if generated files are up to date'
6578
runs-on: ubuntu-latest
79+
timeout-minutes: 60
6680
needs: check_source
6781
if: needs.check_source.outputs.run_tests == 'true'
6882
steps:
@@ -118,6 +132,7 @@ jobs:
118132
build_win32:
119133
name: 'Windows (x86)'
120134
runs-on: windows-latest
135+
timeout-minutes: 60
121136
needs: check_source
122137
if: needs.check_source.outputs.run_tests == 'true'
123138
env:
@@ -126,7 +141,6 @@ jobs:
126141
- uses: actions/checkout@v3
127142
- name: Build CPython
128143
run: .\PCbuild\build.bat -e -d -p Win32
129-
timeout-minutes: 30
130144
- name: Display build info
131145
run: .\python.bat -m test.pythoninfo
132146
- name: Tests
@@ -135,6 +149,7 @@ jobs:
135149
build_win_amd64:
136150
name: 'Windows (x64)'
137151
runs-on: windows-latest
152+
timeout-minutes: 60
138153
needs: check_source
139154
if: needs.check_source.outputs.run_tests == 'true'
140155
env:
@@ -145,7 +160,6 @@ jobs:
145160
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
146161
- name: Build CPython
147162
run: .\PCbuild\build.bat -e -d -p x64
148-
timeout-minutes: 30
149163
- name: Display build info
150164
run: .\python.bat -m test.pythoninfo
151165
- name: Tests
@@ -154,6 +168,7 @@ jobs:
154168
build_macos:
155169
name: 'macOS'
156170
runs-on: macos-latest
171+
timeout-minutes: 60
157172
needs: check_source
158173
if: needs.check_source.outputs.run_tests == 'true'
159174
env:
@@ -184,6 +199,7 @@ jobs:
184199
build_ubuntu:
185200
name: 'Ubuntu'
186201
runs-on: ubuntu-20.04
202+
timeout-minutes: 60
187203
needs: check_source
188204
if: needs.check_source.outputs.run_tests == 'true'
189205
env:
@@ -241,6 +257,7 @@ jobs:
241257
build_ubuntu_ssltests:
242258
name: 'Ubuntu SSL tests with OpenSSL'
243259
runs-on: ubuntu-20.04
260+
timeout-minutes: 60
244261
needs: check_source
245262
if: needs.check_source.outputs.run_tests == 'true'
246263
strategy:
@@ -286,10 +303,97 @@ jobs:
286303
- name: SSL tests
287304
run: ./python Lib/test/ssltests.py
288305

306+
test_hypothesis:
307+
name: "Hypothesis Tests on Ubuntu"
308+
runs-on: ubuntu-20.04
309+
timeout-minutes: 60
310+
needs: check_source
311+
if: needs.check_source.outputs.run_tests == 'true' && needs.check_source.outputs.run_hypothesis == 'true'
312+
env:
313+
OPENSSL_VER: 1.1.1t
314+
PYTHONSTRICTEXTENSIONBUILD: 1
315+
steps:
316+
- uses: actions/checkout@v3
317+
- name: Register gcc problem matcher
318+
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
319+
- name: Install Dependencies
320+
run: sudo ./.github/workflows/posix-deps-apt.sh
321+
- name: Configure OpenSSL env vars
322+
run: |
323+
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV
324+
echo "OPENSSL_DIR=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}" >> $GITHUB_ENV
325+
echo "LD_LIBRARY_PATH=${GITHUB_WORKSPACE}/multissl/openssl/${OPENSSL_VER}/lib" >> $GITHUB_ENV
326+
- name: 'Restore OpenSSL build'
327+
id: cache-openssl
328+
uses: actions/cache@v3
329+
with:
330+
path: ./multissl/openssl/${{ env.OPENSSL_VER }}
331+
key: ${{ runner.os }}-multissl-openssl-${{ env.OPENSSL_VER }}
332+
- name: Install OpenSSL
333+
if: steps.cache-openssl.outputs.cache-hit != 'true'
334+
run: python3 Tools/ssl/multissltests.py --steps=library --base-directory $MULTISSL_DIR --openssl $OPENSSL_VER --system Linux
335+
- name: Add ccache to PATH
336+
run: |
337+
echo "PATH=/usr/lib/ccache:$PATH" >> $GITHUB_ENV
338+
- name: Configure ccache action
339+
uses: hendrikmuhs/[email protected]
340+
- name: Setup directory envs for out-of-tree builds
341+
run: |
342+
echo "CPYTHON_RO_SRCDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-ro-srcdir)" >> $GITHUB_ENV
343+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
344+
- name: Create directories for read-only out-of-tree builds
345+
run: mkdir -p $CPYTHON_RO_SRCDIR $CPYTHON_BUILDDIR
346+
- name: Bind mount sources read-only
347+
run: sudo mount --bind -o ro $GITHUB_WORKSPACE $CPYTHON_RO_SRCDIR
348+
- name: Configure CPython out-of-tree
349+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
350+
run: ../cpython-ro-srcdir/configure --with-pydebug --with-openssl=$OPENSSL_DIR
351+
- name: Build CPython out-of-tree
352+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
353+
run: make -j4
354+
- name: Display build info
355+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
356+
run: make pythoninfo
357+
- name: Remount sources writable for tests
358+
# some tests write to srcdir, lack of pyc files slows down testing
359+
run: sudo mount $CPYTHON_RO_SRCDIR -oremount,rw
360+
- name: Setup directory envs for out-of-tree builds
361+
run: |
362+
echo "CPYTHON_BUILDDIR=$(realpath -m ${GITHUB_WORKSPACE}/../cpython-builddir)" >> $GITHUB_ENV
363+
- name: "Create hypothesis venv"
364+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
365+
run: |
366+
VENV_LOC=$(realpath -m .)/hypovenv
367+
VENV_PYTHON=$VENV_LOC/bin/python
368+
echo "HYPOVENV=${VENV_LOC}" >> $GITHUB_ENV
369+
echo "VENV_PYTHON=${VENV_PYTHON}" >> $GITHUB_ENV
370+
./python -m venv $VENV_LOC && $VENV_PYTHON -m pip install -U hypothesis
371+
- name: "Run tests"
372+
working-directory: ${{ env.CPYTHON_BUILDDIR }}
373+
run: |
374+
# Most of the excluded tests are slow test suites with no property tests
375+
#
376+
# (GH-104097) test_sysconfig is skipped because it has tests that are
377+
# failing when executed from inside a virtual environment.
378+
${{ env.VENV_PYTHON }} -m test \
379+
-W \
380+
-o \
381+
-j4 \
382+
-x test_asyncio \
383+
-x test_multiprocessing_fork \
384+
-x test_multiprocessing_forkserver \
385+
-x test_multiprocessing_spawn \
386+
-x test_concurrent_futures \
387+
-x test_socket \
388+
-x test_subprocess \
389+
-x test_signal \
390+
-x test_sysconfig
391+
289392
290393
build_asan:
291394
name: 'Address sanitizer'
292395
runs-on: ubuntu-20.04
396+
timeout-minutes: 60
293397
needs: check_source
294398
if: needs.check_source.outputs.run_tests == 'true'
295399
env:
@@ -302,6 +406,10 @@ jobs:
302406
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
303407
- name: Install Dependencies
304408
run: sudo ./.github/workflows/posix-deps-apt.sh
409+
- name: Set up GCC-10 for ASAN
410+
uses: egor-tensin/setup-gcc@v1
411+
with:
412+
version: 10
305413
- name: Configure OpenSSL env vars
306414
run: |
307415
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV

.github/workflows/build_msi.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
build:
2727
name: Windows Installer
2828
runs-on: windows-latest
29+
timeout-minutes: 60
2930
strategy:
3031
matrix:
3132
type: [x86, x64, arm64]

.github/workflows/doc.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
build_doc:
3737
name: 'Docs'
3838
runs-on: ubuntu-latest
39+
timeout-minutes: 60
3940
steps:
4041
- uses: actions/checkout@v3
4142
- name: Register Sphinx problem matcher
@@ -55,11 +56,13 @@ jobs:
5556

5657
# Add pull request annotations for Sphinx nitpicks (missing references)
5758
- name: 'Get list of changed files'
59+
if: github.event_name == 'pull_request'
5860
id: changed_files
5961
uses: Ana06/[email protected]
6062
with:
6163
filter: "Doc/**"
6264
- name: 'Build changed files in nit-picky mode'
65+
if: github.event_name == 'pull_request'
6366
continue-on-error: true
6467
run: |
6568
# Mark files the pull request modified
@@ -76,10 +79,31 @@ jobs:
7679
# Build docs with the '-n' (nit-picky) option, convert warnings to errors (-W)
7780
make -C Doc/ PYTHON=../python SPHINXOPTS="-q -n -W --keep-going" html 2>&1
7881
82+
# This build doesn't use problem matchers or check annotations
83+
# It also does not run 'make check', as sphinx-lint is not installed into the
84+
# environment.
85+
build_doc_oldest_supported_sphinx:
86+
name: 'Docs (Oldest Sphinx)'
87+
runs-on: ubuntu-latest
88+
timeout-minutes: 60
89+
steps:
90+
- uses: actions/checkout@v3
91+
- name: 'Set up Python'
92+
uses: actions/setup-python@v4
93+
with:
94+
python-version: '3.11' # known to work with Sphinx 3.2
95+
cache: 'pip'
96+
cache-dependency-path: 'Doc/requirements-oldest-sphinx.txt'
97+
- name: 'Install build dependencies'
98+
run: make -C Doc/ venv REQUIREMENTS="requirements-oldest-sphinx.txt"
99+
- name: 'Build HTML documentation'
100+
run: make -C Doc/ SPHINXOPTS="-q" SPHINXERRORHANDLING="-W --keep-going" html
101+
79102
# Run "doctest" on HEAD as new syntax doesn't exist in the latest stable release
80103
doctest:
81104
name: 'Doctest'
82105
runs-on: ubuntu-latest
106+
timeout-minutes: 60
83107
steps:
84108
- uses: actions/checkout@v3
85109
- name: Register Sphinx problem matcher
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Read the Docs PR preview
2+
# Automatically edits a pull request's descriptions with a link
3+
# to the documentation's preview on Read the Docs.
4+
5+
on:
6+
pull_request_target:
7+
types:
8+
- opened
9+
paths:
10+
- 'Doc/**'
11+
- '.github/workflows/doc.yml'
12+
13+
permissions:
14+
pull-requests: write
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
documentation-links:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: readthedocs/actions/preview@v1
25+
with:
26+
project-slug: "cpython-previews"
27+
single-version: "true"

.github/workflows/lint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
permissions:
6+
contents: read
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
lint:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 10
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.x"
22+
- uses: pre-commit/[email protected]

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ permissions:
1111
jobs:
1212
notify-new-bugs-announce:
1313
runs-on: ubuntu-latest
14+
timeout-minutes: 10
1415
steps:
1516
- uses: actions/setup-node@v3
1617
with:

.github/workflows/project-updater.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ jobs:
1313
add-to-project:
1414
name: Add issues to projects
1515
runs-on: ubuntu-latest
16+
timeout-minutes: 10
1617
strategy:
1718
matrix:
1819
include:
1920
# if an issue has any of these labels, it will be added
2021
# to the corresponding project
2122
- { project: 2, label: "release-blocker, deferred-blocker" }
22-
- { project: 3, label: expert-subinterpreters }
23-
- { project: 29, label: expert-asyncio }
2423
- { project: 32, label: sprint }
25-
24+
2625
steps:
2726
- uses: actions/[email protected]
2827
with:

0 commit comments

Comments
 (0)