Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and publish Pyodide wheels #161

Merged
merged 9 commits into from
Sep 12, 2024
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
39 changes: 26 additions & 13 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

jobs:
build_wheels:
name: ${{ matrix.os }}, Python ${{ matrix.python }}
name: ${{ matrix.os }}, ${{matrix.python_impl }} ${{ matrix.python }}
runs-on: ${{ matrix.os }}
defaults:
run:
Expand All @@ -20,6 +20,11 @@ jobs:
matrix:
python: [cp39, cp310, cp311, cp312]
os: [ubuntu-latest, windows-latest, macOS-latest]
python_impl: [Python]
include:
- python: cp312
os: ubuntu-latest
python_impl: Pyodide
env:
BUILD_COMMIT: "main" # or a specific version, e.g., v0.13.1
CIBW_BUILD: ${{ matrix.python }}-*
Expand All @@ -30,8 +35,8 @@ jobs:
CIBW_SKIP: "pp* *-win32 cp38-musllinux* cp39-musllinux* *musllinux_aarch64*"
CIBW_TEST_REQUIRES: pytest pytest-xdist
CIBW_TEST_COMMAND: python -c "import statsmodels; statsmodels.test(['--skip-examples','--skip-slow','-n','2'])"
# Avoid testing on emulated architectures
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x}"
# Avoid testing on emulated architectures and Pyodide
CIBW_TEST_SKIP: "*-*linux_{aarch64,ppc64le,s390x} *pyodide*"
CIBW_REPAIR_WHEEL_COMMAND_LINUX: 'auditwheel repair --strip -w {dest_dir} {wheel}'
MULTIBUILD_WHEELS_STAGING_ACCESS: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }}
SCIENTIFIC_PYTHON_NIGHTLY_WHEELS: ${{ secrets.SCIENTIFIC_PYTHON_NIGHTLY_WHEELS }}
Expand All @@ -45,25 +50,33 @@ jobs:
submodules: recursive
fetch-depth: 0

# Used to host cibuildwheel runner
- uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
run: |
python -m cibuildwheel --output-dir wheelhouse statsmodels
uses: pypa/[email protected]
if: matrix.python_impl != 'Pyodide'
with:
output-dir: wheelhouse
package-dir: statsmodels
env:
CIBW_BEFORE_BUILD: 'git submodule foreach git checkout ${{ env.BUILD_COMMIT }}'

- name: Build Pyodide wheel
if: matrix.python_impl == 'Pyodide'
uses: pypa/[email protected]
with:
output-dir: wheelhouse
package-dir: statsmodels
env:
CIBW_BEFORE_BUILD: 'git submodule foreach git checkout ${{ env.BUILD_COMMIT }}'
CIBW_PLATFORM: pyodide
# Tests are slow, and statsmodels is tested out-of-tree on PRs in the main repository
# CIBW_TEST_REQUIRES: pytest
# CIBW_TEST_COMMAND: python -c "import statsmodels; statsmodels.test(['--skip-examples','--skip-slow'])"

- name: Setup Upload Variables
if: ${{ always() }}
Expand Down