Skip to content

Commit ca6e051

Browse files
committed
try to build wheels
1 parent eb6a2c3 commit ca6e051

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

.github/workflows/build-wheels-push.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: build-wheels-push
22

33
# on: []
44
# on: push
5-
5+
66
on:
77
release:
88
types:

.github/workflows/build-wheels.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,53 @@ jobs:
4646

4747
steps:
4848
- uses: actions/checkout@v4
49+
50+
- name: Edit pyproject.toml (macOS)
51+
if: runner.os == 'macOS'
52+
shell: bash
53+
run: |
54+
# macOS sed requires a backup extension (here, an empty string '')
55+
sed -i '' '/cmake\.args = \[/,/\]/{
56+
s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\
57+
"-DHIPO=ON"|
58+
}' pyproject.toml
59+
echo "--- pyproject.toml content after macOS edit ---"
60+
cat pyproject.toml
61+
62+
- name: Edit pyproject.toml (Linux)
63+
if: runner.os == 'Linux'
64+
shell: bash
65+
run: |
66+
# Linux sed does NOT require a backup extension
67+
sed -i '/cmake\.args = \[/,/\]/{
68+
s|"-DPYTHON_BUILD_SETUP=ON"|"-DPYTHON_BUILD_SETUP=ON",\
69+
"-DHIPO=ON",\
70+
"-DBUILD_OPENBLAS=ON"|
71+
}' pyproject.toml
72+
echo "--- pyproject.toml content after Linux edit ---"
73+
cat pyproject.toml
74+
75+
- name: Edit pyproject.toml (Windows)
76+
if: runner.os == 'Windows'
77+
shell: pwsh
78+
run: |
79+
$filePath = "pyproject.toml"
80+
$newContent = 'cmake.args = [
81+
"-DPYTHON_BUILD_SETUP=ON",
82+
"-DHIPO=ON",
83+
"-DBUILD_OPENBLAS=ON"
84+
]'
85+
86+
# Read file, replace the block, and write back
87+
$fileContent = Get-Content $filePath -Raw
88+
$regex = "(?s)cmake\.args = \[\s*?\"-DPYTHON_BUILD_SETUP=ON\".*?\]"
89+
$updatedContent = $fileContent -replace $regex, $newContent
90+
91+
$updatedContent | Set-Content $filePath
92+
93+
echo "--- pyproject.toml content after Windows edit ---"
94+
Get-Content $filePath
95+
4996
- name: Build wheels
5097
uses: pypa/[email protected]
5198
env:

0 commit comments

Comments
 (0)