Skip to content

BLD: Test editable installations for PyWavelets in CI #201

BLD: Test editable installations for PyWavelets in CI

BLD: Test editable installations for PyWavelets in CI #201

Workflow file for this run

name: Test
env:
# Coloured output for GitHub Actions
FORCE_COLOR: 3
# Some common environment variables, required for both GNU/Linux and macOS jobs
MPLBACKEND: Agg
CYTHON_TRACE: 1
CYTHONSPEC: cython
NUMPY_MIN: numpy==1.22.4
CYTHON_MIN: cython==0.29.35
SCIPY_MIN: scipy==1.8.0
on:
push:
branches:
- master
- v1.**
pull_request:
branches:
- master
- v1.**
jobs:
test_pywavelets_linux:
name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: ubuntu-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
MINIMUM_REQUIREMENTS: [0]
USE_SCIPY: [0]
USE_SDIST: [0]
REFGUIDE_CHECK: [0]
PIP_FLAGS: [""]
OPTIONS_NAME: ["default"]
include:
- platform_id: manylinux_x86_64
python-version: '3.9'
MINIMUM_REQUIREMENTS: 1
OPTIONS_NAME: "minimum-req"
- platform_id: manylinux_x86_64
python-version: '3.9'
USE_SCIPY: 1
OPTIONS_NAME: "with-scipy"
- platform_id: manylinux_x86_64
python-version: '3.9'
USE_SDIST: 1
OPTIONS_NAME: "install-from-sdist"
- platform_id: manylinux_x86_64
python-version: '3.12'
PIP_FLAGS: "--pre"
OPTIONS_NAME: "pre-releases"
- platform_id: manylinux_x86_64
python-version: '3.12'
OPTIONS_NAME: "editable-install"
steps:
- name: Checkout PyWavelets
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version}}
allow-prereleases: true
- name: Build package
env:
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }}
run: |
uname -a
df -h
ulimit -a
# ccache -s
which python
python --version
# sudo apt-get install libatlas-base-dev
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN}
pip install ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
elif [ "${OPTIONS_NAME}" == "editable-install" ]; then
echo "Testing an editable install of pywt"
sudo apt-get install ninja-build
pip install numpy==1.26.0 cython meson-python matplotlib pytest
pip install -e . --no-build-isolation
else
pip install ${PIP_FLAGS} cython
pip install ${PIP_FLAGS} numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
set -o pipefail
if [ "${USE_SDIST}" == "1" ]; then
python -m build --sdist
pip install dist/pyw*.tar.gz -v
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
pip install sphinx numpydoc
pip install . -v
else
pip install . -v
fi
- name: Run tests
env:
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }}
run: |
set -o pipefail
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
elif [ "${OPTIONS_NAME}" == "editable-install" ]; then
# pytest --pyargs pywt invocation currently does not work
# with editable installations
# see https://github.com/PyWavelets/pywt/issues/700
pytest ../pywt
else
pytest --pyargs pywt
fi
popd
test_pywavelets_macos:
name: macos-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: macos-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.9, '3.12']
MINIMUM_REQUIREMENTS: [0]
USE_SCIPY: [0]
USE_SDIST: [0]
REFGUIDE_CHECK: [0]
PIP_FLAGS: [""]
OPTIONS_NAME: ["default"]
include:
- python-version: '3.9'
MINIMUM_REQUIREMENTS: 1
OPTIONS_NAME: "osx-minimum-req"
- python-version: '3.12'
PIP_FLAGS: "--pre"
OPTIONS_NAME: "pre-releases"
steps:
- name: Checkout PyWavelets
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version}}
allow-prereleases: true
- name: Build package
env:
VERSION: ${{ matrix.python-version }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
USE_SCIPY: ${{ matrix.USE_SCIPY }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
CC: /usr/bin/clang
CXX: /usr/bin/clang++
run: |
uname -a
df -h
ulimit -a
which python
python --version
pip install --upgrade pip build
# Set numpy version first, other packages link against it
if [ "${MINIMUM_REQUIREMENTS}" == "1" ]; then
pip install ${CYTHON_MIN} ${NUMPY_MIN}
if [ "${USE_SCIPY}" == "1" ]; then pip install ${SCIPY_MIN}; fi
else
pip install ${PIP_FLAGS} cython numpy
if [ "${USE_SCIPY}" == "1" ]; then pip install ${PIP_FLAGS} scipy; fi
fi
pip install ${PIP_FLAGS} matplotlib pytest
set -o pipefail
if [ "${USE_SDIST}" == "1" ]; then
python -m build --sdist
pip install pywavelets* -v
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
pip install sphinx numpydoc
pip install . -v
else
pip install . -v
fi
- name: Run tests
env:
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
USE_SDIST: ${{ matrix.USE_SDIST }}
REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }}
run: |
# Move out of source directory to avoid finding local pywt
pushd demo
if [ "${USE_SDIST}" == "1" ]; then
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
else
pytest --pyargs pywt
fi
popd