Skip to content

Commit 29853b9

Browse files
committed
Merge branch 'main' into tcltk_race_master
# Conflicts: # Lib/test/test_tkinter/test_threads.py # Modules/_tkinter.c
2 parents c500908 + 990ad27 commit 29853b9

File tree

5,506 files changed

+1456457
-552048
lines changed

Some content is hidden

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

5,506 files changed

+1456457
-552048
lines changed

.azure-pipelines/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
trigger: ['main', '3.13', '3.12', '3.11', '3.10', '3.9', '3.8']
2+
3+
jobs:
4+
- job: Prebuild
5+
displayName: Pre-build checks
6+
7+
pool:
8+
vmImage: ubuntu-24.04
9+
10+
steps:
11+
- template: ./prebuild-checks.yml
12+
13+
14+
- job: Windows_CI_Tests
15+
displayName: Windows CI Tests
16+
dependsOn: Prebuild
17+
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
18+
19+
pool:
20+
vmImage: windows-2022
21+
22+
strategy:
23+
matrix:
24+
win32:
25+
arch: win32
26+
buildOpt: '-p Win32'
27+
testRunTitle: '$(Build.SourceBranchName)-win32'
28+
testRunPlatform: win32
29+
win64:
30+
arch: amd64
31+
buildOpt: '-p x64'
32+
testRunTitle: '$(Build.SourceBranchName)-win64'
33+
testRunPlatform: win64
34+
maxParallel: 4
35+
36+
steps:
37+
- template: ./windows-steps.yml
38+
39+
- template: ./windows-layout-steps.yml
40+
parameters:
41+
kind: nuget
42+
- template: ./windows-layout-steps.yml
43+
parameters:
44+
kind: embed
45+
- template: ./windows-layout-steps.yml
46+
parameters:
47+
kind: appx
48+
fulltest: true
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
steps:
2+
- checkout: self
3+
fetchDepth: 5
4+
5+
- script: echo "##vso[task.setvariable variable=diffTarget]HEAD~1"
6+
displayName: Set default diff target
7+
8+
- script: |
9+
git fetch -q origin $(System.PullRequest.TargetBranch)
10+
echo "##vso[task.setvariable variable=diffTarget]HEAD \$(git merge-base HEAD FETCH_HEAD)"
11+
displayName: Fetch comparison tree
12+
condition: and(succeeded(), variables['System.PullRequest.TargetBranch'])
13+
14+
- script: |
15+
if ! git diff --name-only $(diffTarget) | grep -qvE '(\.rst$|^Doc|^Misc)'
16+
then
17+
echo "Only docs were updated: tests.run=false"
18+
echo "##vso[task.setvariable variable=run;isOutput=true]false"
19+
else
20+
echo "Code was updated: tests.run=true"
21+
echo "##vso[task.setvariable variable=run;isOutput=true]true"
22+
fi
23+
displayName: Detect source changes
24+
name: tests
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
parameters:
2+
kind: nuget
3+
extraOpts: --precompile
4+
fulltest: false
5+
6+
steps:
7+
- script: .\python.bat PC\layout -vv -s "$(Build.SourcesDirectory)" -b "$(Py_OutDir)\$(arch)" -t "$(Build.BinariesDirectory)\layout-tmp-${{ parameters.kind }}-$(arch)" --copy "$(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)" ${{ parameters.extraOpts }} --preset-${{ parameters.kind }} --include-tests
8+
displayName: Create ${{ parameters.kind }} layout
9+
10+
- script: .\python.exe -m test.pythoninfo
11+
workingDirectory: $(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)
12+
displayName: Show layout info (${{ parameters.kind }})
13+
14+
- ${{ if eq(parameters.fulltest, 'true') }}:
15+
- script: .\python.exe -m test -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results-${{ parameters.kind }}.xml" --tempdir "$(Build.BinariesDirectory)\tmp-${{ parameters.kind }}-$(arch)" -i test_launcher
16+
workingDirectory: $(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)
17+
displayName: ${{ parameters.kind }} Tests
18+
env:
19+
PREFIX: $(Build.BinariesDirectory)\layout-${{ parameters.kind }}-$(arch)
20+
21+
- task: PublishTestResults@2
22+
displayName: Publish ${{ parameters.kind }} Test Results
23+
inputs:
24+
testResultsFiles: $(Build.BinariesDirectory)\test-results-${{ parameters.kind }}.xml
25+
mergeTestResults: true
26+
testRunTitle: ${{ parameters.kind }}-$(testRunTitle)
27+
platform: $(testRunPlatform)
28+
condition: succeededOrFailed()

