Closed jmrohwer closed 6 months ago
@bgoli Any chance of a review before Christmas or are you already on leave?
@bgoli Have you had a chance to look at this? I would like to cut a new release.
@bgoli I'd really like to cut a release soon. We need the new version for a course we're teaching. Have you had a chance to look at this?
Sorry about the delay I'm looking at it now, should be finished tomorrow.
On Mon, Jan 15, 2024, 11:14 Johann Rohwer @.***> wrote:
@bgoli https://github.com/bgoli Have you had a chance to look at this? I would like to cut a new release.
— Reply to this email directly, view it on GitHub https://github.com/PySCeS/pysces/pull/94#issuecomment-1891798365, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGHUELGXH4TXY67O43YCV3YOT6PZAVCNFSM6AAAAABAWD5SGCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJRG44TQMZWGU . You are receiving this because you were mentioned.Message ID: @.***>
This PR implements meson-python, a PEP 517 compliant Python build backend that is suitable for building C and Fortran extension modules by implementing the meson build system. There is no more
setup.py
but project build options and metadata are now inpyproject.toml
.These changes are substantial, thus a version bump to 1.2.0 is proposed.
Current status (prior to this PR)
PySCeS is built with the
scikit-build
system making use of asetup.py
file. Under the hood, scikit-build makes use ofcmake
to build extension modules, and in our case these (Fortran) modulesnleq2
andpitcon
are compiled withf2py -c
. The flow is thus:scikit-build
callscmake
callsf2py -c
.The compilation via
f2py -c
occurs vianumpy.distutils
(Python <=3.11) ormeson
(Python >=3.12) due to the deprecation ofdistutils
andnumpy.distutils
, and thus differs between Python versions.Motivation
distutils
and as a consequence numpy removednp.distutils
. This was the motivation for originally moving the build toscikit-build
in PySCeS release 1.0.3 (Sep 2022) and move away from a directnp.distutils
implementation.f2py -c
calls meson via cmake but since meson is used for the build, it could be called directly and the whole cmake infrastructure is actually not needed.f2py -c
uses different backends depending on Python version, which increases complexity.np.distutils
used to have a hack to combineMSVC
(for compiling C) withgfortran
(for compiling Fortran). This is however no longer supported from Python 3.12 onwards.f2py -c
should not be used at all in the context of build systems such as scikit-build or meson-python, but should only be used as a transpiler to generate*.c
sources which are then integrated into regular CMake or meson targets for the build. See https://github.com/numpy/numpy/issues/22211#issuecomment-1707155843mingw32
) of preferring build of statically linked libraries, which gets rid of linking issues.What has changed?
pip
orconda
.setup.py
. Metadata has been migrated topyproject.toml
. Build settings are spread betweenpyproject.toml
and variousmeson.build
files. The build is straightforward using one of:as long as the relevant compiler toolchain is installed (gcc and gfortran on Linux and macOS, RTools on Windows). Installation can be done with
pip install .
orpip install --no-build-isolation -e .
(for an editable install). Refer to INSTALL.md