Skip to content

Commit d9665c5

Browse files
committed
Begin packaging effort
1 parent f47735c commit d9665c5

File tree

9 files changed

+583
-1
lines changed

9 files changed

+583
-1
lines changed

.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: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Deploy tagged releases.
2+
3+
name: Deploy Release
4+
5+
on:
6+
push:
7+
tags:
8+
- '*'
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
TWINE_USERNAME: __token__
16+
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
17+
18+
jobs:
19+
build_wheels:
20+
name: Build wheel for cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
# Ensure that a wheel builder finishes even if another fails. Useful for
24+
# debugging multiple problems in parallel.
25+
fail-fast: false
26+
matrix:
27+
include:
28+
# Linux 64 bit manylinux
29+
- os: ubuntu-latest
30+
arch: x86_64
31+
python: 39
32+
builder: manylinux
33+
- os: ubuntu-latest
34+
arch: x86_64
35+
python: 310
36+
builder: manylinux
37+
- os: ubuntu-latest
38+
arch: x86_64
39+
python: 311
40+
builder: manylinux
41+
- os: ubuntu-latest
42+
arch: x86_64
43+
python: 312
44+
builder: manylinux
45+
46+
# MacOS x86_64. The macos-13 runner is the last
47+
# Intel-based runner version. At some point we'll
48+
# need to switch to macos-latest and test cross compiling.
49+
- os: macos-13
50+
arch: x86_64
51+
python: 310
52+
builder: macosx
53+
deploy: 13.0
54+
- os: macos-13
55+
arch: x86_64
56+
python: 311
57+
builder: macosx
58+
deploy: 13.0
59+
- os: macos-13
60+
arch: x86_64
61+
python: 312
62+
builder: macosx
63+
deploy: 13.0
64+
65+
# MacOS arm64
66+
- os: macos-latest
67+
arch: arm64
68+
python: 310
69+
builder: macosx
70+
deploy: 14.0
71+
- os: macos-latest
72+
arch: arm64
73+
python: 311
74+
builder: macosx
75+
deploy: 14.0
76+
- os: macos-latest
77+
arch: arm64
78+
python: 312
79+
builder: macosx
80+
deploy: 14.0
81+
env:
82+
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
83+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
84+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.builder }}2014
85+
CIBW_BUILD_VERBOSITY: 3
86+
CIBW_ENVIRONMENT_LINUX:
87+
CIBW_ENVIRONMENT_MACOS: >
88+
MACOSX_DEPLOYMENT_TARGET=${{ matrix.deploy }}
89+
CIBW_BEFORE_BUILD_LINUX: ./packaging/wheels/install_deps_linux.sh
90+
CIBW_BEFORE_BUILD_MACOS: ./packaging/wheels/install_deps_osx.sh
91+
CIBW_BEFORE_TEST: export OMP_NUM_THREADS=1
92+
CIBW_TEST_COMMAND: python3 -c 'import flacarray.tests; flacarray.tests.run()'
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v4
96+
97+
- uses: actions/setup-python@v5
98+
name: Install Python
99+
with:
100+
python-version: '3.10'
101+
102+
- name: Install cibuildwheel
103+
run: |
104+
python -m pip install twine cibuildwheel==2.20.0
105+
106+
- name: Build wheel
107+
run: |
108+
python -m cibuildwheel --output-dir wheelhouse
109+
110+
- name: Upload to PyPI
111+
run: |
112+
python -m twine upload wheelhouse/flacarray*cp${{ matrix.python }}-${{ matrix.builder }}*${{ matrix.arch }}*.whl

.github/workflows/test.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# In general, we try to run on:
2+
# - The oldest supported python
3+
# - The latest stable python that is the common default on most systems and conda
4+
# - (During transitions) The newly released bleeding edge python
5+
6+
name: Run Test Suite
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
pull_request:
13+
branches:
14+
- main
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
jobs:
21+
test:
22+
name: Tests on ${{ matrix.arch }} with Conda Python-${{ matrix.python }}
23+
runs-on: ${{ matrix.os }}
24+
defaults:
25+
run:
26+
shell: bash -l {0}
27+
strategy:
28+
fail-fast: false
29+
matrix:
30+
include:
31+
- os: ubuntu-latest
32+
python: "3.9"
33+
arch: Linux-x86_64
34+
ompdisable: 0
35+
- os: ubuntu-latest
36+
python: "3.10"
37+
arch: Linux-x86_64
38+
ompdisable: 0
39+
- os: ubuntu-latest
40+
python: "3.12"
41+
arch: Linux-x86_64
42+
ompdisable: 0
43+
- os: macos-latest
44+
python: "3.10"
45+
arch: MacOSX-x86_64
46+
ompdisable: 1
47+
- os: macos-latest
48+
python: "3.12"
49+
arch: MacOSX-x86_64
50+
ompdisable: 1
51+
- os: macos-latest
52+
python: "3.10"
53+
arch: MacOSX-arm64
54+
ompdisable: 1
55+
- os: macos-latest
56+
python: "3.12"
57+
arch: MacOSX-arm64
58+
ompdisable: 1
59+
steps:
60+
- name: Checkout
61+
uses: actions/checkout@v4
62+
63+
- name: Setup Conda Base
64+
run: |
65+
sudo rm -rf /usr/share/miniconda \
66+
&& sudo rm -rf /usr/local/miniconda \
67+
&& curl -SL -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-${{ matrix.arch }}.sh \
68+
&& bash miniforge.sh -b -f -p ~/conda \
69+
&& source ~/conda/etc/profile.d/conda.sh \
70+
&& conda activate base \
71+
&& conda update -n base --yes conda
72+
73+
- name: Check Conda Config
74+
run: |
75+
source ~/conda/etc/profile.d/conda.sh \
76+
&& conda activate base \
77+
&& conda info \
78+
&& conda list \
79+
&& conda config --show-sources \
80+
&& conda config --show
81+
82+
- name: Install Dependencies
83+
run: |
84+
source ~/conda/etc/profile.d/conda.sh \
85+
&& conda activate base \
86+
&& conda install --file packaging/conda_build_requirements.txt
87+
88+
- name: Install
89+
run: |
90+
source ~/conda/etc/profile.d/conda.sh \
91+
&& conda activate base \
92+
&& pip install .
93+
94+
- name: Run Serial Tests
95+
run: |
96+
source ~/conda/etc/profile.d/conda.sh \
97+
&& conda activate base \
98+
&& export OMP_NUM_THREADS=2 \
99+
&& python3 -c 'import flacarray.tests; flacarray.tests.run()'
100+
101+
- name: Run MPI Tests
102+
run: |
103+
source ~/conda/etc/profile.d/conda.sh \
104+
&& conda activate base \
105+
&& export OMP_NUM_THREADS=1 \
106+
&& mpirun -np 2 python -c 'import flacarray.tests; flacarray.tests.run()'

