Skip to content

Commit 29d4ef1

Browse files
authored
Merge branch 'main' into bump-aiohttp-3.12.15
2 parents b750d24 + b297ea9 commit 29d4ef1

17 files changed

+139
-94
lines changed

.github/workflows/build-release.yml

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,23 +153,16 @@ jobs:
153153
- name: "Install docs dependencies"
154154
run: |
155155
python -m pip install -r Doc/requirements.txt
156-
sudo apt-get update
157-
sudo apt-get install --yes --no-install-recommends \
158-
fonts-freefont-otf \
159-
latexmk \
160-
texinfo \
161-
texlive-fonts-extra \
162-
texlive-fonts-recommended \
163-
texlive-latex-base \
164-
texlive-latex-extra \
165-
texlive-latex-recommended \
166-
texlive-xetex \
167-
xindy
168156
169157
- name: "Build docs"
158+
env:
159+
SPHINXOPTS: "-j10"
170160
run: |
171161
cd Doc
172-
SPHINXOPTS="-j10" make dist
162+
make dist-epub
163+
make dist-html
164+
make dist-texinfo
165+
make dist-text
173166
174167
- name: "Upload the docs artifacts"
175168
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2

release.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import subprocess
2020
import sys
2121
import tempfile
22-
from collections.abc import Generator
22+
from collections.abc import Generator, Sequence
2323
from contextlib import contextmanager
2424
from dataclasses import dataclass
2525
from pathlib import Path
@@ -256,7 +256,7 @@ def error(*msgs: str) -> None:
256256

257257

258258
def run_cmd(
259-
cmd: list[str] | str, silent: bool = False, shell: bool = False, **kwargs: Any
259+
cmd: Sequence[str] | str, silent: bool = False, shell: bool = False, **kwargs: Any
260260
) -> None:
261261
if shell:
262262
cmd = SPACE.join(cmd)
@@ -700,11 +700,17 @@ def build_docs() -> str:
700700
run_cmd([pip, "install", "-r", "Doc/requirements.txt"])
701701
sphinx_build = os.path.join(venv, "bin", "sphinx-build")
702702
blurb = os.path.join(venv, "bin", "blurb")
703+
docs_env = {
704+
**os.environ,
705+
"BLURB": blurb,
706+
"SPHINXBUILD": sphinx_build,
707+
"SPHINXOPTS": "-j10",
708+
}
703709
with pushd("Doc"):
704-
run_cmd(
705-
["make", "dist", "SPHINXBUILD=" + sphinx_build, "BLURB=" + blurb],
706-
env={**os.environ, "SPHINXOPTS": "-j10"},
707-
)
710+
run_cmd(("make", "dist-epub"), env=docs_env)
711+
run_cmd(("make", "dist-html"), env=docs_env)
712+
run_cmd(("make", "dist-texinfo"), env=docs_env)
713+
run_cmd(("make", "dist-text"), env=docs_env)
708714
return os.path.abspath("dist")
709715

710716

run_release.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,6 @@ def wait_for_build_release(db: ReleaseShelf) -> None:
604604
docs_path / f"python-{release_tag}-docs.epub",
605605
docs_path / f"python-{release_tag}-docs-html.tar.bz2",
606606
docs_path / f"python-{release_tag}-docs-html.zip",
607-
docs_path / f"python-{release_tag}-docs-pdf-a4.tar.bz2",
608-
docs_path / f"python-{release_tag}-docs-pdf-a4.zip",
609607
docs_path / f"python-{release_tag}-docs-texinfo.tar.bz2",
610608
docs_path / f"python-{release_tag}-docs-texinfo.zip",
611609
docs_path / f"python-{release_tag}-docs-text.tar.bz2",
@@ -1127,6 +1125,15 @@ def modify_the_docs_by_version_page(db: ReleaseShelf) -> None:
11271125
)
11281126

11291127

