Skip to content

Commit

Permalink
Merge pull request #298 from t20100/update-setup
Browse files Browse the repository at this point in the history
CI and Build: Updated setup.py and continuous integration configuration
  • Loading branch information
t20100 authored Apr 15, 2024
2 parents 2782806 + c20ebb0 commit dc05973
Show file tree
Hide file tree
Showing 12 changed files with 260 additions and 3,241 deletions.
97 changes: 24 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,109 +24,60 @@ jobs:
fail-fast: false
matrix:
include:
- name-suffix: "bdist_wheel-h5py_2.8.0"
- name-suffix: "wheel-h5py_2.8.0"
os: ubuntu-latest
python-version: '3.7'
BUILD_COMMAND: bdist_wheel
H5PY_OLDER_VERSION: 2.8.0
OLDEST_DEPENDENCIES: 'h5py==2.8.0'

- name-suffix: "sdist-h5py_2.10.0"
os: ubuntu-latest
python-version: '3.8'
BUILD_COMMAND: sdist
H5PY_OLDER_VERSION: 2.10.0
NUMPY_OLDER_VERSION: 1.23.5
OLDEST_DEPENDENCIES: 'h5py==2.10.0 numpy==1.23.5'

- name-suffix: "bdist_wheel-h5py_3.8.0"
- name-suffix: "wheel-h5py_3.10.0"
os: ubuntu-latest
python-version: '3.10.8'
BUILD_COMMAND: bdist_wheel
H5PY_OLDER_VERSION: 3.8.0
python-version: '3.12'
OLDEST_DEPENDENCIES: 'h5py==3.10.0 "numpy<2"'

- name-suffix: "bdist_wheel-h5py_2.10.0"
- name-suffix: "wheel-h5py_2.10.0"
os: macos-latest
python-version: '3.7.16'
BUILD_COMMAND: bdist_wheel
H5PY_OLDER_VERSION: 2.10.0
OLDEST_DEPENDENCIES: 'h5py==2.10.0 "numpy<2"'
env:
MACOSX_DEPLOYMENT_TARGET: 10.15

- name-suffix: "bdist_wheel-h5py_3.8.0"
- name-suffix: "wheel-h5py_3.8.0"
os: macos-latest
python-version: '3.10.8'
BUILD_COMMAND: bdist_wheel
H5PY_OLDER_VERSION: 3.8.0
OLDEST_DEPENDENCIES: 'h5py==3.8.0 "numpy<2"'

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
with:
fetch-depth: 0

# Runs a single command using the runners shell
- name: Set up Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

# Display the python version
- name: Display Python version
run:
python -c "import sys; print(sys.version)"

- name: Upgrade distribution modules
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install build dependencies
run: |
pip install --upgrade wheel
pip install --upgrade numpy
- name: Install h5py for tests
run: |
pip install --pre h5py
- name: Generate source package or wheel
run: |
python setup.py ${{ matrix.BUILD_COMMAND }}
ls dist
- name: Install from source package
run: |
pip install --pre "$(ls dist/hdf5plugin-*)[test]" --only-binary blosc2 || pip install --pre dist/hdf5plugin-*
- name: Print python info
run: |
python ./ci/info_platform.py
pip list
cache: 'pip'
- name: Install build tool
run: python -m pip install --upgrade pip build
- name: Build sdist and wheel
run: python -m build
- name: Install wheel
run: pip install --pre "$(ls dist/hdf5plugin-*.whl)[test]" --only-binary blosc2 || pip install --pre dist/hdf5plugin-*.whl
- name: Run the tests with latest h5py
run:
python test/test.py

- name: Run the tests with oldest available wheel of h5py
run: python test/test.py
- name: Run the tests with oldest h5py
run: |
if [ -n "${{ matrix.NUMPY_OLDER_VERSION }}" ]; then
pip install --upgrade numpy==${{ matrix.NUMPY_OLDER_VERSION }};
fi
pip install --upgrade h5py==${{ matrix.H5PY_OLDER_VERSION }}
pip list
pip install ${{ matrix.OLDEST_DEPENDENCIES }}
python test/test.py
build_wheels_macos:
name: Build ARM64 wheels on macos-11
runs-on: macos-11
steps:
- uses: actions/checkout@v2

