-
Notifications
You must be signed in to change notification settings - Fork 51
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
Support getting files in the build tree from editable installs #808
base: main
Are you sure you want to change the base?
Conversation
What is the type you get with Trying to refresh my reading of the workflow |
No, it is currently producing a PosixPath. But that is a good pointer, that does seem like the way that this should work. This seems similar to what I reported in #647. |
) | ||
if fullname in self.known_source_files: | ||
redir = self.known_source_files[fullname] | ||
return importlib.util.spec_from_file_location( | ||
fullname, | ||
redir, | ||
submodule_search_locations=submodule_search_locations, | ||
loader=ScikitBuildRedirectingLoader(fullname, redir), |
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 fact that this is specifying a single directory (the redir) is perhaps part of where we could improve things. (Sub)packages are found in the known source files list by their __init__.py
. As a result, that path is used as the root, which means that we cannot find files nested in the package but present in the build directory because the package does not exist in known_wheel_files
.
I remember
If
( fullname == "example" should be called there)
|
Indeed, that seems to be it. I added
and I see
What would you recommend that we do? |
Is this with the default loader or the new one. If it's the same on the default, then we need to rethink it. One reference would be what do setuptools and hatchling do for namespace packages. I remember one of them didn't support it at that time. Meson and cargo could be additional references, but those would be harder to navigate and might not be as minimal. Worst case is we go for the method of meson defining full Loaders, but it's not ideal. The difficulty iirc was with getting everything else other than |
The output is the same both with and without the loader (commenting out |
@LecrisUT any other thoughts on how we ought to proceed here? I've committed the test to the repo so hopefully it's easy enough to reproduce the issue if you need to. |
It is a difficult one and I think we need to separate what we are testing here:
[^1] : https://github.com/mesonbuild/meson-python/blob/main/mesonpy/_editable.py |
That sounds like a solid plan. I don't follow the difference between your second and third top-level bullets, but in general the approach of adding tests for each of the possible cases and working backwards from there sounds right. This PR adds a test for one specific case from that list. I can work on slowly building this up. JFYI it will take me a few weeks to get back to this PR since I'll be traveling for the next two weeks. @henryiii would you be open to me creating a PR that is just a bunch of xfailed tests indicating functionality that we would like to work and getting that merged then working backwards to fixing tests? I fear that the number of different cases alone will make this kind of work hard to keep track of, so getting test cases merged and consistently tested would already be a good starting point to indicate what we aspirationally want working. |
About 2nd and 3rd point, it is subtle but basically it involves how the |
@henryiii friendly ping. Does the above approach of adding xfailed tests first sound OK? |
I think you should go ahead with the |
Ah, sorry, yes the xfail approach is preferred. |
Cool. I head out on vacation on Thursday and have a number of things to wrap up, so I may not get to this by then. If not, then I'll revisit in about 3 weeks (I'm off for 2, will realistically need a week to get caught up on everything else again). |
Working on the tests in #906. |
Resolves #807