Skip to content

Commit 938be42

Browse files
authored
avoid bogus naming of the macos wheels as universal2 despite intel-only (#309)
1 parent a35f543 commit 938be42

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

.github/workflows/tests+pypi.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ jobs:
9494
brew reinstall gcc
9595
sudo xcode-select -s "/Applications/Xcode_13.4.1.app"
9696
echo MACOSX_DEPLOYMENT_TARGET=`sw_vers -productVersion` >> $GITHUB_ENV
97+
echo ARCHFLAGS="-arch x86_64" >> $GITHUB_ENV # this seems to have no effect on whl name on Python 3.11!
9798
9899
- if: matrix.platform == 'windows-latest'
99100
uses: msys2/setup-msys2@v2
@@ -133,6 +134,18 @@ jobs:
133134
python -m build 2>&1 | tee build.log
134135
exit `fgrep -i warning build.log | grep -v "WARNING setuptools_scm" | wc -l`
135136
137+
- if: startsWith(matrix.platform, 'macos-') && matrix.python-version == '3.11'
138+
run: |
139+
# workaround for buggy universal2 wheel name with Python 3.11 (contains x86_64 binary only)
140+
for whl in dist/*_universal2.whl; do
141+
export whl_new=${whl/_universal2/_x86_64};
142+
mv $whl $whl_new;
143+
python -m wheel unpack $whl_new;
144+
export whl_new_unpacked=`basename $whl_new | cut -d- -f-2`;
145+
sed -i '' 's/_universal2/_x86_64/g' $whl_new_unpacked/$whl_new_unpacked.dist-info/WHEEL;
146+
python -m wheel pack $whl_new_unpacked;
147+
done
148+
136149
- if: matrix.platform == 'ubuntu-latest'
137150
run: rm dist/*
138151

0 commit comments

Comments
 (0)