Skip to content

Commit 205ae85

Browse files
authored
Merge branch 'main' into fix-test_venv-python-symlink
2 parents b75f881 + 278030a commit 205ae85

File tree

1,283 files changed

+68832
-71923
lines changed

Some content is hidden

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

1,283 files changed

+68832
-71923
lines changed

.devcontainer/Dockerfile

+2-2
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} && \

.devcontainer/devcontainer.json

+6
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@
3737
// "ms-python.python"
3838
],
3939
"settings": {
40+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
4041
"C_Cpp.default.cStandard": "c11",
4142
"C_Cpp.default.defines": [
43+
"CONFIG_64",
4244
"Py_BUILD_CORE"
4345
],
46+
"C_Cpp.default.includePath": [
47+
"${workspaceFolder}/*",
48+
"${workspaceFolder}/Include/**"
49+
],
4450
// https://github.com/microsoft/vscode-cpptools/issues/10732
4551
"C_Cpp.errorSquiggles": "disabled",
4652
"editor.insertSpaces": true,

.gitattributes

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
*.zip binary
1919

2020
# Specific binary files
21-
Lib/test/sndhdrdata/sndhdr.* binary
2221
PC/classicAppCompat.* binary
2322

2423
# Text files that should not be subject to eol conversion
@@ -32,6 +31,10 @@ Lib/test/test_importlib/resources/data01/* noeol
3231
Lib/test/test_importlib/resources/namespacedata01/* noeol
3332
Lib/test/xmltestdata/* noeol
3433

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

.github/CODEOWNERS

+12-7
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,36 @@
55
# https://git-scm.com/docs/gitignore#_pattern_format
66

77
# GitHub
8-
.github/** @ezio-melotti
8+
.github/** @ezio-melotti @hugovk
9+
10+
# pre-commit
11+
.pre-commit-config.yaml @hugovk @AlexWaygood
912

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
1821
**/*genobject* @markshannon
1922
**/*hamt* @1st1
2023
Objects/set* @rhettinger
2124
Objects/dict* @methane @markshannon
25+
Objects/typevarobject.c @JelleZijlstra
2226
Objects/type* @markshannon
2327
Objects/codeobject.c @markshannon
2428
Objects/frameobject.c @markshannon
2529
Objects/call.c @markshannon
2630
Python/ceval.c @markshannon
2731
Python/compile.c @markshannon @iritkatriel
32+
Python/assemble.c @markshannon @iritkatriel
33+
Python/flowgraph.c @markshannon @iritkatriel
2834
Python/ast_opt.c @isidentical
2935
Lib/test/test_patma.py @brandtbucher
3036
Lib/test/test_peepholer.py @brandtbucher
37+
Lib/test/test_type_*.py @JelleZijlstra
3138

3239
# Exceptions
3340
Lib/traceback.py @iritkatriel
@@ -61,11 +68,7 @@ Python/traceback.c @iritkatriel
6168
/Tools/build/parse_html5_entities.py @ezio-melotti
6269

6370
# 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
71+
**/*import* @brettcannon @encukou @ericsnowcurrently @ncoghlan @warsaw
6972
**/*importlib/resources/* @jaraco @warsaw @FFY00
7073
**/importlib/metadata/* @jaraco @warsaw
7174

@@ -94,6 +97,8 @@ Include/pytime.h @pganssle @abalkin
9497
/Tools/peg_generator/ @pablogsal @lysnikolaou
9598
/Lib/test/test_peg_generator/ @pablogsal @lysnikolaou
9699
/Grammar/python.gram @pablogsal @lysnikolaou
100+
/Lib/tokenize.py @pablogsal @lysnikolaou
101+
/Lib/test/test_tokenize.py @pablogsal @lysnikolaou
97102

98103
# AST
99104
Python/ast.c @isidentical

.github/dependabot.yml

+7
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,10 @@ updates:
1212
update-types:
1313
- "version-update:semver-minor"
1414
- "version-update:semver-patch"
15+
- package-ecosystem: "pip"
16+
directory: "/Tools/clinic/"
17+
schedule:
18+
interval: "monthly"
19+
labels:
20+
- "skip issue"
21+
- "skip news"

.github/workflows/build.yml

+125-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
push:
99
branches:
1010
- 'main'
11+
- '3.12'
1112
- '3.11'
1213
- '3.10'
1314
- '3.9'
@@ -16,6 +17,7 @@ on:
1617
pull_request:
1718
branches:
1819
- 'main'
20+
- '3.12'
1921
- '3.11'
2022
- '3.10'
2123
- '3.9'
@@ -33,8 +35,10 @@ jobs:
3335
check_source:
3436
name: 'Check for source changes'
3537
runs-on: ubuntu-latest
38+
timeout-minutes: 10
3639
outputs:
3740
run_tests: ${{ steps.check.outputs.run_tests }}
41+
run_hypothesis: ${{ steps.check.outputs.run_hypothesis }}
3842
steps:
3943
- uses: actions/checkout@v3
4044
- name: Check for source changes
@@ -60,9 +64,21 @@ jobs:
6064
git diff --name-only origin/$GITHUB_BASE_REF.. | grep -qvE '(\.rst$|^Doc|^Misc)' && echo "run_tests=true" >> $GITHUB_OUTPUT || true
6165
fi
6266
67+
# Check if we should run hypothesis tests
68+
GIT_BRANCH=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}
69+
echo $GIT_BRANCH
70+
if $(echo "$GIT_BRANCH" | grep -q -w '3\.\(8\|9\|10\|11\)'); then
71+
echo "Branch too old for hypothesis tests"
72+
echo "run_hypothesis=false" >> $GITHUB_OUTPUT
73+
else
74+
echo "Run hypothesis tests"
75+
echo "run_hypothesis=true" >> $GITHUB_OUTPUT
76+
fi
77+
6378
check_generated_files:
6479
name: 'Check if generated files are up to date'
6580
runs-on: ubuntu-latest
81+
timeout-minutes: 60
6682
needs: check_source
6783
if: needs.check_source.outputs.run_tests == 'true'
6884
steps:
@@ -118,6 +134,7 @@ jobs:
118134
build_win32:
119135
name: 'Windows (x86)'
120136
runs-on: windows-latest
137+
timeout-minutes: 60
121138
needs: check_source
122139
if: needs.check_source.outputs.run_tests == 'true'
123140
env:
@@ -126,7 +143,6 @@ jobs:
126143
- uses: actions/checkout@v3
127144
- name: Build CPython
128145
run: .\PCbuild\build.bat -e -d -p Win32
129-
timeout-minutes: 30
130146
- name: Display build info
131147
run: .\python.bat -m test.pythoninfo
132148
- name: Tests
@@ -135,6 +151,7 @@ jobs:
135151
build_win_amd64:
136152
name: 'Windows (x64)'
137153
runs-on: windows-latest
154+
timeout-minutes: 60
138155
needs: check_source
139156
if: needs.check_source.outputs.run_tests == 'true'
140157
env:
@@ -145,7 +162,6 @@ jobs:
145162
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
146163
- name: Build CPython
147164
run: .\PCbuild\build.bat -e -d -p x64
148-
timeout-minutes: 30
149165
- name: Display build info
150166
run: .\python.bat -m test.pythoninfo
151167
- name: Tests
@@ -154,6 +170,7 @@ jobs:
154170
build_macos:
155171
name: 'macOS'
156172
runs-on: macos-latest
173+
timeout-minutes: 60
157174
needs: check_source
158175
if: needs.check_source.outputs.run_tests == 'true'
159176
env:
@@ -184,6 +201,7 @@ jobs:
184201
build_ubuntu:
185202
name: 'Ubuntu'
186203
runs-on: ubuntu-20.04
204+
timeout-minutes: 60
187205
needs: check_source
188206
if: needs.check_source.outputs.run_tests == 'true'
189207
env:
@@ -241,6 +259,7 @@ jobs:
241259
build_ubuntu_ssltests:
242260
name: 'Ubuntu SSL tests with OpenSSL'
243261
runs-on: ubuntu-20.04
262+
timeout-minutes: 60
244263
needs: check_source
245264
if: needs.check_source.outputs.run_tests == 'true'
246265
strategy:
@@ -286,10 +305,110 @@ jobs:
286305
- name: SSL tests
287306
run: ./python Lib/test/ssltests.py
288307

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

290408
build_asan:
291409
name: 'Address sanitizer'
292410
runs-on: ubuntu-20.04
411+
timeout-minutes: 60
293412
needs: check_source
294413
if: needs.check_source.outputs.run_tests == 'true'
295414
env:
@@ -302,6 +421,10 @@ jobs:
302421
run: echo "::add-matcher::.github/problem-matchers/gcc.json"
303422
- name: Install Dependencies
304423
run: sudo ./.github/workflows/posix-deps-apt.sh
424+
- name: Set up GCC-10 for ASAN
425+
uses: egor-tensin/setup-gcc@v1
426+
with:
427+
version: 10
305428
- name: Configure OpenSSL env vars
306429
run: |
307430
echo "MULTISSL_DIR=${GITHUB_WORKSPACE}/multissl" >> $GITHUB_ENV

.github/workflows/build_msi.yml

+1
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]

0 commit comments

Comments
 (0)