Skip to content

Commit 58651e1

Browse files
committed
fix(build): clean platform-specific wheels before Python builds
Prevent pip install failures when dist/py contains wheels from multiple platforms. build:py now removes existing wheels for the current platform before building, and manual:py installs only compatible wheels.
1 parent 9a9b689 commit 58651e1

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Taskfile.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,14 @@ tasks:
6767
build:py:
6868
desc: "Build Python wheel (local platform)"
6969
cmds:
70+
- mkdir -p dist/py
71+
# Remove any existing wheels for the current platform to avoid conflicts
72+
- |
73+
if [ "{{OS}}" = "darwin" ]; then
74+
rm -f dist/py/*macosx*.whl
75+
else
76+
rm -f dist/py/*linux*.whl dist/py/*manylinux*.whl
77+
fi
7078
- python3 -m build --wheel -Ccmake.build-type={{.BUILD_TYPE}} --outdir dist/py
7179
sources:
7280
- src/**/*.cpp
@@ -258,7 +266,13 @@ tasks:
258266
desc: "Run interactive Python manual test"
259267
deps: [build:py]
260268
cmds:
261-
- python3 -m pip install --force dist/py/*.whl
269+
# Install only the wheel matching the current platform
270+
- |
271+
if [ "{{OS}}" = "darwin" ]; then
272+
python3 -m pip install --force-reinstall dist/py/*macosx*.whl
273+
else
274+
python3 -m pip install --force-reinstall dist/py/*manylinux*.whl
275+
fi
262276
- python3 test.py
263277

264278
manual:js:linux:

0 commit comments

Comments
 (0)