Meson-python and conda - am I doing it right?

For code review or questions of meson-python, you’re also very welcome to ask at mesonbuild/meson-python · Discussions · GitHub. Now that it’s here, I’ll comment here though:

  • Overall the pyproject.toml looks perfectly fine to me.
    • I assume you do not want to distribute wheels, because then indeed the udunits2 dependency is going to be a pain, and then you’d also have to use oldest-supported-numpy instead of numpy>=1.20. For local builds and for conda packages, it looks fine as is.
  • The meson.build file looks mostly fine, there are two potential issues:
    • The incdir_numpy thing is a bit painful (I really need to make dependency('numpy') “just work”); if that starts failing on in-tree virtualenvs, use this instead.
    • It looks like you’re having a problem with dependency detection. You need either pkg-config or cmake installed as a build requirement, and if udunits2 does not come with the files needed for pkg-config or cmake to detect udunits2 then the detection will indeed fail (Meson won’t just go build and hope the right header is stumbled upon, like distutils would do). So what you then have to do is craft your own pkg-config file (and file a bug report against udunits2 ideally) - here is an example of how to do this: scipy-docs/blas-lapack.