Skip to content

Commit 592eafa

Browse files
authored
Work on support for numpy-2 and python-3.12 (#198)
* Work on support for numpy-2 and python-3.12 - Remove numpy-1 checks / constraints. - Update wheel workflows and scripts. Add dependabot workflow and combine wheel test / deploy workflows into one. Remove python-3.8 support. - Update README instructions. - Add pyproject.toml and remove unsupported distutils from setup.py - Fix healpix_bare.c compiler warnings - Add missing guard around omp.h inclusion - Remove deprecated datetime functions - Bump vendored boost to version 1.87 and compile our own libflac-1.5.0 - Build our own OpenBLAS for macos wheels * Fix README typo * Add note on the provenance and local modifications to the healpix_bare.c source
1 parent 6eacab7 commit 592eafa

27 files changed

Lines changed: 620 additions & 720 deletions

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Please see the documentation for all configuration options:
2+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
3+
4+
version: 2
5+
updates:
6+
- package-ecosystem: "github-actions"
7+
directory: "/"
8+
schedule:
9+
interval: "weekly"

.github/workflows/deploy.yml

Lines changed: 0 additions & 97 deletions
This file was deleted.

.github/workflows/official-docker-images.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,10 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
# Fetch all history for all tags and branches
1717
with:
1818
fetch-depth: 0
19-
- name: Set up Python 3.8
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 3.8
2319

2420
# Build
2521
- name: Build docker images

.github/workflows/pytest.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ name: Run Tests
22

33
on:
44
push:
5-
branches-ignore: [ master ]
5+
branches:
6+
- master
67
pull_request:
8+
branches:
9+
- master
710

811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,11 +18,7 @@ jobs:
1518

1619
steps:
1720
- name: Checkout
18-
uses: actions/checkout@v2
19-
- name: Set up Python 3.8
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 3.8
21+
uses: actions/checkout@v4
2322

2423
- name: Build docker images
2524
run: |

.github/workflows/wheels.yml

Lines changed: 93 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11

2-
name: Test Binary Wheels
2+
name: Binary Wheels
33

4-
on: workflow_dispatch
4+
on:
5+
workflow_dispatch:
6+
release:
7+
types: [ published ]
58

69
concurrency:
710
group: ${{ github.workflow }}-${{ github.ref }}
@@ -18,10 +21,6 @@ jobs:
1821
matrix:
1922
include:
2023
# Linux 64 bit manylinux
21-
- os: ubuntu-latest
22-
arch: x86_64
23-
python: 38
24-
builder: manylinux
2524
- os: ubuntu-latest
2625
arch: x86_64
2726
python: 39
@@ -34,6 +33,14 @@ jobs:
3433
arch: x86_64
3534
python: 311
3635
builder: manylinux
36+
- os: ubuntu-latest
37+
arch: x86_64
38+
python: 312
39+
builder: manylinux
40+
# - os: ubuntu-latest
41+
# arch: x86_64
42+
# python: 313
43+
# builder: manylinux
3744

3845
# MacOS x86_64. The macos-13 runner is the last
3946
# Intel-based runner version. At some point we'll
@@ -42,27 +49,80 @@ jobs:
4249
arch: x86_64
4350
python: 39
4451
builder: macosx
52+
deploy: 13.0
4553
- os: macos-13
4654
arch: x86_64
4755
python: 310
4856
builder: macosx
57+
deploy: 13.0
4958
- os: macos-13
5059
arch: x86_64
5160
python: 311
5261
builder: macosx
62+
deploy: 13.0
63+
- os: macos-13
64+
arch: x86_64
65+
python: 312
66+
builder: macosx
67+
deploy: 13.0
68+
# - os: macos-13
69+
# arch: x86_64
70+
# python: 313
71+
# builder: macosx
72+
# deploy: 13.0
73+
74+
# MacOS arm64
75+
- os: macos-latest
76+
arch: arm64
77+
python: 310
78+
builder: macosx
79+
deploy: 14.0
80+
- os: macos-latest
81+
arch: arm64
82+
python: 311
83+
builder: macosx
84+
deploy: 14.0
85+
- os: macos-latest
86+
arch: arm64
87+
python: 312
88+
builder: macosx
89+
deploy: 14.0
90+
# - os: macos-latest
91+
# arch: arm64
92+
# python: 313
93+
# builder: macosx
94+
# deploy: 14.0
5395
env:
5496
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
5597
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
5698
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.builder }}2014
5799
CIBW_BUILD_VERBOSITY: 3
58-
CIBW_ENVIRONMENT_LINUX: "CC=gcc CXX=g++ CFLAGS='-O3 -fPIC' CXXFLAGS='-O3 -fPIC -std=c++14' BOOST_ROOT=/usr/local"
59-
CIBW_ENVIRONMENT_MACOS: "MACOSX_DEPLOYMENT_TARGET=13.0 CC=gcc-14 CXX=g++-14 CFLAGS='-O3 -fPIC' CXXFLAGS='-O3 -fPIC -std=c++14' BOOST_ROOT=/usr/local FLAC_ROOT=/usr/local BLAS_LIBRARIES=/usr/local/lib/libscipy_openblas.dylib"
100+
CIBW_ENVIRONMENT_LINUX: >
101+
CC=gcc
102+
CXX=g++
103+
CFLAGS='-O3 -fPIC'
104+
CXXFLAGS='-O3 -fPIC -std=c++14'
105+
BOOST_ROOT=/usr/local
106+
FLAC_ROOT=/usr/local
107+
SO3G_BUILD_BLAS_LIBRARIES='-L/usr/local/lib -lopenblas -fopenmp -lm -lgfortran'
108+
CIBW_ENVIRONMENT_MACOS: >
109+
MACOSX_DEPLOYMENT_TARGET=${{ matrix.deploy }}
110+
CC=gcc-14
111+
CXX=g++-14
112+
CFLAGS='-O3 -fPIC'
113+
CXXFLAGS='-O3 -fPIC -std=c++14'
114+
CPATH='/usr/local/include'
115+
BOOST_ROOT=/usr/local
116+
FLAC_ROOT=/usr/local
117+
SO3G_BUILD_BLAS_LIBRARIES='/usr/local/lib/libopenblas.dylib'
60118
CIBW_BEFORE_BUILD_LINUX: ./wheels/install_deps_linux.sh
61-
CIBW_BEFORE_BUILD_MACOS: ./wheels/install_deps_osx.sh ${{ matrix.builder }}_${{ matrix.arch }}
119+
CIBW_BEFORE_BUILD_MACOS: >
120+
ln -s $(dirname $(readlink -f $(which python3)))/python3-config $(dirname $(which python3))/python3-config &&
121+
./wheels/install_deps_osx.sh
62122
CIBW_REPAIR_WHEEL_COMMAND_LINUX: ./wheels/repair_wheel_linux.sh {dest_dir} {wheel}
63123
CIBW_REPAIR_WHEEL_COMMAND_MACOS: ./wheels/repair_wheel_macos.sh {dest_dir} {wheel} {delocate_archs}
64124
CIBW_BEFORE_TEST: export OMP_NUM_THREADS=2
65-
CIBW_TEST_REQUIRES: pytest
125+
CIBW_TEST_REQUIRES: pytest pixell
66126
CIBW_TEST_COMMAND: >
67127
python -c 'import so3g.smurf.reader; from spt3g import core' &&
68128
python -m pytest {package}/test
@@ -73,17 +133,36 @@ jobs:
73133
- uses: actions/setup-python@v5
74134
name: Install Python
75135
with:
76-
python-version: '3.10'
136+
python-version: '3.12'
77137