- name: Build wheels
uses: pypa/cibuildwheel@v2.13.0
- uses: actions/checkout@v4
- uses: pypa/cibuildwheel@v2.16.5
env:
CIBW_BUILD: cp39-macosx_*
CIBW_BUILD: cp311-macosx_*
CIBW_ARCHS_MACOS: arm64
HDF5PLUGIN_SSE2: False
HDF5PLUGIN_SSSE3: False
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ jobs:
python-version: ['3.7', '3.12']
include:
- python-version: '3.7'
OLDEST_DEPENDENCIES: 'h5py==2.8.0'
OLDEST_DEPENDENCIES: 'h5py==2.8.0 "numpy<2"'
- python-version: '3.12'
OLDEST_DEPENDENCIES: 'h5py==3.10.0'
OLDEST_DEPENDENCIES: 'h5py==3.10.0 "numpy<2"'

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"
jobs:
pre_install:
- echo "HDF5PLUGIN_STRIP=${HDF5PLUGIN_STRIP}"
Expand All @@ -22,6 +22,6 @@ sphinx:
# Optionally set the version of Python and requirements required to build your docs
python:
install:
- requirements: requirements.txt
- method: pip
path: .
extra_requirements: doc
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ include appveyor.yml
include build-deb.sh
include CHANGELOG.rst
include copyright
include cpuinfo.py
include LICENSE
include MANIFEST.in
include README.rst
include setup.py
recursive-include ci *.py
recursive-include doc *
recursive-include src *
recursive-include test *.py *.h5
Expand Down
13 changes: 5 additions & 8 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ environment:
- BUILD_PY_PATH: "C:\\Python312-x64;C:\\Python312-x64\\Scripts"
TEST_PY_PATH: "C:\\Python312-x64;C:\\Python312-x64\\Scripts"
INSTALL_CMD: "python -m pip install --upgrade --pre"
H5PY_OLDER_VERSION: "3.10.0"
OLDEST_DEPENDENCIES: "h5py==3.10.0 numpy<2"

# Miniconda37
- BUILD_PY_PATH: "C:\\Python37-x64;C:\\Python37-x64\\Scripts"
TEST_PY_PATH: "C:\\Miniconda37-x64;C:\\Miniconda37-x64\\Library\\mingw-w64\\bin;C:\\Miniconda37-x64\\Library\\usr\\bin;C:\\Miniconda37-x64\\Library\\bin;C:\\Miniconda37-x64\\Scripts;C:\\Miniconda37-x64\\bin;C:\\Miniconda37-x64\\condabin"
INSTALL_CMD: "conda install -y"
H5PY_OLDER_VERSION: "2.8.0"
OLDEST_DEPENDENCIES: "h5py==2.8.0 numpy<2"


install:
Expand All @@ -31,15 +31,12 @@ install:
- "SET PATH=%BUILD_PY_PATH%;%OLD_PATH%"

# Upgrade distribution modules and dependencies
- "python -m pip install --upgrade pip setuptools wheel h5py"

# Print Python info
- "python ci\\info_platform.py"
- "python -m pip install --upgrade pip build"
- "pip freeze"


build_script:
- "python setup.py bdist_wheel"
- "python -m build --wheel"
- ps: "ls dist"


Expand All @@ -61,7 +58,7 @@ test_script:
- "python test\\test.py"

# Test with oldest available wheel of h5py
- "%INSTALL_CMD% h5py==%H5PY_OLDER_VERSION%"
- "%INSTALL_CMD% %OLDEST_DEPENDENCIES%"
- "pip freeze"
- "python test\\test.py"

Expand Down
19 changes: 0 additions & 19 deletions ci/info_platform.py

This file was deleted.

Loading

0 comments on commit dc05973

Please sign in to comment.