Skip to content

Commit 4c24176

Browse files
committed
Merge branch 'main' into gh-72
2 parents c835a4b + f378d2a commit 4c24176

34 files changed

+1191
-144
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,18 @@ assignees: ''
77

88
---
99

10+
**Install source and version**
11+
- [ ] Installed from the Windows Store
12+
- [ ] Installed with the MSIX from python\.org
13+
- [ ] Installed with the MSI from python\.org
14+
- [ ] Installed with `winget install 9NQ7512CXL7T`
15+
16+
Version: <!-- for example, 25.0 -->
17+
18+
<!--
19+
Note that the only WinGet command we support is the one shown above. Any issues encountered when you have installed using a different WinGet command should be reported first at https://github.com/microsoft/winget-pkgs/issues/
20+
-->
21+
1022
**Describe the bug**
1123
A clear and concise description of what the bug is.
1224

.github/workflows/build.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,20 @@ jobs:
4040
- name: Set up NuGet
4141
uses: nuget/setup-nuget@v2.0.1
4242

43-
- name: Set up Python 3.14.0b1
43+
- name: Set up Python 3.14.0
4444
run: |
45-
nuget install python -Version 3.14.0-b1 -x -o .
45+
nuget install python -Version 3.14.0 -x -o .
4646
$py = Get-Item python\tools
4747
Write-Host "Adding $py to PATH"
4848
"$py" | Out-File $env:GITHUB_PATH -Encoding UTF8 -Append
4949
working-directory: ${{ runner.temp }}
5050

51-
- name: Check Python version is 3.14.0b1
51+
- name: Check Python version is 3.14.0
5252
run: >
5353
python -c "import sys;
5454
print(sys.version);
5555
print(sys.executable);
56-
sys.exit(0 if sys.version_info[:5] == (3, 14, 0, 'beta', 1) else 1)"
56+
sys.exit(0 if sys.version_info[:5] == (3, 14, 0, 'final', 0) else 1)"
5757
5858
- name: Install build dependencies
5959
run: python -m pip install "pymsbuild>=1.2.0b1"
@@ -130,7 +130,7 @@ jobs:
130130
gcm pythonw
131131
132132
- name: 'Show help output'
133-
run: pymanager
133+
run: pymanager help
134134

135135
- name: 'Install default runtime'
136136
run: pymanager install default

