Skip to content

Commit

Permalink
Switch to cibuildwheel for wheel building
Browse files Browse the repository at this point in the history
  • Loading branch information
djhoese committed Sep 21, 2023
1 parent 3e7de5d commit 699dc7b
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 47 deletions.
90 changes: 44 additions & 46 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,69 +33,67 @@ jobs:


build_wheels:
name: "Build wheels on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11']
include:
# Using pythons inside a docker image to provide all the Linux
# python-versions permutations.
- name: manylinux 64-bit
os: ubuntu-latest
python-version: '3.11'
docker-image: manylinux2014_x86_64
os: [windows-2019, macos-11, ubuntu-20.04]

steps:
- uses: actions/checkout@v4
- run: |
git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: '${{ matrix.python-version }}'

- name: Install dependencies
run: |
python -m pip install -U -q pip Cython wheel setuptools twine numpy build
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *-manylinux_i686 *-musllinux*"
CIBW_ARCHS: auto64
CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\""

- name: Build and install macOS/Windows wheel
if: matrix.os != 'ubuntu-latest'
run: |
python -m build -w
pip install --find-links=./dist/ pyresample

- name: Build Linux wheels inside docker
if: matrix.os == 'ubuntu-latest'
run: |
docker run \
-e PLAT=${{ matrix.docker-image }} \
-e USE_OMP=1 \
-v `pwd`:/io \
quay.io/pypa/${{ matrix.docker-image }} \
/io/continuous_integration/build-manylinux-wheels.sh
- name: Check version number from inside wheel
if: matrix.docker-image != 'manylinux2014_i686'
# install dependencies
# uninstall source installation
# move source to make sure it isn't include in checks
run: |
python -m pip install pip-tools
python -m piptools compile -o requirements.txt
mv pyresample unused_src_to_prevent_local_import
python -m pip install -r requirements.txt
python -m pip install --force-reinstall --no-index --no-cache-dir --no-deps --find-links=./dist/ pyresample
python -c "import pyresample; print(pyresample.__file__, pyresample.__version__)"
python -c "import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'"
#
#
# - name: Install dependencies
# run: |
# python -m pip install -U -q pip Cython wheel setuptools twine numpy build
#
# - name: Build and install macOS/Windows wheel
# if: matrix.os != 'ubuntu-latest'
# run: |
# python -m build -w
# pip install --find-links=./dist/ pyresample
#
# - name: Build Linux wheels inside docker
# if: matrix.os == 'ubuntu-latest'
# run: |
# docker run \
# -e PLAT=${{ matrix.docker-image }} \
# -e USE_OMP=1 \
# -v `pwd`:/io \
# quay.io/pypa/${{ matrix.docker-image }} \
# /io/continuous_integration/build-manylinux-wheels.sh
#
# - name: Check version number from inside wheel
# if: matrix.docker-image != 'manylinux2014_i686'
# # install dependencies
# # uninstall source installation
# # move source to make sure it isn't include in checks
# run: |
# python -m pip install pip-tools
# python -m piptools compile -o requirements.txt
# mv pyresample unused_src_to_prevent_local_import
# python -m pip install -r requirements.txt
# python -m pip install --force-reinstall --no-index --no-cache-dir --no-deps --find-links=./dist/ pyresample
# python -c "import pyresample; print(pyresample.__file__, pyresample.__version__)"
# python -c "import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'"

- name: Upload wheel(s) as build artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: dist/*.whl
path: ./wheelhouse/*.whl

upload_test_pypi:
needs: [build_sdist, build_wheels]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[build-system]
requires = ["setuptools", "wheel", "oldest-supported-numpy", "Cython", "versioneer-518"]
requires = ["setuptools", "wheel", "numpy", "Cython", "versioneer-518"]
build-backend = "setuptools.build_meta"

0 comments on commit 699dc7b

Please sign in to comment.