Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3b83cd3

Browse files
committed
Add workaround to get NumPy headers for Python 3.11
1 parent 20e9cc6 commit 3b83cd3

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/basemap-for-manylinux.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,16 +161,33 @@ jobs:
161161
3.10) pkgvers=1.21.4;;
162162
*) pkgvers=1.23.3;;
163163
esac
164+
if [ "${pkgvers}" = "1.23.3" ]; then
165+
# Dirty solution to get NumPy headers for Python 3.11.
166+
case "${{ matrix.arch }}" in
167+
x64) kwds="--plat=manylinux_2_17_x86_64" ;;
168+
x86) kwds="--plat=manylinux_2_17_i686" ;;
169+
esac
170+
pip download --no-deps ${kwds} "numpy==1.23.3"
171+
oldpkgfile=$(ls *.whl | head -n1)
172+
newpkgfile=$(echo "${oldpkgfile}" | sed 's/manylinux_2_17/linux/')
173+
mv "${oldpkgfile}" "${newpkgfile}"
174+
pip install "${newpkgfile}"
175+
rm "${newpkgfile}"
176+
fi
164177
pip install "numpy == ${pkgvers}"
165178
-
166179
name: Build wheel
167180
run: |
168181
sitepkgdir=$(pip show numpy 2>/dev/null | grep Location: | cut -d' ' -f2)
169182
export GEOS_DIR="${GITHUB_WORKSPACE}/${{ env.PKGDIR }}/extern"
170183
export NUMPY_INCLUDE_PATH=${sitepkgdir}/numpy/core/include
184+
if [ "${{ matrix.python-version }}" = "3.11" ]; then
185+
kwds="--no-build-isolation"
186+
pip install setuptools wheel "cython >= 0.29, < 3.1"
187+
fi
171188
cd ${{ env.PKGDIR }}
172189
python setup.py sdist
173-
pip wheel -w dist --no-deps dist/*.zip
190+
pip wheel -w dist --no-deps ${kwds} dist/*.zip
174191
-
175192
name: Upload build artifacts
176193
uses: actions/upload-artifact@v1

0 commit comments

Comments
 (0)