Skip to content

Commit a279dc0

Browse files
authored
Merge branch 'main' into bpo-26949-keyboardinterrupt
2 parents 59316a9 + cb7ef18 commit a279dc0

File tree

6,007 files changed

+1720402
-599934
lines changed

Some content is hidden

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

6,007 files changed

+1720402
-599934
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.*']
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'])

.bzrignore

Lines changed: 0 additions & 42 deletions
This file was deleted.

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

.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,yaml,gram}]
4+
trim_trailing_whitespace = true
5+
insert_final_newline = true
6+
indent_style = space
7+
8+
[*.{py,c,cpp,h,gram}]
9+
indent_size = 4
10+
11+
[*.rst]
12+
indent_size = 3
13+
14+
[*.{js,yml,yaml}]
15+
indent_size = 2

0 commit comments

Comments
 (0)