Skip to content

Commit c76cf0f

Browse files
authored
Merge pull request #2034 from stonebig/master
don't use pip._vendor
2 parents d0249d6 + 25c5ec5 commit c76cf0f

10 files changed

Lines changed: 6224 additions & 22 deletions
Lines changed: 245 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
1+
name: Build WinPython for 2026-02 Cycle
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
python_versionf:
7+
description: 'Python version to build (3.13, 3.14, 3.14F or 3.15)'
8+
required: true
9+
default: '3.14'
10+
type: choice
11+
options:
12+
- '3.13'
13+
- '3.14'
14+
- '3.14F'
15+
- '3.15'
16+
- '3.15F'
17+
18+
env:
19+
# === Global Configuration ===
20+
WINPYARCH: "64"
21+
my_cycle: "winpython/portable/cycle_2026_03"
22+
my_release_level: "b0"
23+
dotwheelhouse: "dotpython\\wheelhouse\\included.wheels"
24+
pandoc_source: "https://github.com/jgm/pandoc/releases/download/3.1.9/pandoc-3.1.9-windows-x86_64.zip"
25+
pandoc_sha256: "11eb6dbe5286c9e5edb0cca4412e7d99ec6578ec04158b0b7fe11f7fd96688e5"
26+
27+
jobs:
28+
build-winpython:
29+
runs-on: windows-latest
30+
strategy:
31+
fail-fast: true
32+
matrix:
33+
flavor:
34+
- name: "dot"
35+
formats: { zip: true, 7z: false, exe: true }
36+
PANDOC: "0"
37+
WINPYARCHDET: "64"
38+
- name: "slim"
39+
formats: { zip: false, 7z: true, exe: true }
40+
PANDOC: "1"
41+
WINPYARCHDET: "64"
42+
- name: "whl"
43+
formats: { zip: false, 7z: true, exe: false }
44+
PANDOC: "0"
45+
WINPYARCHDET: "64"
46+
- name: "dotf"
47+
formats: { zip: true, 7z: false, exe: true }
48+
PANDOC: "0"
49+
WINPYARCHDET: "64F"
50+
- name: "slimf"
51+
formats: { zip: false, 7z: true, exe: true }
52+
PANDOC: "1"
53+
WINPYARCHDET: "64F"
54+
55+
env:
56+
PYTHON_VERSIONF: ${{ github.event.inputs.python_versionf }}
57+
WINPYFLAVOR: ${{ matrix.flavor.name }}
58+
PANDOC: ${{ matrix.flavor.PANDOC }}
59+
WINPYARCHDET: ${{ matrix.flavor.WINPYARCHDET }}
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v6
64+
65+
- name: Set Python version configuration
66+
id: python_config
67+
shell: pwsh
68+
run: |
69+
switch ($env:PYTHON_VERSIONF) {
70+
'3.13' {
71+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'ver2=3.13.13.1'
72+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'src=https://github.com/astral-sh/python-build-standalone/releases/download/20260508/cpython-3.13.13+20260508-x86_64-pc-windows-msvc-install_only_stripped.tar.gz'
73+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'sha=08eaecdf56b0929f4fc07d0d6b21e96df768de80d42b87d339c932a4bd12a9a1'
74+
}
75+
'3.14' {
76+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'ver2=3.14.5.1'
77+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'src=https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5+20260510-x86_64-pc-windows-msvc-install_only_stripped.tar.gz'
78+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'sha=4d26ade49e9571ccb3bd1a88cfc72c52b11a9a9f6e204a57f38592aed137566a'
79+
}
80+
'3.14F' {
81+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'ver2=3.14.5.1'
82+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'src=https://github.com/astral-sh/python-build-standalone/releases/download/20260510/cpython-3.14.5+20260510-x86_64-pc-windows-msvc-freethreaded-install_only_stripped.tar.gz'
83+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'sha=780df413efe4992c751bff3f84e63c54ccffa11fd26487378ff9de459375e409'
84+
}
85+
'3.15' {
86+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'ver2=3.15.0.3'
87+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'src=https://github.com/astral-sh/python-build-standalone/releases/download/20260508/cpython-3.15.0b1+20260508-x86_64-pc-windows-msvc-install_only_stripped.tar.gz'
88+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'sha=8a1184312b5e7469d6a937e3d7478ea5a11d65a8a8a2a4cad8cbb851c13b111c'
89+
}
90+
'3.15F' {
91+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'ver2=3.15.0.3'
92+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'src=https://github.com/astral-sh/python-build-standalone/releases/download/20260508/cpython-3.15.0b1+20260508-x86_64-pc-windows-msvc-freethreaded-install_only_stripped.tar.gz'
93+
Add-Content -Path $env:GITHUB_OUTPUT -Value 'sha=5c139ad3b99ea0ae08cf79d32f9731da379f7259fb4353746b9cc14bd0fc184f'
94+
}
95+
}
96+
97+
- name: Set static and matrix variables based on selected Python version
98+
shell: pwsh
99+
env:
100+
PYTHON_VERSIONF: ${{ env.PYTHON_VERSIONF }}
101+
WINPYARCHDET: ${{ env.WINPYARCHDET }}
102+
WINPYVER2: ${{ steps.python_config.outputs.ver2 }}
103+
my_cycle: ${{ env.my_cycle }}
104+
my_release_level: ${{ env.my_release_level }}
105+
FLAVOR_NAME: ${{ matrix.flavor.name }}
106+
python_source: ${{ steps.python_config.outputs.src }}
107+
run: |
108+
# Normalize PYTHON_VERSION by removing trailing 'F' if present
109+
$PYTHON_VERSION = $env:PYTHON_VERSIONF -replace 'F$',''
110+
Add-Content -Path $env:GITHUB_ENV -Value "PYTHON_VERSION=$PYTHON_VERSION"
111+
112+
# Detect architecture (64 or 64F)
113+
$detected_arch = if ($env:PYTHON_VERSIONF -like '*F') { '64F' } else { '64' }
114+
115+
$WINPYVER2 = $env:WINPYVER2
116+
$BUILD_LOCATION = "WPy64-" + ($WINPYVER2 -replace '[.]', "")
117+
Add-Content -Path $env:GITHUB_ENV -Value "build_location=$BUILD_LOCATION"
118+
119+
# check consistency of parametrizing:
120+
$python_version=([version]$WINPYVER2).ToString(3)
121+
if ($env:python_source.Contains($python_version)) {
122+
Write-Host "Success: Found '$python_version' in $env:python_source"
123+
} else {
124+
Write-Error "Error: '$python_version' not found in $env:python_source !"
125+
exit 1
126+
}
127+
128+
$WINPYREQUIREMENTS = ''
129+
$WINPYREQUIREMENTSwhl = ''
130+
131+
# 2. Generate requirement files expected names dynamically
132+
$V_TAG = $env:WINPYVER2 -replace '\.', '_'
133+
$testreq = "$($env:my_cycle)/requir.64-$($V_TAG)$($env:FLAVOR_NAME)$($env:my_release_level).txt"
134+
$testwhl = "$($env:my_cycle)/requir.64-$($V_TAG)$($env:FLAVOR_NAME)$($env:my_release_level)_wheels.txt"
135+
136+
Write-Host "Checking for requirements files: $testreq and $testwhl (expected arch $detected_arch)"
137+
138+
if ($env:WINPYARCHDET -eq $detected_arch -and (Test-Path $testreq)) {
139+
$WINPYREQUIREMENTS = $testreq
140+
Write-Host "Found $WINPYREQUIREMENTS"
141+
if (Test-Path $testwhl) {
142+
$WINPYREQUIREMENTSwhl = $testwhl
143+
Write-Host "Found also $WINPYREQUIREMENTSwhl"
144+
}
145+
}
146+
147+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYREQUIREMENTS=$WINPYREQUIREMENTS"
148+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYREQUIREMENTSwhl=$WINPYREQUIREMENTSwhl"
149+
150+
$WINPYLOCKFILE = ''
151+
$WINPYLOCKFILEwhl = ''
152+
153+
# 2. Generate pylock files expected names dynamically
154+
$V_TAG = $env:WINPYVER2 -replace '\.', '_'
155+
$testreq = "$($env:my_cycle)/pylock.64-$($V_TAG)$($env:FLAVOR_NAME)$($env:my_release_level).toml"
156+
$testwhl = "$($env:my_cycle)/pylock.64-$($V_TAG)$($env:FLAVOR_NAME)$($env:my_release_level)_wheels.toml"
157+
158+
Write-Host "Checking for pylock files: $testreq and $testwhl (expected arch $detected_arch)"
159+
160+
if ($env:WINPYARCHDET -eq $detected_arch -and (Test-Path $testreq)) {
161+
$WINPYLOCKFILE = $testreq
162+
Write-Host "Found $WINPYLOCKFILE"
163+
if (Test-Path $testwhl) {
164+
$WINPYLOCKFILEwhl = $testwhl
165+
Write-Host "Found also $WINPYLOCKFILEwhl"
166+
}
167+
}
168+
169+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYLOCKFILE=$WINPYLOCKFILE"
170+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYLOCKFILEwhl=$WINPYLOCKFILEwhl"
171+
172+
$ARTIFACT_NAME = "publish_${PYTHON_VERSION}$($env:FLAVOR_NAME)"
173+
Add-Content -Path $env:GITHUB_ENV -Value "ARTIFACT_NAME=$ARTIFACT_NAME"
174+
175+
$destwheelhouse = "$BUILD_LOCATION\wheelhouse\included.wheels"
176+
Add-Content -Path $env:GITHUB_ENV -Value "destwheelhouse=$destwheelhouse"
177+
178+
$WINPYVER = "${WINPYVER2}$($env:FLAVOR_NAME)$($env:my_release_level)"
179+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYVER=$WINPYVER"
180+
181+
# Store WINPYVER2 in env for later steps
182+
Add-Content -Path $env:GITHUB_ENV -Value "WINPYVER2=$WINPYVER2"
183+
184+
- name: Download, verify and extract python standalone
185+
if: env.WINPYLOCKFILE != ''
186+
uses: ./.github/actions/python-setup
187+
with:
188+
python_source: ${{ steps.python_config.outputs.src }}
189+
python_sha256: ${{ steps.python_config.outputs.sha }}
190+
build_location: ${{ env.build_location }}
191+
192+
- name: Download, checking hash and integrating pandoc binary
193+
if: env.WINPYLOCKFILE != '' && env.PANDOC == '1'
194+
uses: ./.github/actions/pandoc-setup
195+
with:
196+
pandoc_source: ${{ env.pandoc_source }}
197+
pandoc_sha256: ${{ env.pandoc_sha256 }}
198+
build_location: ${{ env.build_location }}
199+
200+
- name: Upgrade pip and patch launchers
201+
if: env.WINPYLOCKFILE != ''
202+
shell: pwsh
203+
run: |
204+
& "$env:build_location\python\python.exe" -m pip install --upgrade --force-reinstall pip --no-warn-script-location
205+
& "$env:build_location\python\python.exe" -c "from wppm import wppm;dist=wppm.Distribution();dist.patch_standard_packages('pip', to_movable=True)"
206+
207+
- name: Download all requirements
208+
if: ${{ env.WINPYLOCKFILE != '' }}
209+
shell: pwsh
210+
run: |
211+
$py = "$env:build_location\python\python.exe"
212+
& $py -m pip download --dest $env:dotwheelhouse --no-deps --require-hashes -r $env:WINPYLOCKFILE
213+
if ($env:WINPYLOCKFILEwhl -ne '') {
214+
& $py -m pip download --dest $env:destwheelhouse --no-deps --require-hashes -r $env:WINPYLOCKFILEwhl
215+
}
216+
217+
- name: Install lockfile
218+
if: env.WINPYLOCKFILE != ''
219+
shell: pwsh
220+
run: |
221+
# & "$env:build_location\python\python.exe" -m pip install --no-deps --no-index --trusted-host=None --find-links=$env:dotwheelhouse --require-hashes -r $env:WINPYREQUIREMENTS --no-warn-script-location
222+
& "$env:build_location\python\python.exe" -m pip install --no-deps --require-hashes -r $env:WINPYLOCKFILE --no-warn-script-location
223+
224+
- name: Generate Assets and Hashes
225+
if: env.WINPYLOCKFILE != ''
226+
uses: ./.github/actions/publish-winpython
227+
with:
228+
build_location: ${{ env.build_location }}
229+
winpy_flavor: ${{ env.WINPYFLAVOR }}
230+
winpy_arch: ${{ env.WINPYARCH }}
231+
winpy_ver: ${{ env.WINPYVER }}
232+
winpy_ver2: ${{ env.WINPYVER2 }}
233+
dotwheelhouse: ${{ env.dotwheelhouse }}
234+
winpy_requirements_whl: ${{ env.WINPYREQUIREMENTSwhl }}
235+
format_zip: ${{ matrix.flavor.formats.zip }}
236+
format_7z: ${{ matrix.flavor.formats['7z'] }}
237+
format_exe: ${{ matrix.flavor.formats.exe }}
238+
239+
- name: Upload artifacts
240+
if: env.WINPYLOCKFILE != ''
241+
uses: actions/upload-artifact@v6
242+
with:
243+
name: ${{ env.ARTIFACT_NAME }}
244+
path: publish_output
245+
retention-days: 66 # keeps artifact for 66 days