.azure-pipelines/windows-steps.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
steps:
2+
- checkout: self
3+
clean: false
4+
fetchDepth: 5
5+
6+
- powershell: |
7+
# Relocate build outputs outside of source directory to make cleaning faster
8+
Write-Host '##vso[task.setvariable variable=Py_IntDir]$(Build.BinariesDirectory)\obj'
9+
# UNDONE: Do not build to a different directory because of broken tests
10+
Write-Host '##vso[task.setvariable variable=Py_OutDir]$(Build.SourcesDirectory)\PCbuild'
11+
#Write-Host '##vso[task.setvariable variable=Py_OutDir]$(Build.BinariesDirectory)\bin'
12+
Write-Host '##vso[task.setvariable variable=EXTERNALS_DIR]$(Build.BinariesDirectory)\externals'
13+
displayName: Update build locations
14+
15+
- script: PCbuild\build.bat -e $(buildOpt)
16+
displayName: 'Build CPython'
17+
env:
18+
IncludeUwp: true
19+
20+
- script: python.bat -m test.pythoninfo
21+
displayName: 'Display build info'
22+
condition: and(succeeded(), variables['testRunPlatform'])
23+
24+
- script: PCbuild\rt.bat -q -uall -u-cpu -rwW --slowest --timeout=1200 -j0 --junit-xml="$(Build.BinariesDirectory)\test-results.xml" --tempdir="$(Build.BinariesDirectory)\test"
25+
displayName: 'Tests'
26+
condition: and(succeeded(), variables['testRunPlatform'])
27+
env:
28+
PREFIX: $(Py_OutDir)\$(arch)
29+
30+
- task: PublishTestResults@2
31+
displayName: 'Publish Test Results'
32+
inputs:
33+
testResultsFiles: '$(Build.BinariesDirectory)\test-results.xml'
34+
mergeTestResults: true
35+
testRunTitle: $(testRunTitle)
36+
platform: $(testRunPlatform)
37+
condition: and(succeededOrFailed(), variables['testRunPlatform'])

