Skip to content

Commit

Permalink
Merge main, retrigger build
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Nov 29, 2024
2 parents 1dc3a0f + fdd1570 commit fd3e01c
Show file tree
Hide file tree
Showing 19 changed files with 254 additions and 981 deletions.
59 changes: 17 additions & 42 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,54 +29,29 @@ env:
jobs:
build_wasm_emscripten:
name: Build PyWavelets for Pyodide
runs-on: ubuntu-latest
# Uncomment the following line to test changes on a fork
# if: github.repository == 'PyWavelets/pywt'
runs-on: ubuntu-22.04
# Comment out the following line to test changes on a fork
if: github.repository == 'PyWavelets/pywt'
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "3.11.2"

- name: Install prerequisites
run: |
python -m pip install pyodide-build "pydantic<2"
echo EMSCRIPTEN_VERSION=$(pyodide config get emscripten_version) >> $GITHUB_ENV
- name: Set up Emscripten toolchain
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
actions-cache-folder: emsdk-cache

- name: Set up Node.js
uses: actions/[email protected]
with:
node-version: "18"

- name: Build PyWavelets
run: |
pyodide build
- name: Install and test wheel
run: |
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate
pip install dist/*.whl
pushd demo
pip install matplotlib pytest
python -c "import pywt; print(pywt.__version__)"
pytest --pyargs pywt -m "not slow"
- name: Build and test PyWavelets
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
env:
CIBW_PLATFORM: pyodide
CIBW_TEST_REQUIRES: pytest matplotlib
CIBW_TEST_COMMAND: python -c "import pywt; pywt.test(extra_argv=['-m', 'not slow'])"

# https://anaconda.org/scientific-python-nightly-wheels/pywavelets
# WARNING: this job will overwrite existing wheels.
- name: Push to Anaconda PyPI index
if: (github.repository == 'PyWavelets/pywt') && (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') || (github.event_name == 'schedule')
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
- name: Push wheels to Anaconda PyPI index
if: >-
(github.repository == 'PyWavelets/pywt') &&
(github.event_name == 'push' && github.ref == 'refs/heads/main') ||
(github.event_name == 'workflow_dispatch' && github.event.inputs.push_wheels == 'true') ||
(github.event_name == 'schedule')
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # v0.6.1
with:
artifacts_path: dist/
artifacts_path: wheelhouse/
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
53 changes: 46 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
MINIMUM_REQUIREMENTS: [0]
USE_SCIPY: [0]
USE_SDIST: [0]
REFGUIDE_CHECK: [0]
REFGUIDE_CHECK: [1]
PIP_FLAGS: [""]
OPTIONS_NAME: ["default"]
include:
Expand Down Expand Up @@ -105,7 +105,7 @@ jobs:
python -m build --sdist
pip install dist/pyw*.tar.gz -v
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
pip install sphinx numpydoc
pip install sphinx numpydoc scipy-doctest
pip install . -v
else
pip install . -v
Expand All @@ -129,16 +129,53 @@ jobs:
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
# Run doctests and check if the refguide contains entries from __all__
python util/refguide_check.py --doctests
# doctest docstrings
pytest --doctest-modules --pyargs pywt -v --doctest-collect=api
# Run Sphinx HTML docs builder, converting warnings to errors
# Move back out of demo/ to root directory
cd ..
pip install -r util/readthedocs/requirements.txt
sphinx-build -b html -W --keep-going -d _build/doctrees . doc/source doc/build
sphinx-build -b html -W --keep-going -d _build/doctrees doc/source doc/build
else
pytest --pyargs pywt
fi
popd
test_pywavelets_linux_free_threaded:
name: linux-cp313t-with-scipy
runs-on: ubuntu-latest
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false

steps:
- name: Checkout PyWavelets
uses: actions/checkout@v4

# TODO: replace with setup-python when there is support
- uses: deadsnakes/action@e640ac8743173a67cca4d7d77cd837e514bf98e8 # v3.2.0
with:
python-version: "3.13-dev"
nogil: true

- name: Build package
run: |
which python
python --version
pip install --upgrade pip build
# We need nightly wheels for free-threaded support and latest fixes
pip install --pre -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy scipy
pip install pytest meson-python ninja
pip install . -v --no-build-isolation
- name: Run tests
env:
PYTHON_GIL: 0
run: |
# Move out of source directory to avoid finding local pywt
cd demo
pytest --pyargs pywt
test_pywavelets_macos:
name: macos-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: macos-latest
Expand Down Expand Up @@ -203,7 +240,7 @@ jobs:
python -m build --sdist
pip install pywavelets* -v
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
pip install sphinx numpydoc
pip install sphinx numpydoc scipy-doctest
pip install . -v
else
pip install . -v
Expand All @@ -221,7 +258,9 @@ jobs:
pytest --pyargs pywt
python ../pywt/tests/test_doc.py
elif [ "${REFGUIDE_CHECK}" == "1" ]; then
python util/refguide_check.py --doctests
# doctests docstrings
pytest --doctest-modules --pyargs pywt -v --doctest-collect=api
pytest --doctest-modules --pyargs pywt.data -v
else
pytest --pyargs pywt
fi
Expand Down
80 changes: 61 additions & 19 deletions .github/workflows/wheel_tests_and_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
cibw_arch: ["x86_64"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -44,16 +44,29 @@ jobs:
name: Install Python
with:
python-version: "3.10"

- name: Install build deps; set CIBW environment variables
if: ${{ matrix.cibw_python }} == "cp313t"
run: |
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
CIBW_DEPS="pip install --pre -i $PYPI_URL cython scipy &&\
pip install numpy pytest meson-python ninja"
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
- name: Build the wheel
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_1
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
CIBW_MUSLLINUX_X86_64_IMAGE: musllinux_1_2
CIBW_FREE_THREADED_SUPPORT: True
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
path: ./dist/*.whl
Expand All @@ -66,7 +79,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313"]
cibw_arch: ["aarch64"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
Expand All @@ -80,16 +93,17 @@ jobs:
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Build the wheel
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_1
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
CIBW_MUSLLINUX_AARCH64_IMAGE: musllinux_1_2
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: wheels_linux_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
path: ./dist/*.whl
Expand All @@ -102,13 +116,16 @@ jobs:
matrix:
# macos-13 is the last runner that supports Intel (x86_64) architecture
os: [macos-13, macos-14]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
cibw_arch: ["x86_64", "arm64"]
exclude:
- os: macos-14
cibw_arch: "x86_64"
- os: macos-13
cibw_arch: "arm64"
- os: macos-13
cibw_arch: "x86_64"
cibw_python: "cp313t"
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -119,9 +136,20 @@ jobs:
with:
python-version: "3.12"

- name: Install build deps; set CIBW environment variables
if: ${{ matrix.cibw_python }} == "cp313t"
run: |
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
CIBW_DEPS="pip install --pre -i $PYPI_URL cython scipy &&\
pip install numpy pytest meson-python ninja"
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
- name: Build wheels for CPython (macOS) (x86_64)
if: matrix.cibw_arch == 'x86_64'
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
output-dir: dist
env:
Expand All @@ -130,14 +158,15 @@ jobs:

- name: Build wheels for CPython (macOS) (arm64)
if: matrix.cibw_arch == 'arm64'
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
CIBW_FREE_THREADED_SUPPORT: True

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: wheels_macos_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
path: ./dist/*.whl
Expand All @@ -151,7 +180,7 @@ jobs:
matrix:
os: [windows-latest]
cibw_arch: ["AMD64", "x86"]
cibw_python: ["cp310", "cp311", "cp312"]
cibw_python: ["cp310", "cp311", "cp312", "cp313", "cp313t"]
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
with:
Expand All @@ -174,15 +203,28 @@ jobs:
with:
architecture: x64

- name: Install build deps; set CIBW environment variables
if: ${{ matrix.cibw_python }} == "cp313t"
shell: bash -el {0}
run: |
PYPI_URL="https://pypi.anaconda.org/scientific-python-nightly-wheels/simple"
CIBW_DEPS="pip install --pre -i $PYPI_URL cython numpy &&\
pip install pytest meson-python ninja"
NO_BUILD_ISOLATION="pip; args: --no-build-isolation"
echo "CIBW_BEFORE_BUILD=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BEFORE_TEST=$CIBW_DEPS" >> "$GITHUB_ENV"
echo "CIBW_BUILD_FRONTEND=$NO_BUILD_ISOLATION" >> "$GITHUB_ENV"
- name: Build Windows wheels for CPython
uses: pypa/cibuildwheel@8d945475ac4b1aac4ae08b2fd27db9917158b6ce # 2.17.0
uses: pypa/cibuildwheel@7940a4c0e76eb2030e473a5f864f291f63ee879b # v2.21.3
with:
output-dir: dist
env:
CIBW_BUILD: ${{ matrix.cibw_python }}-*
CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_arch }}
CIBW_FREE_THREADED_SUPPORT: True

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
- uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: wheels_windows_${{ matrix.cibw_arch }}_${{ matrix.cibw_python }}
path: ./dist/*.whl
Expand Down Expand Up @@ -216,7 +258,7 @@ jobs:
pip install twine
pip install cython numpy build
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
id: download
with:
pattern: "wheels_*"
Expand All @@ -237,7 +279,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}

- name: Github release
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # v2.0.4
uses: softprops/action-gh-release@e7a8f85e1c67a31e6ed99a94b41bd0b71bbee6b8 # v2.0.9
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
Expand All @@ -263,15 +305,15 @@ jobs:
with:
fetch-depth: 0

- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
id: download
with:
pattern: "wheels_*"
path: dist/
merge-multiple: true

- name: Push to Anaconda PyPI index
uses: scientific-python/upload-nightly-action@b67d7fcc0396e1128a474d1ab2b48aa94680f9fc # v0.5.0
uses: scientific-python/upload-nightly-action@82396a2ed4269ba06c6b2988bb4fd568ef3c3d6b # v0.6.1
with:
artifacts_path: dist/
anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }}
Loading

0 comments on commit fd3e01c

Please sign in to comment.