Skip to content

Commit

Permalink
Merge pull request #542 from djhoese/ci-cibuildwheel
Browse files Browse the repository at this point in the history
  • Loading branch information
mraspaud authored Sep 25, 2023
2 parents 3e7de5d + 36f00c7 commit 48f10d3
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 108 deletions.
70 changes: 24 additions & 46 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Deploy sdist and wheels
name: Build sdist and wheels
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency
# https://docs.github.com/en/developers/webhooks-and-events/events/github-event-types#pullrequestevent
concurrency:
Expand All @@ -21,6 +21,8 @@ jobs:

- name: Create sdist
shell: bash -l {0}
# For non-tags/releases this won't produce a valid version number in the package
# We'd have to download the entire git history which is wasteful in CI
run: |
python -m pip install -q build
python -m build -s
Expand All @@ -33,69 +35,45 @@ jobs:


build_wheels:
name: "Build wheels on ${{ matrix.os }} ${{ matrix.cibw_archs }}"
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
cibw_archs: "AMD64 ARM64"
- os: macos-11
cibw_archs: "x86_64 arm64"
- os: "ubuntu-20.04"
cibw_archs: "aarch64"
- os: "ubuntu-20.04"
cibw_archs: "x86_64"

steps:
- uses: actions/checkout@v4
- run: |
git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
python-version: '${{ matrix.python-version }}'
platforms: all

- 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: Build wheels
uses: pypa/[email protected]
env:
CIBW_SKIP: "cp36-* cp37-* cp38-* pp* *i686 *-musllinux* cp312-*"
CIBW_ARCHS: "${{ matrix.cibw_archs }}"
CIBW_TEST_COMMAND: "python -c \"import pyresample; assert 'unknown' not in pyresample.__version__, 'incorrect version found'\""
CIBW_TEST_SKIP: "*_arm64 *_universal2:arm64"

- 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
47 changes: 0 additions & 47 deletions continuous_integration/build-manylinux-wheels.sh

This file was deleted.

23 changes: 12 additions & 11 deletions continuous_integration/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@ name: test-environment
channels:
- conda-forge
dependencies:
- xarray
- cartopy
- configobj
- Cython
- dask
- distributed
- donfig
- toolz
- Cython
- sphinx
- cartopy
- pillow
- matplotlib
- pillow
- platformdirs
- pyyaml
# 9.3.1 includes bug fix
- proj !=9.3.0
- pyproj
- pykdtree
- rasterio
- coveralls
- coverage
- codecov
- configobj
- zarr
- shapely
- scipy
- sphinx
- toolz
- xarray
- zarr
- coverage
- pytest
- pytest-cov
- pytest-lazy-fixture
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"
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@
'xarray_bilinear': ['xarray', 'dask', 'zarr'],
'tests': test_requires}

setup_requires = ['numpy>=1.10.0', 'cython']

if sys.platform.startswith("win"):
extra_compile_args = []
else:
Expand Down Expand Up @@ -88,7 +86,6 @@
packages=find_packages(),
package_data={'pyresample.test': ['test_files/*']},
python_requires='>=3.9',
setup_requires=setup_requires,
install_requires=requirements,
extras_require=extras_require,
ext_modules=cythonize(extensions),
Expand Down

0 comments on commit 48f10d3

Please sign in to comment.