.github/workflows/wheels.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
2+
name: Test Binary Wheels
3+
4+
on: workflow_dispatch
5+
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.ref }}
8+
cancel-in-progress: true
9+
10+
jobs:
11+
build_wheels:
12+
name: Build wheel for cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
# Ensure that a wheel builder finishes even if another fails. Useful for
16+
# debugging multiple problems in parallel.
17+
fail-fast: false
18+
matrix:
19+
include:
20+
# Linux 64 bit manylinux
21+
- os: ubuntu-latest
22+
arch: x86_64
23+
python: 39
24+
builder: manylinux
25+
- os: ubuntu-latest
26+
arch: x86_64
27+
python: 310
28+
builder: manylinux
29+
- os: ubuntu-latest
30+
arch: x86_64
31+
python: 311
32+
builder: manylinux
33+
- os: ubuntu-latest
34+
arch: x86_64
35+
python: 312
36+
builder: manylinux
37+
38+
# MacOS x86_64. The macos-13 runner is the last
39+
# Intel-based runner version. At some point we'll
40+
# need to switch to macos-latest and test cross compiling.
41+
- os: macos-13
42+
arch: x86_64
43+
python: 310
44+
builder: macosx
45+
deploy: 13.0
46+
- os: macos-13
47+
arch: x86_64
48+
python: 311
49+
builder: macosx
50+
deploy: 13.0
51+
- os: macos-13
52+
arch: x86_64
53+
python: 312
54+
builder: macosx
55+
deploy: 13.0
56+
57+
# MacOS arm64
58+
- os: macos-latest
59+
arch: arm64
60+
python: 310
61+
builder: macosx
62+
deploy: 14.0
63+
- os: macos-latest
64+
arch: arm64
65+
python: 311
66+
builder: macosx
67+
deploy: 14.0
68+
- os: macos-latest
69+
arch: arm64
70+
python: 312
71+
builder: macosx
72+
deploy: 14.0
73+
env:
74+
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
75+
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
76+
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.builder }}2014
77+
CIBW_BUILD_VERBOSITY: 3
78+
CIBW_ENVIRONMENT_LINUX:
79+
CIBW_ENVIRONMENT_MACOS: >
80+
MACOSX_DEPLOYMENT_TARGET=${{ matrix.deploy }}
81+
CIBW_BEFORE_BUILD_LINUX: ./packaging/wheels/install_deps_linux.sh
82+
CIBW_BEFORE_BUILD_MACOS: ./packaging/wheels/install_deps_osx.sh
83+
CIBW_BEFORE_TEST: export OMP_NUM_THREADS=2
84+
CIBW_TEST_COMMAND_LINUX: >
85+
python -c 'import flacarray.tests; flacarray.tests.run()'
86+
CIBW_TEST_COMMAND_MACOS: >
87+
python -c 'import flacarray.tests; flacarray.tests.run()'
88+
steps:
89+
- name: Checkout
90+
uses: actions/checkout@v4
91+
92+
- uses: actions/setup-python@v5
93+
name: Install Python
94+
with:
95+
python-version: '3.10'
96+
97+
- name: Install cibuildwheel
98+
run: |
99+
python -m pip install cibuildwheel==2.20.0
100+
101+
- name: Build wheel
102+
run: |
103+
python -m cibuildwheel --output-dir wheelhouse
104+
105+
- uses: actions/upload-artifact@v4
106+
with:
107+
name: wheels_cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
108+
path: ./wheelhouse/flacarray*cp${{ matrix.python }}-${{ matrix.builder }}*${{ matrix.arch }}*.whl

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ lib64/
1919
parts/
2020
sdist/
2121
var/
22-
wheels/
2322
share/python-wheels/
2423
*.egg-info/
2524
.installed.cfg
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
c_compiler
2+
cmake
3+
cython
4+
meson
5+
meson-python
6+
libflac
7+
h5py
8+
zarr
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake
2+
cython
3+
meson
4+
meson-python
5+
libflac
6+
h5py
7+
zarr

0 commit comments

Comments
 (0)