-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: switch to meson as build backend #327
base: main
Are you sure you want to change the base?
Conversation
numpy_dep = dependency('numpy', version: '>=2.0.0',required: true) | ||
omp = dependency('openmp') | ||
|
||
import('python').find_installation().extension_module( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The py_mod
and py3
variables established in the root meson.build file are available for use here as well.
While you are at it, you may choose to do dependency lookups (dependency()
) a single time in the root meson.build file as well, rather than once per subdir using it. The lookups are cached either way so it won't re-run the finders (numpy-config etc.), but it will emit additional log lines.
'src/geowombat/handler.py', | ||
], | ||
subdir: 'geowombat', | ||
pure: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since meson 0.64, you can use pure: false
in "find_installation" and it will be the defaulted value for each "install_sources" call, which lets you save a bit on DRY.
What is this PR changing?
Transition to meson as the build backend
Our team is switching to meson as the build backend for all python projects that include compiled code, such as fortran, cython, c++ etc (not rust though, that would use maturin).
This helps us keep up to date with changes in python and numpy. Since some of our projects use geowombat as a dependency, then I was wondering if this sort of approach would be useful to this project as well. It would make building and installing geowombat on python > 3.12 and with numpy >= 2 easier for us.
I've included an example of the transition in the PR, but note that there are a couple of things that probably need work:
I've included a Dockerfile to provide an example of how geowombat can be installed for Ubuntu users, the main part is as follows:
(uv is great, but the same should work for standard pip as the packaging frontend system).
Let me know if there is any interest in this and if so I'll do a bit more to make it fully functional.