Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .github/workflows/official-docker-images.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/pytest.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# In general, we try to run on:
# - The oldest supported python
# - The latest stable python that is the common default on most systems and conda
# - (During transitions) The newly released bleeding edge python

name: Run Tests

on:
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Python-${{ matrix.python }} on ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python: "3.10"
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.12"
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.13"
arch: Linux-x86_64
ompdisable: 0
- os: macos-15
python: "3.11"
arch: MacOSX-arm64
ompdisable: 1
- os: macos-15
python: "3.13"
arch: MacOSX-arm64
ompdisable: 1
steps:
- name: Checkout
uses: actions/checkout@v6

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v4
with:
auto-update-conda: true
activate-environment: test
python-version: ${{ matrix.python }}
miniforge-version: latest
channel-priority: strict
channels: conda-forge
conda-remove-defaults: "true"

- name: Check Conda Config
run: |
conda info
conda list
conda config --show-sources
conda config --show

- name: Install Dependencies
run: |
conda install --yes --file conda_dev_requirements.txt

- name: Install so3g
run: |
python3 -m pip install -v ".[test]" -Ccmake.define.DISABLE_OPENMP=${{ matrix.ompdisable }}

- name: Run Tests
run: |
export OMP_NUM_THREADS=2
pytest ./test
59 changes: 23 additions & 36 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,22 @@ concurrency:
cancel-in-progress: true

jobs:
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v6
with:
name: cibw-sdist
path: dist/*.tar.gz

build_wheels:
name: Build wheel for cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -38,28 +54,6 @@ jobs:
python: 313
builder: manylinux

# MacOS x86_64.
- os: macos-15-intel
arch: x86_64
python: 310
builder: macosx
deploy: 15.0
- os: macos-15-intel
arch: x86_64
python: 311
builder: macosx
deploy: 15.0
- os: macos-15-intel
arch: x86_64
python: 312
builder: macosx
deploy: 15.0
- os: macos-15-intel
arch: x86_64
python: 313
builder: macosx
deploy: 15.0

# MacOS arm64
- os: macos-15
arch: arm64
Expand Down Expand Up @@ -90,26 +84,19 @@ jobs:
CC=gcc
CXX=g++
CFLAGS='-O3 -fPIC'
CXXFLAGS='-O3 -fPIC -std=c++14'
BOOST_ROOT=/usr/local
FLAC_ROOT=/usr/local
SO3G_BUILD_BLAS_LIBRARIES='-L/usr/local/lib -lopenblas -fopenmp -lm -lgfortran'
CXXFLAGS='-O3 -fPIC -std=c++17'
CMAKE_ARGS="-DBLAS_LIBRARIES='-L/usr/local/lib -lopenblas -fopenmp -lm -lgfortran'"
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=${{ matrix.deploy }}
CC=gcc-14
CXX=g++-14
CFLAGS='-O3 -fPIC'
CXXFLAGS='-O3 -fPIC -std=c++14'
CPATH='/usr/local/include'
BOOST_ROOT=/usr/local
FLAC_ROOT=/usr/local
SO3G_BUILD_BLAS_LIBRARIES='/usr/local/lib/libopenblas.dylib'
CXXFLAGS='-O3 -fPIC -std=c++17'
CMAKE_ARGS="-DDISABLE_OPENMP=1 -DBLAS_LIBRARIES='/usr/local/lib/libopenblas.dylib'"
CIBW_BEFORE_BUILD_LINUX: ./wheels/install_deps_linux.sh
CIBW_BEFORE_BUILD_MACOS: >
ln -s $(dirname $(readlink -f $(which python3)))/python3-config $(dirname $(which python3))/python3-config &&
./wheels/install_deps_osx.sh
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ./wheels/repair_wheel_linux.sh {dest_dir} {wheel}
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ./wheels/repair_wheel_macos.sh {dest_dir} {wheel} {delocate_archs}
CIBW_BEFORE_TEST_LINUX: >
python -m pip install pytest pixell &&
export OMP_NUM_THREADS=2
Expand Down Expand Up @@ -137,11 +124,11 @@ jobs:

- uses: actions/upload-artifact@v7
with:
name: wheels_cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
name: cibw-wheels_cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
path: ./wheelhouse/so3g*cp${{ matrix.python }}-${{ matrix.builder }}*${{ matrix.arch }}*.whl

upload_pypi:
needs: build_wheels
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
Expand All @@ -152,7 +139,7 @@ jobs:
uses: actions/download-artifact@v8
with:
# unpacks all CIBW artifacts into dist/
pattern: wheels_*
pattern: cibw-*
path: dist
merge-multiple: true

Expand Down
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
## build directory
build/

## Generated sources
src/_version.h
python/_version.py

## Testing files
.coverage
*.g3
Expand Down Expand Up @@ -58,3 +62,6 @@ docs/_build

# vim
*.swp

# vscode
.vscode
Loading
Loading