_msbuild.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class ResourceFile(CSourceFile):
7878
CFunction('file_locked_delete'),
7979
CFunction('package_get_root'),
8080
CFunction('shortcut_create'),
81+
CFunction('shortcut_default_cwd'),
8182
CFunction('shortcut_get_start_programs'),
8283
CFunction('hide_file'),
8384
CFunction('fd_supports_vt100'),
@@ -97,7 +98,11 @@ def main_exe(name):
9798
VersionInfo(FileDescription="Python Install Manager"),
9899
CPP_SETTINGS,
99100
ItemDefinition('ClCompile', PreprocessorDefinitions=Prepend(f'EXE_NAME=L"{name}";')),
100-
ItemDefinition('Link', SubSystem='CONSOLE', DelayLoadDLLs=f"{DLL_NAME}.dll"),
101+
ItemDefinition('Link',
102+
SubSystem='CONSOLE',
103+
DelayLoadDLLs=f'{DLL_NAME}.dll;ole32.dll;shell32.dll;advapi32.dll',
104+
DisableSpecificWarnings=Prepend('4199;'),
105+
),
101106
INCLUDE_TMPDIR,
102107
Manifest('default.manifest'),
103108
ResourceFile('pyicon.rc'),
@@ -115,7 +120,11 @@ def mainw_exe(name):
115120
return CProject(name,
116121
VersionInfo(FileDescription="Python Install Manager (windowed)"),
117122
CPP_SETTINGS,
118-
ItemDefinition('Link', SubSystem='WINDOWS', DelayLoadDLLs=f"{DLL_NAME}.dll"),
123+
ItemDefinition('Link',
124+
SubSystem='WINDOWS',
125+
DelayLoadDLLs=f'{DLL_NAME}.dll;ole32.dll;shell32.dll;advapi32.dll',
126+
DisableSpecificWarnings=Prepend('4199;'),
127+
),
119128
INCLUDE_TMPDIR,
120129
ItemDefinition('ClCompile', PreprocessorDefinitions=Prepend(f'EXE_NAME=L"{name}";')),
121130
ItemDefinition('ClCompile', PreprocessorDefinitions=Prepend("PY_WINDOWED=1;")),

_msbuild_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
CFunction('file_locked_delete'),
4545
CFunction('package_get_root'),
4646
CFunction('shortcut_create'),
47+
CFunction('shortcut_default_cwd'),
4748
CFunction('shortcut_get_start_programs'),
4849
CFunction('hide_file'),
4950
CFunction('fd_supports_vt100'),

ci/release.yml

Lines changed: 72 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ stages:
6464
vmImage: 'windows-latest'
6565

6666
variables:
67-
- ${{ if eq(parameters.Sign, 'true') }}:
68-
- group: CPythonSign
6967
- ${{ if eq(parameters.TestSign, 'true') }}:
7068
- group: CPythonTestSign
69+
- ${{ elseif eq(parameters.Sign, 'true') }}:
70+
- group: CPythonSign
7171
- ${{ if eq(parameters.Publish, 'true') }}:
7272
- group: PythonOrgPublish
7373

@@ -87,11 +87,20 @@ stages:
8787
displayName: 'Install Nuget'
8888

8989
- powershell: |
90-
nuget install -o host_python -x -noninteractive -prerelease python
91-
Write-Host "##vso[task.prependpath]$(gi host_python\python\tools)"
92-
displayName: 'Install host Python'
90+
nuget install python -Version 3.14.0 -x -noninteractive -o host_python
91+
$py = Get-Item host_python\python\tools
92+
Write-Host "Adding $py to PATH"
93+
Write-Host "##vso[task.prependpath]$py"
94+
displayName: Set up Python 3.14.0
9395
workingDirectory: $(Build.BinariesDirectory)
9496
97+
- powershell: >
98+
python -c "import sys;
99+
print(sys.version);
100+
print(sys.executable);
101+
sys.exit(0 if sys.version_info[:5] == (3, 14, 0, 'final', 0) else 1)"
102+
displayName: Check Python version is 3.14.0
103+
95104
- powershell: |
96105
python -m pip install "pymsbuild>=1.2.0b1"
97106
displayName: 'Install build dependencies'
@@ -122,6 +131,26 @@ stages:
122131
displayName: 'Install signing tool and generate files'
123132
workingDirectory: $(Build.BinariesDirectory)
124133
134+
- task: AzureCLI@2
135+
displayName: 'Azure Login (1/2)'
136+
inputs:
137+
azureSubscription: 'Python Signing'
138+
scriptType: 'ps'
139+
scriptLocation: 'inlineScript'
140+
inlineScript: |
141+
"##vso[task.setvariable variable=AZURE_CLIENT_ID;issecret=true]${env:servicePrincipalId}"
142+
"##vso[task.setvariable variable=AZURE_ID_TOKEN;issecret=true]${env:idToken}"
143+
"##vso[task.setvariable variable=AZURE_TENANT_ID;issecret=true]${env:tenantId}"
144+
addSpnToEnvironment: true
145+
146+
- powershell: >
147+
az login --service-principal
148+
-u $(AZURE_CLIENT_ID)
149+
--tenant $(AZURE_TENANT_ID)
150+
--allow-no-subscriptions
151+
--federated-token $(AZURE_ID_TOKEN)
152+
displayName: 'Azure Login (2/2)'
153+
125154
- powershell: |
126155
python make.py
127156
displayName: 'Build package'
@@ -142,10 +171,6 @@ stages:
142171
}
143172
displayName: 'Sign binaries'
144173
workingDirectory: $(LAYOUT_DIR)
145-
env:
146-
AZURE_CLIENT_ID: $(TrustedSigningClientId)
147-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
148-
AZURE_TENANT_ID: $(TrustedSigningTenantId)
149174
150175
- powershell: |
151176
python make-msix.py
@@ -177,10 +202,6 @@ stages:
177202
}
178203
displayName: 'Sign MSIX package'
179204
workingDirectory: $(DIST_DIR)
180-
env:
181-
AZURE_CLIENT_ID: $(TrustedSigningClientId)
182-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
183-
AZURE_TENANT_ID: $(TrustedSigningTenantId)
184205
185206
- powershell: >
186207
dir *.msi | %{
@@ -192,28 +213,23 @@ stages:
192213
}
193214
displayName: 'Sign MSI package'
194215
workingDirectory: $(DIST_DIR)
195-
env:
196-
AZURE_CLIENT_ID: $(TrustedSigningClientId)
197-
AZURE_CLIENT_SECRET: $(TrustedSigningSecret)
198-
AZURE_TENANT_ID: $(TrustedSigningTenantId)
199216
200-
- ${{ if eq(parameters.Sign, 'true') }}:
201-
- powershell: Write-Host "##vso[build.addbuildtag]signed"
202-
displayName: 'Add signed build tag'
203-
- ${{ elseif eq(parameters.TestSign, 'true') }}:
217+
- ${{ if eq(parameters.TestSign, 'true') }}:
204218
- powershell: Write-Host "##vso[build.addbuildtag]test-signed"
205219
displayName: 'Add test-signed build tag'
220+
- ${{ elseif eq(parameters.Sign, 'true') }}:
221+
- powershell: Write-Host "##vso[build.addbuildtag]signed"
222+
displayName: 'Add signed build tag'
206223

