Skip to content

Commit 2b48970

Browse files
authored
Merge branch 'main' into fix-issue-29858
2 parents 9737829 + 0124b5d commit 2b48970

File tree

4,187 files changed

+1038504
-386344
lines changed

Some content is hidden

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

4,187 files changed

+1038504
-386344
lines changed

.azure-pipelines/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
variables:
2+
coverage: false
3+
4+
trigger: ['main', '3.11', '3.10', '3.9', '3.8', '3.7']
5+
6+
jobs:
7+
- job: Prebuild
8+
displayName: Pre-build checks
9+
10+
pool:
11+
vmImage: ubuntu-20.04
12+
13+
steps:
14+
- template: ./prebuild-checks.yml
15+
16+
17+
- job: Docs_PR
18+
displayName: Docs PR
19+
dependsOn: Prebuild
20+
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['docs.run'], 'true'))
21+
22+
pool:
23+
vmImage: ubuntu-20.04
24+
25+
steps:
26+
- template: ./docs-steps.yml
27+
parameters:
28+
upload: true
29+
30+
31+
- job: macOS_CI_Tests
32+
displayName: macOS CI Tests
33+
dependsOn: Prebuild
34+
#condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
35+
# bpo-39837: macOS tests on Azure Pipelines are disabled
36+
condition: false
37+
38+
variables:
39+
testRunTitle: '$(build.sourceBranchName)-macos'
40+
testRunPlatform: macos
41+
42+
pool:
43+
vmImage: macos-10.15
44+
45+
steps:
46+
- template: ./macos-steps.yml
47+
48+
49+
- job: Ubuntu_CI_Tests
50+
displayName: Ubuntu CI Tests
51+
dependsOn: Prebuild
52+
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
53+
54+
pool:
55+
vmImage: ubuntu-20.04
56+
57+
variables:
58+
testRunTitle: '$(build.sourceBranchName)-linux'
59+
testRunPlatform: linux
60+
openssl_version: 1.1.1q
61+
62+
steps:
63+
- template: ./posix-steps.yml
64+
parameters:
65+
dependencies: apt
66+
67+
68+
- job: Ubuntu_Coverage_CI_Tests
69+
displayName: Ubuntu CI Tests (coverage)
70+
dependsOn: Prebuild
71+
condition: |
72+
and(
73+
and(
74+
succeeded(),
75+
eq(variables['coverage'], 'true')
76+
),
77+
eq(dependencies.Prebuild.outputs['tests.run'], 'true')
78+
)
79+
80+
pool:
81+
vmImage: ubuntu-20.04
82+
83+
variables:
84+
testRunTitle: '$(Build.SourceBranchName)-linux-coverage'
85+
testRunPlatform: linux-coverage
86+
openssl_version: 1.1.1q
87+
88+
steps:
89+
- template: ./posix-steps.yml
90+
parameters:
91+
dependencies: apt
92+
coverage: true
93+
94+
95+
- job: Windows_CI_Tests
96+
displayName: Windows CI Tests
97+
dependsOn: Prebuild
98+
condition: and(succeeded(), eq(dependencies.Prebuild.outputs['tests.run'], 'true'))
99+
100+
pool:
101+
vmImage: windows-2022
102+
103+
strategy:
104+
matrix:
105+
win32:
106+
arch: win32
107+
buildOpt: '-p Win32'
108+
testRunTitle: '$(Build.SourceBranchName)-win32'
109+
testRunPlatform: win32
110+
win64:
111+
arch: amd64
112+
buildOpt: '-p x64'
113+
testRunTitle: '$(Build.SourceBranchName)-win64'
114+
testRunPlatform: win64
115+
maxParallel: 4
116+
117+
steps:
118+
- template: ./windows-steps.yml
119+
120+
- template: ./windows-layout-steps.yml
121+
parameters:
122+
kind: nuget
123+
- template: ./windows-layout-steps.yml
124+
parameters:
125+
kind: embed
126+
- template: ./windows-layout-steps.yml
127+
parameters:
128+
kind: appx
129+
fulltest: true

.azure-pipelines/docs-steps.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
parameters:
2+
latex: false
3+
upload: false
4+
5+
steps:
6+
- checkout: self
7+
clean: true
8+
fetchDepth: 5
9+
10+
- task: UsePythonVersion@0
11+
displayName: 'Use Python 3.6 or later'
12+
inputs:
13+
versionSpec: '>=3.6'
14+
15+
- script: python -m pip install -r requirements.txt
16+
workingDirectory: '$(build.sourcesDirectory)/Doc'
17+
displayName: 'Install build dependencies'
18+
19+
- ${{ if ne(parameters.latex, 'true') }}:
20+
- script: make check html PYTHON=python
21+
workingDirectory: '$(build.sourcesDirectory)/Doc'
22+
displayName: 'Build documentation'
23+
24+
- ${{ if eq(parameters.latex, 'true') }}:
25+
- script: sudo apt-get update && sudo apt-get install -qy --force-yes texlive-full
26+
displayName: 'Install LaTeX'
27+
28+
- script: make dist PYTHON=python SPHINXBUILD='python -m sphinx' BLURB='python -m blurb'
29+
workingDirectory: '$(build.sourcesDirectory)/Doc'
30+
displayName: 'Build documentation'
31+
32+
- ${{ if eq(parameters.upload, 'true') }}:
33+
- task: PublishBuildArtifacts@1
34+
displayName: 'Publish docs'
35+
36+
inputs:
37+
PathToPublish: '$(build.sourcesDirectory)/Doc/build'
38+
ArtifactName: docs
39+
publishLocation: Container
40+
41+
- ${{ if eq(parameters.latex, 'true') }}:
42+
- task: PublishBuildArtifacts@1
43+
displayName: 'Publish dist'
44+
inputs:
45+
PathToPublish: '$(build.sourcesDirectory)/Doc/dist'
46+
ArtifactName: docs_dist
47+
publishLocation: Container

