Skip to content

Commit 980cf3c

Browse files
committed
try win ci
1 parent 92e1d72 commit 980cf3c

File tree

4 files changed

+86
-10
lines changed

4 files changed

+86
-10
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515

1616
- name: Build sdist
1717
run: |
18-
python3 -m pip install build
18+
python3 -m pip install build
1919
python3 -m build --sdist
2020
2121
- name: Install sdist

.github/workflows/build-python-sdist.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
- name: install highspy
2424
run: |
25-
python3 -m pip install dist/*.tar.gz --user
25+
python3 -m pip install dist/*.tar.gz --user
2626
2727
- name: Test Python Examples
2828
run: |

.github/workflows/test-python-win.yml

Lines changed: 77 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,86 @@ jobs:
1818
python-version: ${{ matrix.python }}
1919

2020
- name: Install build dependencies
21-
run: python -m pip install numpy setuptools wheel pytest
22-
21+
run: python -m pip install numpy wheel pytest
22+
23+
- name: Test python install
24+
run: |
25+
python -m pip install .
26+
pytest -k "not test_hipo"
27+
28+
- name: Test Python Examples
29+
run: |
30+
python ./examples/call_highs_from_python_highspy.py
31+
python ./examples/call_highs_from_python_mps.py
32+
python ./examples/minimal.py
33+
34+
build_hipo:
35+
runs-on: ${{ matrix.os }}
36+
strategy:
37+
matrix:
38+
# os: [self-hosted]
39+
os: [windows-2022]
40+
python: [3.12]
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: Install correct python version
44+
uses: actions/setup-python@v5
45+
with:
46+
python-version: ${{ matrix.python }}
47+
48+
- name: Install build dependencies
49+
run: python -m pip install numpy wheel pytest
50+
51+
- name: Checkout METIS
52+
uses: actions/checkout@v4
53+
with:
54+
repository: galabovaa/METIS
55+
ref: 521-ts
56+
path: METIS
57+
58+
- name: Create installs dir
59+
working-directory: ${{runner.workspace}}
60+
run: |
61+
ls
62+
mkdir installs
63+
ls
64+
65+
- name: Install METIS
66+
shell: pwsh
67+
run: |
68+
cd METIS
69+
pwd
70+
cmake -S. -B build `
71+
-DGKLIB_PATH="$env:GITHUB_WORKSPACE/METIS/GKlib" `
72+
-DCMAKE_INSTALL_PREFIX="${{ runner.workspace }}/installs" `
73+
cmake --build build --parallel --config Release
74+
cmake --install build --config Release
75+
76+
- name: Install OpenBLAS
77+
shell: pwsh
78+
run: vcpkg install openblas[threads]
79+
80+
- name: Edit pyproject
81+
run: |
82+
$VCPKG_ROOT = "C:/vcpkg"
83+
$METIS_ROOT = "C:/Users/galab/installs"
84+
$TRIPLET = "x64-windows-static"
85+
$content = Get-Content pyproject.toml -Raw
86+
$newContent = $content -replace 'cmake\.args = \[\s*"-DPYTHON_BUILD_SETUP=ON"\s*\]', @"
87+
cmake.args = [
88+
"-DPYTHON_BUILD_SETUP=ON",
89+
"-DHIPO=ON",
90+
"-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT",
91+
"-DVCPKG_TARGET_TRIPLET=$env:TRIPLET",
92+
"-DMETIS_ROOT=$env:METIS_ROOT"
93+
]
94+
"@
95+
$newContent | Set-Content pyproject.toml
96+
2397
- name: Test python install
2498
run: |
2599
python -m pip install .
26-
pytest
100+
pytest
27101
28102
- name: Test Python Examples
29103
run: |

pyproject.toml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ test = ["pytest", "numpy"]
3434

3535
[tool.scikit-build]
3636
cmake.args = [
37-
"-DPYTHON_BUILD_SETUP=ON",
38-
"-DHIPO=ON",
39-
"-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'",
40-
"-DVCPKG_TARGET_TRIPLET='x64-windows-static'",
41-
"-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'"
37+
"-DPYTHON_BUILD_SETUP=ON"
4238
]
4339

40+
# To build locally, on windows, specify
41+
# "-DHIPO=ON",
42+
# "-DCMAKE_TOOLCHAIN_FILE='C:/Users/galab/code/repos/vcpkg/scripts/buildsystems/vcpkg.cmake'",
43+
# "-DVCPKG_TARGET_TRIPLET='x64-windows-static'",
44+
# "-DMETIS_ROOT='C:/Users/galab/installs/metis-521-ts'"
45+
4446
wheel.expand-macos-universal-tags = true
4547

4648
# A list of packages to auto-copy into the wheel. If this is not set, it will

0 commit comments

Comments
 (0)