Add pkg-config to build dependencies for numpy #84
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: numpy-for-manylinux | |
env: | |
PKGNAME: "numpy" | |
PYTHONWARNINGS: "ignore:DEPRECATION" | |
PIP_DISABLE_PIP_VERSION_CHECK: "1" | |
PIP_PREFER_BINARY: "1" | |
on: | |
push: | |
paths: | |
- ".github/workflows/numpy-for-manylinux.yml" | |
- "recipes/numpy/**" | |
pull_request: | |
paths: | |
- ".github/workflows/numpy-for-manylinux.yml" | |
- "recipes/numpy/**" | |
workflow_dispatch: | |
jobs: | |
checkout: | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Upload checkout | |
uses: actions/upload-artifact@v1 | |
with: | |
name: checkout | |
path: . | |
build: | |
strategy: | |
matrix: | |
arch: | |
["x64", "x86"] | |
python-version: | |
["2.6", "2.6-ucs2", "2.7", "2.7-ucs2", "3.2", "3.2-ucs2", | |
"3.3", "3.4", "3.9", "3.10", "3.11", "3.12"] | |
debian-version: | |
["debian-5"] | |
exclude: | |
- python-version: "3.11" | |
debian-version: "debian-5" | |
- python-version: "3.12" | |
debian-version: "debian-5" | |
include: | |
- arch: "x64" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x86" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x64" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
- arch: "x86" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
max-parallel: 6 | |
fail-fast: false | |
needs: checkout | |
runs-on: ubuntu-latest | |
container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-${{ matrix.debian-version }}" | |
steps: | |
- | |
name: Download checkout | |
uses: actions/download-artifact@v1 | |
with: | |
name: checkout | |
path: . | |
- | |
name: Fixup pip and wheel | |
run: | | |
sh recipes/fix-pip.sh | |
sh recipes/fix-wheel.sh | |
- | |
name: Run pre-build script | |
run: | | |
sh recipes/${{ env.PKGNAME }}/prebuild.sh | |
- | |
name: Run build script | |
run: | | |
sh recipes/${{ env.PKGNAME }}/build.sh | |
- | |
name: Upload build artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} | |
path: dist | |
repair: | |
strategy: | |
matrix: | |
arch: | |
["x64", "x86"] | |
python-version: | |
["2.6", "2.6-ucs2", "2.7", "2.7-ucs2", "3.2", "3.2-ucs2", | |
"3.3", "3.4", "3.9", "3.10", "3.11", "3.12"] | |
debian-version: | |
["debian-5"] | |
exclude: | |
- python-version: "3.11" | |
debian-version: "debian-5" | |
- python-version: "3.12" | |
debian-version: "debian-5" | |
include: | |
- arch: "x64" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x86" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x64" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
- arch: "x86" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
max-parallel: 6 | |
fail-fast: false | |
needs: build | |
runs-on: ubuntu-latest | |
container: "pylegacy/${{ matrix.arch }}-python:3.6-${{ matrix.debian-version }}" | |
steps: | |
- | |
name: Download checkout | |
uses: actions/download-artifact@v1 | |
with: | |
name: checkout | |
path: . | |
- | |
name: Download build artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifacts-build-${{ matrix.arch }}-${{ matrix.python-version }} | |
path: dist | |
- | |
name: Run pre-build script | |
run: | | |
sh recipes/${{ env.PKGNAME }}/prebuild.sh | |
- | |
name: Install auditwheel | |
run: | | |
if [ "${{ matrix.python-version }}" = "3.11" -o "${{ matrix.python-version }}" = "3.12" ]; then | |
pip install patchelf | |
pip install auditwheel | |
policy=$(python -c 'import auditwheel.policy; print(auditwheel.policy._POLICY_JSON_MAP[1])') | |
sed -i 's/"aliases": \[.\+\]/"aliases": []/g' "${policy}" | |
else | |
pip install "patchelf < 0.14" | |
pip install "auditwheel < 4.0" | |
fi | |
- | |
name: Repair wheel | |
run: | | |
case "${{ matrix.python-version }}" in | |
3.2|3.2-ucs2) | |
kwds="--no-update-tags" | |
;; | |
3.11) | |
case "${{ matrix.arch }}" in | |
x64) kwds="--plat=manylinux_2_17_x86_64" ;; | |
x86) kwds="--plat=manylinux_2_17_i686" ;; | |
esac | |
;; | |
3.12) | |
case "${{ matrix.arch }}" in | |
x64) kwds="--plat=manylinux_2_28_x86_64" ;; | |
x86) kwds="--plat=manylinux_2_28_i686" ;; | |
esac | |
esac | |
python -m auditwheel repair -w wheelyard ${kwds} dist/*.whl | |
- | |
name: Upload repair artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: artifacts-repair-${{ matrix.arch }}-${{ matrix.python-version }} | |
path: wheelyard | |
test: | |
strategy: | |
matrix: | |
arch: | |
["x64", "x86"] | |
python-version: | |
["2.6", "2.6-ucs2", "2.7", "2.7-ucs2", "3.2", "3.2-ucs2", | |
"3.3", "3.4", "3.9", "3.10", "3.11", "3.12"] | |
debian-version: | |
["debian-5"] | |
exclude: | |
- python-version: "3.11" | |
debian-version: "debian-5" | |
- python-version: "3.12" | |
debian-version: "debian-5" | |
include: | |
- arch: "x64" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x86" | |
python-version: "3.11" | |
debian-version: "debian-8" | |
- arch: "x64" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
- arch: "x86" | |
python-version: "3.12" | |
debian-version: "debian-10" | |
max-parallel: 6 | |
fail-fast: false | |
needs: repair | |
runs-on: ubuntu-latest | |
container: "pylegacy/${{ matrix.arch }}-python:${{ matrix.python-version }}-${{ matrix.debian-version }}" | |
steps: | |
- | |
name: Download checkout | |
uses: actions/download-artifact@v1 | |
with: | |
name: checkout | |
path: . | |
- | |
name: Download repair artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifacts-repair-${{ matrix.arch }}-${{ matrix.python-version }} | |
path: wheelyard | |
- | |
name: Fixup pip and wheel | |
run: | | |
sh recipes/fix-pip.sh | |
sh recipes/fix-wheel.sh | |
- | |
name: Install package | |
run: | | |
pip install wheelyard/*.whl | |
- | |
name: Test package | |
run: | | |
python -c "import numpy as np" | |
- | |
name: Upload release artifacts | |
uses: actions/upload-artifact@v1 | |
with: | |
name: artifacts-upload | |
path: wheelyard | |
upload: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Download release artifacts | |
uses: actions/download-artifact@v1 | |
with: | |
name: artifacts-upload | |
path: wheelyard | |
- | |
name: Install SSH key | |
uses: shimataro/ssh-key-action@v2 | |
with: | |
key: ${{ secrets.REMOTE_KEY }} | |
known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
- | |
name: Sync packages | |
run: | | |
rsync -avP \ | |
wheelyard/ \ | |
${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.REMOTE_ROOT }}/pypi/pool/ | |
update: | |
needs: upload | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Trigger wheelyard update | |
uses: peter-evans/repository-dispatch@v2 | |
with: | |
token: ${{ secrets.REPO_ACCESS_TOKEN }} | |
event-type: update-wheelyard |