.azure-pipelines/macos-steps.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
steps:
2+
- checkout: self
3+
clean: true
4+
fetchDepth: 5
5+
6+
- script: ./configure --with-pydebug --with-openssl=/usr/local/opt/openssl --prefix=/opt/python-azdev
7+
displayName: 'Configure CPython (debug)'
8+
9+
- script: make -j4
10+
displayName: 'Build CPython'
11+
12+
- script: make pythoninfo
13+
displayName: 'Display build info'
14+
15+
- script: make buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
16+
displayName: 'Tests'
17+
continueOnError: true
18+
timeoutInMinutes: 30
19+
20+
- task: PublishTestResults@2
21+
displayName: 'Publish Test Results'
22+
inputs:
23+
testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
24+
mergeTestResults: true
25+
testRunTitle: $(testRunTitle)
26+
platform: $(testRunPlatform)
27+
condition: succeededOrFailed()

.azure-pipelines/posix-deps-apt.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/sh
2+
apt-get update
3+
4+
apt-get -yq install \
5+
build-essential \
6+
zlib1g-dev \
7+
libbz2-dev \
8+
liblzma-dev \
9+
libncurses5-dev \
10+
libreadline6-dev \
11+
libsqlite3-dev \
12+
libssl-dev \
13+
libgdbm-dev \
14+
tk-dev \
15+
lzma \
16+
lzma-dev \
17+
liblzma-dev \
18+
libffi-dev \
19+
uuid-dev \
20+
xvfb
21+
22+
if [ ! -z "$1" ]
23+
then
24+
echo ##vso[task.prependpath]$PWD/multissl/openssl/$1
25+
echo ##vso[task.setvariable variable=OPENSSL_DIR]$PWD/multissl/openssl/$1
26+
python3 Tools/ssl/multissltests.py --steps=library --base-directory $PWD/multissl --openssl $1 --system Linux
27+
fi

.azure-pipelines/posix-steps.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
parameters:
2+
coverage: false
3+
sudo_dependencies: sudo
4+
dependencies: apt
5+
patchcheck: true
6+
xvfb: true
7+
8+
steps:
9+
- checkout: self
10+
clean: true
11+
fetchDepth: 5
12+
13+
# Work around a known issue affecting Ubuntu VMs on Pipelines
14+
- script: sudo setfacl -Rb /home/vsts
15+
displayName: 'Workaround ACL issue'
16+
17+
- script: ${{ parameters.sudo_dependencies }} ./.azure-pipelines/posix-deps-${{ parameters.dependencies }}.sh $(openssl_version)
18+
displayName: 'Install dependencies'
19+
20+
- script: ./configure --with-pydebug
21+
displayName: 'Configure CPython (debug)'
22+
23+
- script: make -j4
24+
displayName: 'Build CPython'
25+
26+
- ${{ if eq(parameters.coverage, 'true') }}:
27+
- script: ./python -m venv venv && ./venv/bin/python -m pip install -U coverage
28+
displayName: 'Set up virtual environment'
29+
30+
- script: ./venv/bin/python -m test.pythoninfo
31+
displayName: 'Display build info'
32+
33+
- script: |
34+
$COMMAND -m coverage run --pylib -m test \
35+
--fail-env-changed \
36+
-uall,-cpu \
37+
--junit-xml=$(build.binariesDirectory)/test-results.xml \
38+
-x test_multiprocessing_fork \
39+
-x test_multiprocessing_forkserver \
40+
-x test_multiprocessing_spawn \
41+
-x test_concurrent_futures
42+
displayName: 'Tests with coverage'
43+
env:
44+
${{ if eq(parameters.xvfb, 'true') }}:
45+
COMMAND: xvfb-run ./venv/bin/python
46+
${{ if ne(parameters.xvfb, 'true') }}:
47+
COMMAND: ./venv/bin/python
48+
49+
- script: ./venv/bin/python -m coverage xml
50+
displayName: 'Generate coverage.xml'
51+
52+
- script: source ./venv/bin/activate && bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
53+
displayName: 'Publish code coverage results'
54+
55+
56+
- ${{ if ne(parameters.coverage, 'true') }}:
57+
- script: make pythoninfo
58+
displayName: 'Display build info'
59+
60+
- script: $COMMAND buildbottest TESTOPTS="-j4 -uall,-cpu --junit-xml=$(build.binariesDirectory)/test-results.xml"
61+
displayName: 'Tests'
62+
env:
63+
${{ if eq(parameters.xvfb, 'true') }}:
64+
COMMAND: xvfb-run make
65+
${{ if ne(parameters.xvfb, 'true') }}:
66+
COMMAND: make
67+
68+
- ${{ if eq(parameters.patchcheck, 'true') }}:
69+
- script: |
70+
git fetch origin
71+
./python Tools/patchcheck/patchcheck.py --ci true
72+
displayName: 'Run patchcheck.py'
73+
condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest'))
74+
75+
76+
- task: PublishTestResults@2
77+
displayName: 'Publish Test Results'
78+
inputs:
79+
testResultsFiles: '$(build.binariesDirectory)/test-results.xml'
80+
mergeTestResults: true
81+
testRunTitle: $(testRunTitle)
82+
platform: $(testRunPlatform)
83+
condition: succeededOrFailed()

0 commit comments

Comments
 (0)