1128+
def announce_release(db: ReleaseShelf) -> None:
1129+
if not ask_question(
1130+
"Have you announced the release at https://discuss.python.org/c/core-dev/23 "
1131+
"and https://www.blogger.com?\n"
1132+
"Tip: use the 'release' tag and 'releases' label respectively."
1133+
):
1134+
raise ReleaseException("The release has not been announced")
1135+
1136+
11301137
def post_release_merge(db: ReleaseShelf) -> None:
11311138
subprocess.check_call(
11321139
["git", "fetch", "--all"],
@@ -1450,6 +1457,7 @@ def _api_key(api_key: str) -> str:
14501457
Task(purge_the_cdn, "Purge the CDN of python.org/downloads"),
14511458
Task(modify_the_prereleases_page, "Modify the pre-release page"),
14521459
Task(modify_the_docs_by_version_page, "Update docs by version page"),
1460+
Task(announce_release, "Announce the release"),
14531461
]
14541462
automata = ReleaseDriver(
14551463
git_repo=args.repo,

tests/README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Documentation
153153
updated daily.
154154

155155
It can also be downloaded in many formats for faster access. The documentation
156-
is downloadable in HTML, PDF, and reStructuredText formats; the latter version
156+
is downloadable in HTML, EPUB, and reStructuredText formats; the latter version
157157
is primarily for documentation authors, translators, and people with special
158158
formatting requirements.
159159

windows-release/azure-pipelines.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,14 @@ variables:
140140
SigningDescription: ${{ parameters.SigningDescription }}
141141
PublishARM64: ${{ parameters.DoARM64 }}
142142
# QUEUE TIME VARIABLES
143-
# PyDotOrgUsername: ''
144-
# PyDotOrgServer: ''
143+
# OverrideNugetVersion: ''
144+
# PyManagerIndexFilename: ''
145+
# SkipNugetPublish: ''
146+
# SkipPipTests: ''
147+
# SkipPythonOrgPublish: ''
148+
# SkipSBOM: ''
149+
# SkipTests: ''
150+
# SkipTkTests: ''
145151

146152
trigger: none
147153
pr: none
@@ -193,61 +199,67 @@ stages:
193199
parameters:
194200
BuildToPackage: ${{ parameters.BuildToPackage }}
195201
DoFreethreaded: ${{ parameters.DoFreethreaded }}
202+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
196203
- template: stage-layout-symbols.yml
197204
parameters:
198205
BuildToPackage: ${{ parameters.BuildToPackage }}
199206
DoFreethreaded: ${{ parameters.DoFreethreaded }}
207+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
200208
- ${{ if eq(parameters.DoEmbed, 'true') }}:
201209
- template: stage-layout-embed.yml
202210
parameters:
203211
BuildToPackage: ${{ parameters.BuildToPackage }}
212+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
204213
- ${{ if eq(parameters.DoNuget, 'true') }}:
205214
- template: stage-layout-nuget.yml
206215
parameters:
207216
BuildToPackage: ${{ parameters.BuildToPackage }}
208217
DoFreethreaded: ${{ parameters.DoFreethreaded }}
218+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
209219
- ${{ if eq(parameters.DoMSIX, 'true') }}:
210220
- template: stage-layout-msix.yml
211221
parameters:
212222
BuildToPackage: ${{ parameters.BuildToPackage }}
223+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
213224
- ${{ if eq(parameters.DoPyManager, 'true') }}:
214225
- template: stage-layout-pymanager.yml
215226
parameters:
216227
BuildToPackage: ${{ parameters.BuildToPackage }}
217228
DoFreethreaded: ${{ parameters.DoFreethreaded }}
218229
DoEmbed: ${{ parameters.DoEmbed }}
230+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
219231

220232
- stage: Pack
221233
dependsOn: Layout
222234
displayName: Pack
223235
jobs:
224236
#- ${{ if eq(parameters.DoEmbed, 'true') }}:
225237
# - template: stage-pack-embed.yml
238+
# parameters:
239+
# SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
226240
- ${{ if eq(parameters.DoMSI, 'true') }}:
227241
- template: stage-msi.yml
228242
parameters:
229243
BuildToPackage: ${{ parameters.BuildToPackage }}
230244
DoARM64: ${{ parameters.DoARM64}}
231245
DoFreethreaded: ${{ parameters.DoFreethreaded }}
232-
${{ if and(parameters.SigningCertificate, ne(parameters.SigningCertificate, 'Unsigned')) }}:
233-
SigningCertificate: ${{ parameters.SigningCertificate }}
246+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
234247
- ${{ if eq(parameters.DoMSIX, 'true') }}:
235248
- template: stage-pack-msix.yml
236249
parameters:
237-
${{ if and(parameters.SigningCertificate, ne(parameters.SigningCertificate, 'Unsigned')) }}:
238-
SigningCertificate: ${{ parameters.SigningCertificate }}
250+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
239251
- ${{ if eq(parameters.DoNuget, 'true') }}:
240252
- template: stage-pack-nuget.yml
241253
parameters:
242254
${{ if eq(parameters.SignNuget, 'true') }}:
243-
${{ if and(parameters.SigningCertificate, ne(parameters.SigningCertificate, 'Unsigned')) }}:
244-
SigningCertificate: ${{ parameters.SigningCertificate }}
255+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
245256
DoFreethreaded: ${{ parameters.DoFreethreaded }}
246257
- ${{ if eq(parameters.DoPyManager, 'true') }}:
247258
- template: stage-pack-pymanager.yml
248259
parameters:
249260
DoFreethreaded: ${{ parameters.DoFreethreaded }}
250261
DoEmbed: ${{ parameters.DoEmbed }}
262+
SigningCertificate: ${{ iif(eq(parameters.SigningCertificate, 'Unsigned'), '', parameters.SigningCertificate) }}
251263

252264
- stage: Test
253265
dependsOn: Pack

windows-release/msi-steps.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ steps:
6767
Include: ''
6868
ExportCommand: SignCommand
6969
SigningCertificate: ${{ parameters.SigningCertificate }}
70+
# WiX is struggling with WIF authentication and sign.exe right now,
71+
# so we still rely on the client secret for legacy builds.
72+
# We disable the service connection here to skip the login steps.
73+
AzureServiceConnectionName: ''
7074

7175
- powershell: |
7276
$cmd = $env:SignCommand -replace '"', '\"'
@@ -81,12 +85,12 @@ steps:
8185
displayName: 'Build launcher installer'
8286
env:
8387
Platform: x86
88+
# Only need the variable here for msi.props to detect
89+
SigningCertificate: ${{ parameters.SigningCertificate }}
8490
${{ if parameters.SigningCertificate }}:
8591
AZURE_TENANT_ID: $(TrustedSigningTenantId)
8692
AZURE_CLIENT_ID: $(TrustedSigningClientId)
87-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
88-
# Only need the variable here for msi.props to detect
89-
SigningCertificate: ${{ parameters.SigningCertificate }}
93+
AZURE_CLIENT_SECRET: $(TrustedSigningClientSecret)
9094
9195
- ${{ each b in parameters.Bundles }}:
9296
- script: |
@@ -99,12 +103,12 @@ steps:
99103
PYTHONHOME: $(Build.SourcesDirectory)
100104
${{ if b.TclTkArtifact }}:
101105
TclTkLibraryDir: $(Pipeline.Workspace)\${{ b.TclTkArtifact }}
106+
# Only need the variable here for msi.props to detect
107+
SigningCertificate: ${{ parameters.SigningCertificate }}
102108
${{ if parameters.SigningCertificate }}:
103109
AZURE_TENANT_ID: $(TrustedSigningTenantId)
104110
AZURE_CLIENT_ID: $(TrustedSigningClientId)
105-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
106-
# Only need the variable here for msi.props to detect
107-
SigningCertificate: ${{ parameters.SigningCertificate }}
111+
AZURE_CLIENT_SECRET: $(TrustedSigningClientSecret)
108112
109113
- powershell: |
110114
del $env:ResponseFile -ErrorAction Continue

windows-release/sign-files.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ parameters:
77
SigningCertificate: ''
88
ExportCommand: ''
99
ContinueOnError: false
10+
AzureServiceConnectionName: 'Python Signing'
1011

1112
steps:
1213
- ${{ if parameters.SigningCertificate }}:
1314
- powershell: |
15+
# Install sign tool
1416
dotnet tool install --global --prerelease sign
1517
$signtool = (gcm sign -EA SilentlyContinue).Source
1618
if (-not $signtool) {
@@ -32,6 +34,30 @@ steps:
3234
env:
3335
EXPORT_COMMAND: ${{ parameters.ExportCommand }}
3436
37+
- ${{ if parameters.AzureServiceConnectionName }}:
38+
# We sign in once with the AzureCLI task, as it uses OIDC to obtain a
39+
# temporary token. But the task also logs out, and so we save the token and
40+
# use it to log in persistently (for the rest of the build).
41+
- task: AzureCLI@2
42+
displayName: 'Authenticate signing tools (1/2)'
43+
inputs:
44+
azureSubscription: ${{ parameters.AzureServiceConnectionName }}
45+
scriptType: 'ps'
46+
scriptLocation: 'inlineScript'
47+
inlineScript: |
48+
"##vso[task.setvariable variable=AZURE_CLIENT_ID;issecret=true]${env:servicePrincipalId}"
49+
"##vso[task.setvariable variable=AZURE_ID_TOKEN;issecret=true]${env:idToken}"
50+
"##vso[task.setvariable variable=AZURE_TENANT_ID;issecret=true]${env:tenantId}"
51+
addSpnToEnvironment: true
52+
53+
- powershell: >
54+
az login --service-principal
55+
-u $(AZURE_CLIENT_ID)
56+
--tenant $(AZURE_TENANT_ID)
57+
--allow-no-subscriptions
58+
--federated-token $(AZURE_ID_TOKEN)
59+
displayName: 'Authenticate signing tools (2/2)'
60+
3561
- ${{ if parameters.Include }}:
3662
- powershell: |
3763
if ("${{ parameters.Exclude }}") {
@@ -58,9 +84,6 @@ steps:
5884
env:
5985
TRUSTED_SIGNING_CMD: $(__TrustedSigningCmd)
6086
TRUSTED_SIGNING_ARGS: $(__TrustedSigningArgs)
61-
AZURE_TENANT_ID: $(TrustedSigningTenantId)
62-
AZURE_CLIENT_ID: $(TrustedSigningClientId)
63-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
6487
${{ if parameters.Filter }}:
6588
FILTER: ${{ parameters.Filter }}
6689

windows-release/stage-layout-embed.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
parameters:
22
BuildToPackage: current
3+
SigningCertificate: ''
34

45
jobs:
56
- job: Make_Embed_Layout

windows-release/stage-layout-full.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
parameters:
22
BuildToPackage: current
33
DoFreethreaded: false
4+
SigningCertificate: ''
45

56
jobs:
67
- job: Make_Layouts
@@ -131,10 +132,10 @@ jobs:
131132
displayName: 'Update TCL_LIBRARY'
132133
condition: and(succeeded(), variables['TclLibrary'])
133134
134-
- powershell: |
135-
copy "$(Pipeline.Workspace)\bin_$(Name)\Activate.ps1" Lib\venv\scripts\common\Activate.ps1 -Force
136-
displayName: 'Copy signed files into sources'
137-
condition: and(succeeded(), variables['SigningCertificate'])
135+
- ${{ if parameters.SigningCertificate }}:
136+
- powershell: |
137+
copy "$(Pipeline.Workspace)\bin_$(Name)\Activate.ps1" Lib\venv\scripts\common\Activate.ps1 -Force
138+
displayName: 'Copy signed files into sources'
138139
139140
- template: ./layout-command.yml
140141
parameters:

0 commit comments

Comments
 (0)