207224
- publish: $(DIST_DIR)
208225
artifact: dist
209226
displayName: Publish distribution artifacts
210227

211228
- ${{ if eq(parameters.PostTest, 'true') }}:
212-
- ${{ if eq(parameters.Sign, 'true') }}:
229+
- ${{ if and(ne(parameters.TestSign, 'true'), eq(parameters.Sign, 'true')) }}:
213230
- powershell: |
214231
$msix = dir "$(DIST_DIR)\*.msix" | ?{ -not ($_.BaseName -match '.+-store') } | select -first 1
215232
Add-AppxPackage $msix
216-
Get-AppxPackage PythonSoftwareFoundation.PythonManager
217233
displayName: 'Install signed MSIX'
218234
219235
- ${{ else }}:
@@ -222,53 +238,62 @@ stages:
222238
cp $msix "${msix}.zip"
223239
Expand-Archive "${msix}.zip" (mkdir -Force $env:TEST_MSIX)
224240
Add-AppxPackage -Register "${env:TEST_MSIX}\appxmanifest.xml"
225-
Get-AppxPackage PythonSoftwareFoundation.PythonManager
226241
displayName: 'Register unsigned MSIX'
227242
env:
228243
TEST_MSIX: $(TEST_MSIX_DIR)
229244
230245
- powershell: |
231-
gcm pymanager
232-
gcm pywmanager
233-
# These are likely present due to the machine configuration,
246+
$p = Get-AppxPackage PythonSoftwareFoundation.PythonManager
247+
$p
248+
Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -CheckOnLaunch $false
249+
Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -ShowPrompt $false
250+
Set-AppxPackageAutoUpdateSettings $p.PackageFamilyName -PauseUpdates -HoursToPause 1
251+
Get-AppxPackageAutoUpdateSettings $p.PackageFamilyName
252+
displayName: 'Update MSIX settings'
253+
254+
- powershell: |
255+
# Some of these are likely present due to the machine configuration,
234256
# but we'll check for them anyway.
235-
gcm py
236-
gcm python
237-
gcm pyw
238-
gcm pythonw
257+
gcm pymanager, pywmanager, py, python, pyw, pythonw | Format-Table -AutoSize
239258
displayName: 'Ensure global commands are present'
240259
241260
- powershell: |
242-
pymanager
261+
pymanager help
243262
displayName: 'Show help output'
263+
timeoutInMinutes: 1
244264
245265
- powershell: |
246266
pymanager install -vv default
247267
displayName: 'Install default runtime'
268+
timeoutInMinutes: 5
248269
env:
249270
PYMANAGER_DEBUG: true
250271
251272
- powershell: |
252273
pymanager list
253274
displayName: 'List installed runtimes'
275+
timeoutInMinutes: 1
254276
env:
255277
PYMANAGER_DEBUG: true
256278
257279
- powershell: |
258280
pymanager --list-paths
259281
displayName: 'List installed runtimes (legacy)'
282+
timeoutInMinutes: 1
260283
env:
261284
PYMANAGER_DEBUG: true
262285
263286
- powershell: |
264287
pymanager exec -m site
265288
displayName: 'Launch default runtime'
289+
timeoutInMinutes: 1
266290
env:
267291
PYMANAGER_DEBUG: true
268292
269293
- powershell: |
270294
pymanager uninstall -y default
271295
displayName: 'Uninstall runtime'
296+
timeoutInMinutes: 3
272297
env:
273298
PYMANAGER_DEBUG: true
274299
@@ -282,6 +307,7 @@ stages:
282307
pymanager install --configure -y
283308
if ($?) { pymanager list }
284309
displayName: 'Emulate first launch'
310+
timeoutInMinutes: 5
285311
env:
286312
PYTHON_MANAGER_INCLUDE_UNMANAGED: false
287313
PYTHON_MANAGER_CONFIG: .\test-config.json
@@ -293,13 +319,27 @@ stages:
293319
pymanager list --source .\bundle
294320
pymanager install --source .\bundle 3 3-32 3-64 3-arm64
295321
displayName: 'Offline bundle download and install'
322+
timeoutInMinutes: 5
296323
env:
297324
PYMANAGER_DEBUG: true
298325
299326
- powershell: |
300327
Get-AppxPackage PythonSoftwareFoundation.PythonManager | Remove-AppxPackage
301328
displayName: 'Remove MSIX'
302329
330+
- powershell: |
331+
$files = gci -File * -EA SilentlyContinue
332+
$hashes = $files | `
333+
Sort-Object Name | `
334+
Format-Table Name, @{
335+
Label="MD5";
336+
Expression={(Get-FileHash $_ -Algorithm MD5).Hash}
337+
}, Length -AutoSize | `
338+
Out-String -Width 4096
339+
$hashes
340+
workingDirectory: $(DIST_DIR)
341+
displayName: 'Generate hashes (MD5)'
342+
303343
- ${{ if eq(parameters.Publish, 'true') }}:
304344
- ${{ if eq(parameters.Sign, 'true') }}:
305345
- task: DownloadSecureFile@1

ci/repartition-index.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ stages:
4545
- powershell: |
4646
cd (mkdir -Force index)
4747
python "$(Build.SourcesDirectory)\scripts\repartition-index.py" --windows-default
48+
# Show the report
49+
cat index-windows.txt
4850
displayName: 'Repartition index'
4951
workingDirectory: $(Build.BinariesDirectory)
5052

make.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import subprocess
33
import sys
44
from subprocess import check_call as run
5-
from _make_helper import get_dirs, rmtree, unlink
5+
from _make_helper import get_dirs, rmtree
66

77
# Clean DEBUG flag in case it affects build
88
os.environ["PYMANAGER_DEBUG"] = ""

0 commit comments

Comments
 (0)