.coveragerc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[run]
2+
branch = True
3+
4+
[report]
5+
# Regexes for lines to exclude from consideration
6+
exclude_lines =
7+
# Don't complain if non-runnable code isn't run:
8+
if 0:
9+
if __name__ == .__main__.:
10+
raise AssertionError\(
11+
12+
# Empty bodies in protocols or abstract methods
13+
^\s*def [a-zA-Z0-9_]+\(.*\)(\s*->.*)?:\s*\.\.\.(\s*#.*)?$
14+
^\s*\.\.\.(\s*#.*)?$
15+
16+
.*# pragma: no cover
17+
.*# pragma: no branch
18+
19+
# Additions for IDLE:
20+
.*# htest #
21+
if not (_htest or _utest):
22+
if not .*_utest:
23+
if .*_htest:
24+

.devcontainer/devcontainer.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"image": "ghcr.io/python/devcontainer:2024.09.25.11038928730",
3+
"onCreateCommand": [
4+
// Install common tooling.
5+
"dnf",
6+
"install",
7+
"-y",
8+
"which",
9+
"zsh",
10+
"fish",
11+
// For umask fix below.
12+
"/usr/bin/setfacl"
13+
],
14+
"updateContentCommand": {
15+
// Using the shell for `nproc` usage.
16+
"python": "./configure --config-cache --with-pydebug && make -s -j `nproc`",
17+
"docs": [
18+
"make",
19+
"--directory",
20+
"Doc",
21+
"venv",
22+
"html"
23+
]
24+
},
25+
"postCreateCommand": {
26+
// https://github.com/orgs/community/discussions/26026
27+
"umask fix: workspace": ["sudo", "setfacl", "-bnR", "."],
28+
"umask fix: /tmp": ["sudo", "setfacl", "-bnR", "/tmp"]
29+
},
30+
"customizations": {
31+
"vscode": {
32+
"extensions": [
33+
// Highlighting for Parser/Python.asdl.
34+
"brettcannon.zephyr-asdl",
35+
// Highlighting for configure.ac.
36+
"maelvalais.autoconf",
37+
// C auto-complete.
38+
"ms-vscode.cpptools",
39+
// To view HTML build of docs.
40+
"ms-vscode.live-server",
41+
// Python auto-complete.
42+
"ms-python.python"
43+
],
44+
"settings": {
45+
"C_Cpp.default.compilerPath": "/usr/bin/clang",
46+
"C_Cpp.default.cStandard": "c11",
47+
"C_Cpp.default.defines": [
48+
"CONFIG_64",
49+
"Py_BUILD_CORE"
50+
],
51+
"C_Cpp.default.includePath": [
52+
"${workspaceFolder}/*",
53+
"${workspaceFolder}/Include/**"
54+
],
55+
// https://github.com/microsoft/vscode-cpptools/issues/10732
56+
"C_Cpp.errorSquiggles": "disabled",
57+
"editor.insertSpaces": true,
58+
"editor.rulers": [
59+
80
60+
],
61+
"editor.tabSize": 4,
62+
"editor.trimAutoWhitespace": true,
63+
"files.associations": {
64+
"*.h": "c"
65+
},
66+
"files.encoding": "utf8",
67+
"files.eol": "\n",
68+
"files.insertFinalNewline": true,
69+
"files.trimTrailingWhitespace": true,
70+
"python.analysis.diagnosticSeverityOverrides": {
71+
// Complains about shadowing the stdlib w/ the stdlib.
72+
"reportShadowedImports": "none",
73+
// Doesn't like _frozen_importlib.
74+
"reportMissingImports": "none"
75+
},
76+
"python.analysis.extraPaths": [
77+
"Lib"
78+
],
79+
"python.defaultInterpreterPath": "./python",
80+
"[restructuredtext]": {
81+
"editor.tabSize": 3
82+
}
83+
}
84+
}
85+
}
86+
}

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*.{py,c,cpp,h,js,rst,md,yml}]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
indent_style = space
7+
8+
[*.{py,c,cpp,h}]
9+
indent_size = 4
10+
11+
[*.rst]
12+
indent_size = 3
13+
14+
[*.{js,yml}]
15+
indent_size = 2

.gitattributes

Lines changed: 79 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,86 @@
1818
*.zip binary
1919

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

2323
# Text files that should not be subject to eol conversion
24-
Lib/test/cjkencodings/* -text
25-
Lib/test/decimaltestdata/*.decTest -text
26-
Lib/test/test_email/data/*.txt -text
27-
Lib/test/xmltestdata/* -text
28-
Lib/test/coding20731.py -text
29-
Lib/test/test_importlib/data01/* -text
24+
[attr]noeol -text
25+
26+
Lib/test/cjkencodings/* noeol
27+
Lib/test/tokenizedata/coding20731.py noeol
28+
Lib/test/decimaltestdata/*.decTest noeol
29+
Lib/test/test_email/data/*.txt noeol
30+
Lib/test/xmltestdata/* noeol
31+
32+
# Shell scripts should have LF even on Windows because of Cygwin
33+
Lib/venv/scripts/common/activate text eol=lf
34+
Lib/venv/scripts/posix/* text eol=lf
3035

3136
# CRLF files
32-
*.bat text eol=crlf
33-
*.ps1 text eol=crlf
34-
*.sln text eol=crlf
35-
*.vcxproj* text eol=crlf
36-
*.props text eol=crlf
37-
*.proj text eol=crlf
38-
PCbuild/readme.txt text eol=crlf
39-
PC/readme.txt text eol=crlf
37+
[attr]dos text eol=crlf
38+
39+
*.bat dos
40+
*.proj dos
41+
*.props dos
42+
*.ps1 dos
43+
*.sln dos
44+
*.vcxproj* dos
45+
PC/readme.txt dos
46+
PCbuild/readme.txt dos
47+
48+
# Language aware diff headers
49+
# https://tekin.co.uk/2020/10/better-git-diff-output-for-ruby-python-elixir-and-more
50+
# https://gist.github.com/tekin/12500956bd56784728e490d8cef9cb81
51+
*.c diff=cpp
52+
*.h diff=cpp
53+
*.css diff=css
54+
*.html diff=html
55+
*.py diff=python
56+
*.md diff=markdown
57+
58+
# Generated files
59+
# https://github.com/github/linguist/blob/master/docs/overrides.md
60+
#
61+
# To always hide generated files in local diffs, mark them as binary:
62+
# $ git config diff.generated.binary true
63+
#
64+
[attr]generated linguist-generated=true diff=generated
65+
66+
**/clinic/*.c.h generated
67+
**/clinic/*.cpp.h generated
68+
**/clinic/*.h.h generated
69+
*_db.h generated
70+
Doc/data/stable_abi.dat generated
71+
Doc/library/token-list.inc generated
72+
Include/internal/pycore_ast.h generated
73+
Include/internal/pycore_ast_state.h generated
74+
Include/internal/pycore_opcode.h generated
75+
Include/internal/pycore_opcode_metadata.h generated
76+
Include/internal/pycore_*_generated.h generated
77+
Include/internal/pycore_uop_ids.h generated
78+
Include/internal/pycore_uop_metadata.h generated
79+
Include/opcode.h generated
80+
Include/opcode_ids.h generated
81+
Include/token.h generated
82+
Lib/_opcode_metadata.py generated
83+
Lib/keyword.py generated
84+
Lib/test/certdata/*.pem generated
85+
Lib/test/certdata/*.0 generated
86+
Lib/test/levenshtein_examples.json generated
87+
Lib/test/test_stable_abi_ctypes.py generated
88+
Lib/token.py generated
89+
Misc/sbom.spdx.json generated
90+
Objects/typeslots.inc generated
91+
PC/python3dll.c generated
92+
Parser/parser.c generated
93+
Parser/token.c generated
94+
Programs/test_frozenmain.h generated
95+
Python/Python-ast.c generated
96+
Python/executor_cases.c.h generated
97+
Python/generated_cases.c.h generated
98+
Python/optimizer_cases.c.h generated
99+
Python/opcode_targets.h generated
100+
Python/stdlib_module_names.h generated
101+
Tools/peg_generator/pegen/grammar_parser.py generated
102+
aclocal.m4 generated
103+
configure generated

0 commit comments

Comments
 (0)