winpython/build_winpython.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ def generate_lockfiles(target_python: Path, winpydirbase: Path, constraints: str
9292
raise os.error
9393
else:
9494
print ("💖💖💖 match 💖💖💖 ok ",winpydirbase.parent / f"requir.{file_postfix}{web}.txt", winpydirbase.parent / f"requir.{file_postfix}{local}.txt")
95+
print ("💖 housekeeping, removing local files 💖 ", winpydirbase.parent / f"requir.{file_postfix}{local}.txt")
96+
os.remove (winpydirbase.parent / f"requir.{file_postfix}{local}.txt")
97+
os.remove (winpydirbase.parent / f"pylock.{file_postfix}{local}.toml")
98+
os.remove (winpydirbase.parent / f"requirement_temp.txt")
9599

96100
# --- Main Logic ---
97101
def run_make_py(build_python, winpydirbase, args, winpyver, winpyver2):
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
lock-version = "1.0"
2+
created-by = "pip"
3+
4+
[[packages]]
5+
name = "build"
6+
version = "1.4.2"
7+
8+
[[packages.wheels]]
9+
name = "build-1.4.2-py3-none-any.whl"
10+
url = "https://files.pythonhosted.org/packages/4a/57/3b7d4dd193ade4641c865bc2b93aeeb71162e81fc348b8dad020215601ed/build-1.4.2-py3-none-any.whl"
11+
12+
[packages.wheels.hashes]
13+
sha256 = "7a4d8651ea877cb2a89458b1b198f2e69f536c95e89129dbf5d448045d60db88"
14+
15+
[[packages]]
16+
name = "colorama"
17+
version = "0.4.6"
18+
19+
[[packages.wheels]]
20+
name = "colorama-0.4.6-py2.py3-none-any.whl"
21+
url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl"
22+
23+
[packages.wheels.hashes]
24+
sha256 = "4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6"
25+
26+
[[packages]]
27+
name = "packaging"
28+
version = "26.2"
29+
30+
[[packages.wheels]]
31+
name = "packaging-26.2-py3-none-any.whl"
32+
url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl"
33+
34+
[packages.wheels.hashes]
35+
sha256 = "5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e"
36+
37+
[[packages]]
38+
name = "pyproject-hooks"
39+
version = "1.2.0"
40+
41+
[[packages.wheels]]
42+
name = "pyproject_hooks-1.2.0-py3-none-any.whl"
43+
url = "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl"
44+
45+
[packages.wheels.hashes]
46+
sha256 = "9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913"
47+
48+
[[packages]]
49+
name = "setuptools"
50+
version = "82.0.1"
51+
52+
[[packages.wheels]]
53+
name = "setuptools-82.0.1-py3-none-any.whl"
54+
url = "https://files.pythonhosted.org/packages/9d/76/f789f7a86709c6b087c5a2f52f911838cad707cc613162401badc665acfe/setuptools-82.0.1-py3-none-any.whl"
55+
56+
[packages.wheels.hashes]
57+
sha256 = "a59e362652f08dcd477c78bb6e7bd9d80a7995bc73ce773050228a348ce2e5bb"
58+
59+
[[packages]]
60+
name = "sqlite-bro"
61+
version = "0.13.1"
62+
63+
[[packages.wheels]]
64+
name = "sqlite_bro-0.13.1-py3-none-any.whl"
65+
url = "https://files.pythonhosted.org/packages/2a/b3/81b91f5b26fff329c59dbf826a87637bd51d1903120427912322f86e7d33/sqlite_bro-0.13.1-py3-none-any.whl"
66+
67+
[packages.wheels.hashes]
68+
sha256 = "c26033b0af133049ca578b5fd30b2372f002e7ff934b39774aa4d2da7638c23d"
69+
70+
[[packages]]
71+
name = "sv-ttk"
72+
version = "2.6.0"
73+
74+
[[packages.wheels]]
75+
name = "sv_ttk-2.6.0-py3-none-any.whl"
76+
url = "https://files.pythonhosted.org/packages/0f/3d/be0abc3202e90f282ad465f4e7c6e41bc8dce810ce5d1611566a1e7dfba8/sv_ttk-2.6.0-py3-none-any.whl"
77+
78+
[packages.wheels.hashes]
79+
sha256 = "4319c52edf2e14732fe84bdc9788e26f9e9a1ad79451ec0f89f0120ffc8105d9"
80+
81+
[[packages]]
82+
name = "wheel"
83+
version = "0.47.0"
84+
85+
[[packages.wheels]]
86+
name = "wheel-0.47.0-py3-none-any.whl"
87+
url = "https://files.pythonhosted.org/packages/87/1b/9e33c09813d65e248f7f773119148a612516a4bea93e9c6f545f78455b7c/wheel-0.47.0-py3-none-any.whl"
88+
89+
[packages.wheels.hashes]
90+
sha256 = "212281cab4dff978f6cedd499cd893e1f620791ca6ff7107cf270781e587eced"
91+
92+
[[packages]]
93+
name = "wppm"
94+
version = "17.4.20260517"
95+
96+
[[packages.wheels]]
97+
name = "wppm-17.4.20260517-py3-none-any.whl"
98+
url = "https://files.pythonhosted.org/packages/3f/b2/8c2ef911b9d98ce05052b159cc29276cd33bd6c39d2d2c2dd7f2a6a2586a/wppm-17.4.20260517-py3-none-any.whl"
99+
100+
[packages.wheels.hashes]
101+
sha256 = "7e5a934c099b8e5bdb9710d2ceb5387695b813af5317b08e4cff1e521b682a6e"

0 commit comments

Comments
 (0)