-
Notifications
You must be signed in to change notification settings - Fork 69
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
Document meson-pythons requirements for the "install_dir" option of e.g. configure_file #402
Comments
The issue is that the I'm almost tempted to suggest that this is a bug in Meson. @eli-schwartz Do you have any opinion on this matter? |
Investigating the Meson side of things: |
No, the plus operator explicitly does not perform path operations. By sheer coincidence, the value of get_install_dir returns something that ends in a Using Using the string addition method in meson.build for paths is approximately as idiomatic as using the string addition method in python for paths. Things like os.path.join and pathlib.PurePath exist for a reason. My original implementation of OptionString made the value judgment that I wasn't comfortable guaranteeing that anything other than actual path operations would be capable of returning a new string that bears a relationship with the old string -- so I intentionally refrained from overriding any method other than the path join method. |
@eli-schwartz After reading the original reply (from the GitHub notification email) I thought that I didn't explain well what I meant. Reading the edited version of the reply, I'm not so sure anymore this is the case. However, just in case, here is the clarification.
currently returns
I was wondering whether it should return
which is still not what the user wanted, but maybe it would more consistent data model wise.
I would be comfortable with all operations on |
There is the precedent of |
Right, it exists solely for internal tracking e.g. for cases like introspection files. |
We don't have a single usage of I'd personally be inclined to close this issue. |
@rgommers Configuring and installing a python file into a subdirectory seemed to me like something that other people using meson-python may want to do as well. (I can be wrong of cause, and maybe this is just too niche) However, I also cannot find a section in meson or meson-python where this issue would currently fit. What do you think about adding a "common pitfalls" chapter under References in meson-python documentation where this (and possibly other) issues could fit? |
True, it's I'm not quite sure about "common pitfalls", because such sections tend to go out of date and be a bit random. it could work though. An alternative option is to have a howto like Controlling install locations. That, or some broader section that covers each commonly used Meson command and anything with them specific to Python packages (if it's 100% generic, it should go in the Meson docs):
@dnicolodi any opinion here? |
I was just writing that
Is this a limitation that needs to be solved on the meson side, or is it intended, for some reason? |
There's still something to solve I believe. Not 100% sure anymore if it's only |
This issue is somewhat similar to #233, but different.
I had the following problem: I tried to configure an
__init__.py
file and install it into a subdirectory of the python install_dir using the pymod.get_install_dir function:This works with meson, but from meson-python I get an error: "Could not map installation path to an equivalent wheel directory: ...". The problem seems to be the "+ 'some_subdirectory/'" because the solution is to put the subdirectory name INTO the get_install_dir command using the subdir keyword_argument:
I think this behavior should be documented.
If you tell me where to add this, I can create a pull request.
The text was updated successfully, but these errors were encountered: