-
Notifications
You must be signed in to change notification settings - Fork 50
Description
Hi all. I have the same problem with other packages, so I decided to try to find a solution for pytmatrix first.
The TLDR:
I have a sort of functioning version that builds using meson forked here mesonpytmatrix. meson and mesonpy allow to build fortran extensions and package them without the need of distutils and they are the way used by larger project like scipy to solve the same issue
The GOOD:
I can install the renamed mesonpytmatrix (if you decide to use and test it, remember to rename your import pytmatrix to import mesonpytmatrix) package with
pip install .from the root of the package tree. I can also build a sdist and install the tar.gz file with pip. Both ways work and pass the tests.The BAD:
I pushed the sdist to testpypi here
for some reason (likely my ignorance on python packaging) I cannot install from testpypi, I get errors with the dependencies... perhaps someone can help with that.
Conclusion:
I can make a push request, perhaps to a dev branch, if you think it would be useful and perhaps we can find a way around the packaging issue.
@jleinonen what do you think?
The LONGER version:
distutils is deprecated and soon it will be numpy.distutils; there are some migration advices which basically say: if you do not need fortran extension move to setuptools, if you need it, find another way cause setuptools does not support it. The suggested options are the scikit-build-core backend that uses CMake or the meson-python backend that uses Meson.
People waited for long time setuptools to integrate all the functionalities of numpy.distutils, but that did not seem to happen fast enough or at all, very large and popular packages moved away from that, scipy decided for meson
I did not have a preference (or much experience with modern build systems) so I tried a bit of both, but in the end, I felt safer with Meson and the scipy experience. However it seems that there is a lack of simple examples on how to build and extension with it, package and distribute the stuff. I mean, there are several examples but they do not quite cover it all... Simply copying from scipy seemed too complicated for me (too large project). I found this other project apexpy which seemed to have gone through the same path and I largely adapted from that experience