ENH: allow to specify editable-verbose in pyproject.toml#838
Conversation
af976ef to
6e08fbe
Compare
6e08fbe to
a9c5ce4
Compare
|
@rgommers What do you think of this approach? |
|
@rgommers gentle ping |
rgommers
left a comment
There was a problem hiding this comment.
Thanks @dnicolodi, and apologies for the delay - I've been pretty swamped (now on a short holiday, so trying to catch up here).
Adding a pyproject.toml setting seems like a reasonable and clean approach. I'm not sure about is explicitly accepting 1/0 (which are untested) but not yes/no/on/off. I did a quick search on GitHub and could only found true being used; in gh-820 there's one usage of yes in a question. Either being more strict or more loose might be appropriate here?
Technically this could break someone who uses now yes or some random string, however that doesn't seem worth worrying about.
This section should probably be expanded a little: https://mesonbuild.com/meson-python/how-to-guides/editable-installs.html#verbose-mode
The docs should probably have a warning about the "install scripts" problem you explain at #820 (comment).
Question: did you consider what we discussed there, buffering to a file and only displaying on a build failure? That would probably be cleaner and wouldn't have to come with a disclaimer, but perhaps more complex to reliably implement?
|
Thinking about that some more, an The change to this line: meson-python/mesonpy/_editable.py Line 346 in e5ba90f would have to be something like this (replace proc = subprocess.run(self._build_cmd, ..., stdout=subprocess.PIPE)
if proc.returncode != 0:
sys.stderr.buffer.write(proc.stdout)
raise ImportError(...) |
|
Ah, I rediscovered gh-750, which deals with the |
Maybe accepting only |
Sounds good to me. |
a9c5ce4 to
ecf9464
Compare
|
Updated with the discussed changes. |
ac3ac7f to
7c90c10
Compare
rgommers
left a comment
There was a problem hiding this comment.
LGTM, approving. pre-commit is still unhappy with some trailing whitespace.
Build config settings passed via the build front-end take precedence over the value configured via the tool.meson-python.editable-verbose setting in pyproject.toml. The editable-verbose config setting is extended to take an optional boolean argument: the "true" and "false" values are accepted with their natural meaning. For backward compatibility, the empty string (no argument passed to the config setting) is treated as true.
7c90c10 to
932276d
Compare
Fixed |
Build config settings passed via the build front-end take precedence over the value configured via the
tool.meson-python.editable-verbosesetting inpyproject.toml.For this to work, the
editable-verboseconfig setting is extended to take an optional boolean argument: "true" or "1" are true values, "false" or "0" are false, anything else is invalid. For backward compatibility, the empty string (no argument passed to the config setting) is treated as true.Addresses a part of gh-820