78138
- name: Install cibuildwheel
79139
run: |
80-
python -m pip install cibuildwheel==2.20.0
140+
python -m pip install cibuildwheel==2.22.0
81141
82142
- name: Build wheel
83143
run: |
84144
python -m cibuildwheel --output-dir wheelhouse
85145
86146
- uses: actions/upload-artifact@v4
87147
with:
88-
name: wheels_cp${{ matrix.python }}-${{ matrix.builder }}
89-
path: ./wheelhouse/so3g*cp${{ matrix.python }}-${{ matrix.builder }}*.whl
148+
name: wheels_cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
149+
path: ./wheelhouse/so3g*cp${{ matrix.python }}-${{ matrix.builder }}*${{ matrix.arch }}*.whl
150+
151+
upload_pypi:
152+
needs: build_wheels
153+
runs-on: ubuntu-latest
154+
environment: pypi
155+
permissions:
156+
id-token: write
157+
if: github.event_name == 'release' && github.event.action == 'published'
158+
steps:
159+
- name: Download artifacts
160+
uses: actions/download-artifact@v4
161+
with:
162+
# unpacks all CIBW artifacts into dist/
163+
pattern: wheels_*
164+
path: dist
165+
merge-multiple: true
166+
167+
- name: Publish package distributions to PyPI
168+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)