-
Notifications
You must be signed in to change notification settings - Fork 70
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
ENH: make the Meson executable user-configurable #495
Conversation
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.
Thanks @rgommers This implements what we discussed already and it is a good feature to have. The only important comment I have is regarding the option name. I think cli
is not the most descriptive name and meson
would be better.
In the future we could think about extending this to allow to specify the path to ninja
and patchelf
too. In the case of patchelf
we could even allow the path to be false
to disable requiring patchelf
.
In this hypothetical future,
[tool.meson-python]
meson = 'whatever/meson.py'
patchelf = false
looks better than the version with cli
in it.
The other comments are just variable names nitpicking. Sorry for being pedantic about these, but I find code much easier to read if variables are uniformly named.
Thanks for the review @dnicolodi. All you comments seem good, and I like the |
@rgommers Thinking about it, there is one problem with this patch: Line 36 in b4d4240
thus, even when this mechanism is used to point to an alternative meson implementation, the meson dependency is installed or required to be installed when not using build isolation. Should the meson dependency removed from the static dependencies and returned from get_requires_for_build_wheel() if meson is not specified in tool.meson.python or the env var is not set?
|
Hmm, good question. I think it'd be better to leave it as a static build dependency. Overriding it should be quite rare, and in those cases there's still little downside to having I think |
Keeping the |
Allow using a MESON environment variable, analogous to the NINJA one, or a string to an executable or Python script in the `[tool.meson-python]` section of pyproject.toml Closes mesonbuildgh-458
f2f842e
to
548ab9b
Compare
Hmm, not sure what to think of this pre-commit complaint:
It looks pretty clean to me. |
There's a |
We hit this questionable linting error also elsewhere. In that case it is disabled locally with a comment. I would be inclined in disabling the check all together. Just remove Lines 82 to 90 in b4d4240
ruff will complain that some local disables are unneeded and will need to be removed.
|
LGTM! Thanks for the revision @rgommers. I have just a couple of non critical comments. |
It has given issues a couple of times that take time to resolve, and the complaints it emits seem unjustified at least in some cases. So remove it - relying on code review is fine here.
548ab9b
to
5042b7f
Compare
Agreed, done in the last commit. |
All other changes adopted, I'll resolve those comments. |
Thanks @rgommers |
Allow using a MESON environment variable, analogous to the NINJA one, or a string to an executable or Python script in the
[tool.meson-python]
section ofpyproject.toml
.Addresses gh-458.
Package authors are likely going to need/prefer the
tool.meson-python
setting, as discussed in gh-458. For local development or user overrides the environment variable will be useful; it is implemented analogous to the NINJA one.This will allow me to unvendor
meson-python
fromnumpy
, as tested in this branch with these changes:If this looks good, it will still need docs before it's ready.