Skip to content

Commit 634fefe

Browse files
committed
add github workflow for test-pypi cross-OS wheel builds
1 parent 596930a commit 634fefe

5 files changed

Lines changed: 115 additions & 59 deletions

File tree

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build Linux ABI3 wheels (TestPyPI)
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*-test*" # only run on tags for experimental versions
7+
8+
jobs:
9+
build_wheels:
10+
name: Build linux wheels
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
persist-credentials: false
17+
submodules: recursive
18+
19+
# enable QEMU emulation to build for arm64 on x86_64 runner
20+
- name: Set up QEMU
21+
if: runner.os == 'Linux'
22+
uses: docker/setup-qemu-action@v3
23+
with:
24+
platforms: all
25+
26+
# used to host cibuildwheel
27+
- uses: actions/setup-python@v6
28+
29+
# install build depdencies
30+
- name: Install build tools
31+
run: python -m pip install setuptools wheel cibuildwheel build twine nanobind
32+
33+
- name: Download Eigen headers
34+
run: |
35+
mkdir -p deps
36+
mkdir -p deps/eigen3
37+
curl -L https://gitlab.com/libeigen/eigen/-/archive/5.0.0/eigen-5.0.0.tar.gz \
38+
| tar xz -C deps/eigen3 --strip-components=1
39+
40+
- name: Build wheels
41+
run: python -m cibuildwheel --output-dir wheelhouse
42+
env:
43+
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
44+
CIBW_ARCHS_MACOS: "x86_64 arm64"
45+
46+
- name: Upload to TestPyPI
47+
run: |
48+
twine upload \
49+
--repository-url https://test.pypi.org/legacy/ \
50+
wheelhouse/*
51+
env:
52+
TWINE_USERNAME: __token__
53+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Build and upload wheels to TestPyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*-test*" # only run on tags for experimental versions
7+
8+
jobs:
9+
build_wheels:
10+
name: Build macos wheels
11+
runs-on: macos-26
12+
13+
steps:
14+
- uses: actions/checkout@v6
15+
with:
16+
persist-credentials: false
17+
submodules: recursive
18+
19+
# enable QEMU emulation to build for arm64 on x86_64 runner
20+
- name: Set up QEMU
21+
if: runner.os == 'Linux'
22+
uses: docker/setup-qemu-action@v3
23+
with:
24+
platforms: all
25+
26+
# used to host cibuildwheel
27+
- uses: actions/setup-python@v6
28+
29+
# install build depdencies
30+
- name: Install build tools
31+
run: python -m pip install setuptools wheel cibuildwheel build twine nanobind
32+
33+
- name: Download Eigen headers
34+
run: |
35+
mkdir -p deps
36+
mkdir -p deps/eigen3
37+
curl -L https://gitlab.com/libeigen/eigen/-/archive/5.0.0/eigen-5.0.0.tar.gz \
38+
| tar xz -C deps/eigen3 --strip-components=1
39+
40+
- name: Build wheels
41+
run: |
42+
python -m cibuildwheel --output-dir wheelhouse
43+
env:
44+
CIBW_BUILD: "cp311-* cp312-* cp313-* cp314-*"
45+
CIBW_ENVIRONMENT: >
46+
CC=$(brew --prefix llvm@20)/bin/clang
47+
CXX=$(brew --prefix llvm@20)/bin/clang++
48+
49+
- name: Upload to TestPyPI
50+
run: |
51+
twine upload \
52+
--repository-url https://test.pypi.org/legacy/ \
53+
wheelhouse/*
54+
env:
55+
TWINE_USERNAME: __token__
56+
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}

.github/workflows/testpypi-windows.yml

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

include/fdaPDE-cpp/fdaPDE/core/fdaPDE/src/utility/meta.h

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,12 @@
2222
namespace fdapde {
2323
namespace internals {
2424

25-
template <typename IndexSeq> struct Applier;
26-
27-
template <int... Ns> struct Applier<std::integer_sequence<int, Ns...>> {
28-
template <typename F> static constexpr decltype(auto) call(F&& f) {
29-
// We use the pack here, inside the body, which is safer
30-
return std::forward<F>(f).template operator()<Ns...>();
31-
}
32-
};
33-
34-
template <int N, typename F> constexpr decltype(auto) apply_index_pack(F&& f) {
35-
using Seq = std::make_integer_sequence<int, N>;
36-
return internals::Applier<Seq>::call(std::forward<F>(f));
25+
// apply lambda F_ to each value in index pack {0, ..., N_ - 1}
26+
template <int N_, typename F_> constexpr decltype(auto) apply_index_pack(F_&& f) {
27+
return [&]<int... Ns_>(std::integer_sequence<int, Ns_...>) -> decltype(auto) {
28+
return f.template operator()<Ns_...>();
29+
}(std::make_integer_sequence<int, N_> {});
3730
}
38-
39-
4031
template <int N_, typename F_> constexpr void for_each_index_in_pack(F_&& f) {
4132
[&]<int... Ns_>(std::integer_sequence<int, Ns_...>) {
4233
(f.template operator()<Ns_>(), ...);

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ build-backend = "scikit_build_core.build"
88

99
[project]
1010
name = "fdaPDE"
11-
version = "2.0.0rc3"
11+
version = "2.0.0rc4"
1212
description="The python wrapper to the fdaPDE library for physics-informed spatial and functional data analysis."
1313
readme = "README.md"
1414
dependencies = ["numpy", "matplotlib"]

0 commit comments

Comments
 (0)