Skip to content

Commit

Permalink
MAINT: FFT pybind11 fixups
Browse files Browse the repository at this point in the history
* remove the pybind11 version exclusion from Windows
Meson job in GitHub actions

* pin pybind11 to version `2.10.1` in `pyproject.toml`
out of an abundance of caution re: recent issues with
`2.10.2` (which has since been yanked from PyPI)

* small adjustment to `pypocketfft.cxx` to defened
against the segfault that occurs with pybind11 `2.10.2`
(arguably not a bug, but safer way to initialize here)
  • Loading branch information
EthanSteinberg authored and tylerjereddy committed Jan 3, 2023
1 parent 843500a commit 34cdf05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
gfortran --version
- name: pip-packages
run: |
pip install numpy==1.22.2 cython "pybind11!=2.10.2" pythran meson ninja pytest pytest-xdist pytest-timeout pooch
pip install numpy==1.22.2 cython pybind11 pythran meson ninja pytest pytest-xdist pytest-timeout pooch
- name: openblas-libs
run: |
# Download and install pre-built OpenBLAS library
Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ build-backend = 'mesonpy'
requires = [
"meson-python>=0.11.0,<0.12.0",
"Cython>=0.29.32,<3.0",
"pybind11>=2.10.0,!=2.10.2,<2.11.0",
# conservatively avoid issues from
# https://github.com/pybind/pybind11/issues/4420
"pybind11==2.10.1",
"pythran>=0.12.0,<0.13.0",
# `wheel` is needed for non-isolated builds, given that `meson-python`
# doesn't list it as a runtime requirement (at least in 0.5.0)
Expand Down
3 changes: 2 additions & 1 deletion scipy/fft/_pocketfft/pypocketfft.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ using clong = std::complex<ldbl_t>;
using f32 = float;
using f64 = double;
using flong = ldbl_t;
auto None = py::none();

shape_t copy_shape(const py::array &arr)
{
Expand Down Expand Up @@ -717,6 +716,8 @@ PYBIND11_MODULE(pypocketfft, m)
{
using namespace pybind11::literals;

auto None = py::none();

m.doc() = pypocketfft_DS;
m.def("c2c", c2c, c2c_DS, "a"_a, "axes"_a=None, "forward"_a=true,
"inorm"_a=0, "out"_a=None, "nthreads"_a=1);
Expand Down

0 comments on commit 34cdf05

Please sign in to comment.