Skip to content
Merged
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
13 changes: 1 addition & 12 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,10 @@ jobs:
&& popd >/dev/null 2>&1

- name: Install Docs Dependencies
# AttributeError: 'MathBlockParser' object has no attribute 'parse_axt_heading'
# https://github.com/jupyter/nbconvert/issues/2198
# mistune = "<3.1"
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate docs \
&& conda install --yes \
mkdocs \
mkdocstrings \
mkdocstrings-python \
mkdocs-material \
mkdocs-material-extensions \
mkdocs-jupyter \
"mistune<3.1" \
&& pip install mkdocs-print-site-plugin \
&& ./docs/install_requirements.sh \
&& git config user.name 'github-actions[bot]' \
&& git config user.email 'github-actions[bot]@users.noreply.github.com'

Expand Down
34 changes: 26 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ jobs:
matrix:
include:
- os: ubuntu-latest
python: "3.9"
python: "3.10"
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.11"
python: "3.12"
arch: Linux-x86_64
ompdisable: 0
- os: ubuntu-latest
python: "3.13"
python: "3.14"
arch: Linux-x86_64
ompdisable: 0
- os: macos-latest
- os: macos-15-intel
python: "3.10"
arch: MacOSX-x86_64
ompdisable: 1
- os: macos-latest
- os: macos-15-intel
python: "3.13"
arch: MacOSX-x86_64
ompdisable: 1
- os: macos-latest
- os: macos-15
python: "3.10"
arch: MacOSX-arm64
ompdisable: 1
- os: macos-latest
- os: macos-15
python: "3.13"
arch: MacOSX-arm64
ompdisable: 1
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
&& conda create --yes -n test python==${{ matrix.python }} \
&& conda activate test \
&& conda install --yes --file packaging/conda_build_requirements.txt
if test ${{ matrix.python }} = "3.9"; then conda install libxcrypt; fi
if test ${{ matrix.python }} = "3.10"; then conda install libxcrypt; fi

- name: Install
run: |
Expand Down Expand Up @@ -123,3 +123,21 @@ jobs:
&& pushd test >/dev/null 2>&1 \
&& mpirun -np 2 python -m mpi4py -c 'import flacarray.tests; flacarray.tests.run()' \
&& popd >/dev/null 2>&1

- name: External C Link Tests (Dynamic)
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate test \
&& export OMP_NUM_THREADS=2 \
&& cmake -S packaging/test_c_link -B build_c_link \
&& cmake --build build_c_link \
&& ctest --test-dir build_c_link

- name: External C Link Tests (Static)
run: |
source ~/conda/etc/profile.d/conda.sh \
&& conda activate test \
&& export OMP_NUM_THREADS=2 \
&& cmake -S packaging/test_c_link -B build_c_link_static \
&& cmake --build build_c_link_static \
&& ctest --test-dir build_c_link_static
64 changes: 41 additions & 23 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@v7
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 All @@ -21,10 +37,6 @@ jobs:
matrix:
include:
# Linux 64 bit manylinux
- os: ubuntu-latest
arch: x86_64
python: 39
builder: manylinux
- os: ubuntu-latest
arch: x86_64
python: 310
Expand All @@ -41,48 +53,54 @@ jobs:
arch: x86_64
python: 313
builder: manylinux
- os: ubuntu-latest
arch: x86_64
python: 314
builder: manylinux

# MacOS x86_64. The macos-13 runner is the last
# Intel-based runner version. At some point we'll
# need to switch to macos-latest and test cross compiling.
- os: macos-13
# MacOS x86_64.
- os: macos-15-intel
arch: x86_64
python: 310
builder: macosx
- os: macos-13
- os: macos-15-intel
arch: x86_64
python: 311
builder: macosx
- os: macos-13
- os: macos-15-intel
arch: x86_64
python: 312
builder: macosx
- os: macos-13
- os: macos-15-intel
arch: x86_64
python: 313
builder: macosx

# MacOS arm64
- os: macos-latest
- os: macos-15
arch: arm64
python: 310
builder: macosx
- os: macos-latest
- os: macos-15
arch: arm64
python: 311
builder: macosx
- os: macos-latest
- os: macos-15
arch: arm64
python: 312
builder: macosx
- os: macos-latest
- os: macos-15
arch: arm64
python: 313
builder: macosx
- os: macos-15
arch: arm64
python: 314
builder: macosx
env:
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.builder }}_${{ matrix.arch }}
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}2014
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.builder }}2014
CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.builder }}_2_28
CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.builder }}_2_28
CIBW_BUILD_VERBOSITY: 3
CIBW_ENVIRONMENT_LINUX: >
CC=gcc
Expand All @@ -100,19 +118,19 @@ jobs:
- uses: actions/setup-python@v6
name: Install Python
with:
python-version: '3.11'
python-version: '3.13'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==2.22.0
python -m pip install cibuildwheel==3.3.1

- name: Build wheel
run: |
python -m cibuildwheel --output-dir wheelhouse

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

upload_pypi:
Expand All @@ -122,10 +140,10 @@ jobs:
id-token: write
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v7
- uses: actions/download-artifact@v8
with:
# Unpacks all artifacts into dist/
pattern: flacarray-*
pattern: cibw-*
path: dist
merge-multiple: true

Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Generated files
src/flacarray/_version.py
src/flacarray/libflacarray/version.c

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
73 changes: 73 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
cmake_minimum_required(VERSION 3.21)

# Warn if the user invokes CMake directly
if (NOT SKBUILD)
message(WARNING "\
This CMake file is meant to be executed using 'scikit-build-core'.
Running it directly will almost certainly not produce the desired
result. If you are a user trying to install this package, use the
command below, which will install all necessary build dependencies,
compile the package in an isolated environment, and then install it.

$ pip install .

")
endif()

message(STATUS "CMAKE_BUILD_TYPE set to '${CMAKE_BUILD_TYPE}'")

# Auxiliary files
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

# Define the project with name and version from pyproject.toml
project(${SKBUILD_PROJECT_NAME} LANGUAGES C VERSION ${SKBUILD_PROJECT_VERSION})

# We are building libraries that will eventually be linked into shared
# modules. All code should be built with PIC.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Use modern C
set(CMAKE_C_STANDARD 11)

# For installing the stand-alone library and header
include(GNUInstallDirs)

# OpenMP
if(NOT DISABLE_OPENMP)
find_package(OpenMP)
endif()

find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
include(UseCython)

execute_process(
COMMAND "${Python_EXECUTABLE}" -c "import numpy; print(numpy.get_include(), end='')"
OUTPUT_VARIABLE NUMPY_INCLUDE_DIR
)

find_package(FLAC REQUIRED)

if(DEFINED FLAC_VERSION)
if(FLAC_VERSION STREQUAL "")
message(STATUS "Cannot determine FLAC version- assuming it is >= 1.4.0")
else()
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\..*" "\\1"
FLAC_MAJ_VERSION "${FLAC_VERSION}")
string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\..*" "\\1"
FLAC_MIN_VERSION "${FLAC_VERSION}")
if(FLAC_MAJ_VERSION GREATER 1)
# Future proofing
message(STATUS "Found FLAC version ${FLAC_VERSION}")
else()
if(FLAC_MIN_VERSION GREATER_EQUAL 4)
message(STATUS "Found FLAC version ${FLAC_VERSION}")
else()
message(FATAL_ERROR "FLAC version ${FLAC_VERSION} is not >= 1.4.0")
endif()
endif()
endif()
else()
message(STATUS "Cannot determine FLAC version- assuming it is >= 1.4.0")
endif()

add_subdirectory(src)
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

Loading