Hi,
I faced the same issue as you and decided to follow scipy & numpy which
switched to pyproject+meson-python on some important projects, at
least all the ones using cython because it makes this part so much easier.
The management of compiler, their option is so much simple. OpenMP is
just an optional dependency !
The cleanest project is probably silx, but pyFAI and fabio have paved
the way before ...
https://github.com/silx-kit/silx
It is a big change, but today, a lot of documentation exists and there
are other examples. Two years after the migration, I am very happy with
the results. Thanks for the meson-python community who helped in the
transition.
Cheers,
Jerome
On Mon, 3 Nov 2025 10:07:38 -0800 (PST)
Didier VEZINET <
didier....@gmail.com> wrote:
> Hi,
>
> First of all: thanks for the hard work !
>
> I've been using cython for several years now and my library
> <
https://github.com/ToFuProject/tofu>has had a very sketchy (setup.py +
> requirements + some custom scripts) to make it work.
> Did all this years ago, and I feel like it's time to clean all that mess up
> and modernize with a `pyproject.toml` and get rid of the (setup.py +
> requirement + setup.cfg).
>
> It work in progress on a dedicated branch
> <
https://github.com/ToFuProject/tofu/tree/Issue1032_uvPyprojectt>:
> I have set the pyproject.toml
> <
https://github.com/ToFuProject/tofu/blob/Issue1032_uvPyprojectt/pyproject.toml>
> file (best I could).
> Since my extensions needed some dynamic arguments (e.g.: testing whether
> openmp is installed or not), I've set up a custom build_py
> <
https://github.com/ToFuProject/tofu/blob/Issue1032_uvPyprojectt/_custom_build.py>
> for setuptools following the advice on stackoverflow
> <
https://stackoverflow.com/a/74196255>.
>
> Seems to work.
>
> Now I'm stuck at the point where I need to provide a similar *dynamic
> argument to cythonize*.
>
> I've tried the same trick (overloading cythonize
> <
https://github.com/ToFuProject/tofu/blob/Issue1032_uvPyprojectt/_custom_cythonize.py>
> in a dedicated custom module and specifying it in the pyproject.toml), but
> it doesn't seem to work.
> Looks like the* [tool.cython]* section of the pyproject.toml is being
> ignored, I think.
>
> I've spent hours online trying to find a clean way to do this without
> success, any help would be very appreciated !
>
> Thanks
> Didier
>
>
>
>
>
>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "cython-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
cython-users...@googlegroups.com.
> To view this discussion visit
https://groups.google.com/d/msgid/cython-users/4e24bbb2-be7d-4ef6-aa92-a46a5e7f56a2n%40googlegroups.com.
--