SciTools / cf-units

Units of measure as required by the Climate and Forecast (CF) Metadata Conventions
https://cf-units.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
64 stars 48 forks source link

update build system : adopt PEP517/8 #454

Open pp-mo opened 6 days ago

pp-mo commented 6 days ago

AT LEAST replace setup.cfg

setup.py mat be required because of the Cython info

bjlittle commented 6 days ago

We still need a setup.py and we're already PEP517/8 compliant

ocefpaf commented 6 days ago

Indeed removing setup.py is good but not mandatory. In case of c-extensions, like this one, it is still easier to maintain. One alternative is mesonpy but I confess I did not like it and I'm using only for Fortran extensions b/c there is no better way at the moment.

TL;DR while the setup.py here could use a clean-up, it is still relevant and correct with modern packaging standards.

bjlittle commented 1 day ago

@ocefpaf Awesome, thanks :beers:

I've also had a look at meson, and it looks interesting, but I'm not sure whether using it as a build-backend would suit cf-units ... in particular, I fear that we've baked in some nasty dependencies on how setuptools works.

If we were serious about adopting meson we'd have to scope out the impact/effort involved vs the benefit.

There isn't something you know about that's going to break us when attempting to support >py311 in cf-units whilst staying with setuptools ?

I noticed that pyspharm opted to adopt meson for py312 support ... but they're building upon Fortran, so I was guessing that was somehow related to the numpy.disutils migration. Any insight/advice on that?

ocefpaf commented 1 day ago

I noticed that pyspharm opted to adopt meson for py312 support ... but they're building upon Fortran, so I was guessing that was somehow related to the numpy.disutils migration. Any insight/advice on that?

setuptools is still OK for most c-extensions on modern Python. I'm pretty sure we can drop the numpy.distutils, if that is still used here. I believe that the effort to move to meson is not worth it. I'd rather use that energy to ditch udunits2 and make it pure Python.

bjlittle commented 1 day ago

Cool 👍

Yup, dropping udunits2 would solve a lot of problems.

I'm 100% behind that 🎉