Skip to content

Commit

Permalink
Install gsl into container and reenable mac wheels (#388)
Browse files Browse the repository at this point in the history
* install gsl into container and reenable mac build

* don't build wheels for 3.9 [skip tests] [skip docs]

* use a newer manylinux [skip tests] [skip docs]

* oops too future manylinux - also wtf why aren't tests skipping [skip tests]

* back to 2_28 and testing skip

* disable mac wheels again, alas, and still testing [skip tests]

* maybe have skip working [skip tests] and new attempt at macos wheels

* maybe I need -y? [skip tests] [skip docs]

* only build x86 on linux now [skip tests] [skip docs]
  • Loading branch information
adrn authored Aug 26, 2024
1 parent 78a175b commit 4c69021
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 68 deletions.
108 changes: 63 additions & 45 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,25 @@ on:
pull_request:

jobs:
check_skip_flags:
name: Check skip flags
runs-on: ubuntu-latest
outputs:
head-commit-message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
- name: Get head commit message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

tests:
name: Python ${{ matrix.python-version }} on ${{ matrix.os }} with numpy ${{ matrix.numpy-version }}, no gsl ${{ matrix.gala-nogsl }}, deps ${{ matrix.pip-test-deps }}
runs-on: ${{ matrix.os }}
if: ${{ github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'docs only') && !contains(github.event.head_commit.message, '[skip tests]')}}
needs: check_skip_flags
if: ${{ github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'docs only') && !contains(needs.check_skip_flags.outputs.head-commit-message, '[skip tests]') }}
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -54,47 +69,50 @@ jobs:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

# For animation tests
- uses: FedericoCarboni/setup-ffmpeg@v3
if: ${{ !startsWith(matrix.os, 'mac') }}
continue-on-error: true
with:
# Not strictly necessary, but it may prevent rate limit
# errors especially on GitHub-hosted macos machines.
github-token: ${{ secrets.GITHUB_TOKEN }}
ffmpeg-version: "6.1.0"
id: setup-ffmpeg

# Mac:
- name: Setup Mac - GSL
if: startsWith(matrix.os, 'mac')
run: |
brew install gsl
# Ubuntu:
- name: Setup Linux - GSL
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install gsl-bin libgsl0-dev build-essential
sudo apt-get install libhdf5-serial-dev # TODO: remove when h5py has 3.11 wheels
- name: Install package and dependencies
run: python -m pip install -e ".[${{ matrix.pip-test-deps }}]"
env:
GALA_NOGSL: ${{ matrix.gala-nogsl }}

- name: Update versions if testing min versions
if: matrix.numpy-version != 'latest'
run: |
python -m pip install numpy~=${{ matrix.numpy-version }}
- name: Run tests
run: >-
python -m pytest -ra --cov --cov-report=xml --cov-report=term
--durations=20 .
- name: Upload coverage report
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: WTF
run: echo ${{ needs.check_skip_flags.outputs.HEAD_COMMIT_MESSAGE }}

# # For animation tests
# - uses: FedericoCarboni/setup-ffmpeg@v3
# if: ${{ !startsWith(matrix.os, 'mac') }}
# continue-on-error: true
# with:
# # Not strictly necessary, but it may prevent rate limit
# # errors especially on GitHub-hosted macos machines.
# github-token: ${{ secrets.GITHUB_TOKEN }}
# ffmpeg-version: "6.1.0"
# id: setup-ffmpeg

# # Mac:
# - name: Setup Mac - GSL
# if: startsWith(matrix.os, 'mac')
# run: |
# brew install gsl

# # Ubuntu:
# - name: Setup Linux - GSL
# if: runner.os == 'Linux'
# run: |
# sudo apt-get update
# sudo apt-get install gsl-bin libgsl0-dev build-essential
# sudo apt-get install libhdf5-serial-dev # TODO: remove when h5py has 3.11 wheels

# - name: Install package and dependencies
# run: python -m pip install -e ".[${{ matrix.pip-test-deps }}]"
# env:
# GALA_NOGSL: ${{ matrix.gala-nogsl }}

# - name: Update versions if testing min versions
# if: matrix.numpy-version != 'latest'
# run: |
# python -m pip install numpy~=${{ matrix.numpy-version }}

# - name: Run tests
# run: >-
# python -m pytest -ra --cov --cov-report=xml --cov-report=term
# --durations=20 .

# - name: Upload coverage report
# uses: codecov/[email protected]
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
17 changes: 16 additions & 1 deletion .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,25 @@ on:
- published

jobs:
check_skip_flags:
name: Check skip flags
runs-on: ubuntu-latest
outputs:
head-commit-message: ${{ steps.get_head_commit_message.outputs.HEAD_COMMIT_MESSAGE }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ env.GITHUB_SHA }}
- name: Get head commit message
id: get_head_commit_message
run: echo "HEAD_COMMIT_MESSAGE=$(git show -s --format=%s)" >> "$GITHUB_OUTPUT"

notebooks:
name: "Build the notebooks for the docs"
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false && !contains(github.event.head_commit.message, '[skip docs]')
needs: check_skip_flags
if: ${{ github.event.pull_request.draft == false && !contains(needs.check_skip_flags.outputs.head-commit-message, '[skip docs]') }}
steps:
- uses: actions/checkout@v4
with:
Expand Down
31 changes: 9 additions & 22 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,30 @@ jobs:
matrix:
# Building wheels on linux takes too much time: split wheels into multiple runs
python:
- ["1", "cp39-* cp310-*"]
- ["2", "cp311-* cp312-*"]
- ["1", "cp310-*"]
- ["2", "cp311-*"]
- ["3", "cp312-*"]
os:
# - "macos-14"
- "macos-14"
- "ubuntu-latest"

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

# Mac: disable wheels on mac because of GSL issues
# NOTE: need to install pipx explicitly for macos-14
# - name: Setup Mac
# if: runner.os == 'macOS'
# run: |
# brew install gsl pipx

# Ubuntu:
- name: Setup Linux
if: runner.os == 'Linux'
run: |
sudo apt-get install gsl-bin libgsl0-dev
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_ARCHS_LINUX: "x86_64"
CIBW_ARCHS_MACOS: "x86_64 arm64"
CIBW_BUILD: ${{ matrix.python[1] }}
CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_28
CIBW_SKIP: "*-win32 *musllinux* pp* *i686"
CIBW_BEFORE_ALL_LINUX: dnf install -y gsl gsl-devel || apt-get install gsl-bin libgsl0-dev
CIBW_BEFORE_ALL_MACOS: brew install gsl pipx
MACOSX_DEPLOYMENT_TARGET: 14.0

- uses: actions/upload-artifact@v4
with:
Expand Down
5 changes: 5 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ build:
os: ubuntu-22.04
tools:
python: "mambaforge-4.10"
jobs:
post_checkout:
# Use `git log` to check if the latest commit contains "skip ci",
# in that case exit the command with 183 to cancel the build
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip docs") || exit 183


conda:
Expand Down

0 comments on commit 4c69021

Please sign in to comment.