-
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
Meson-python >= 0.16.0 adds non-existant submodule_search_locations to module spec #716
Comments
I asked it before and I'll ask it again: what is the reason for installing in editable mode in a CI job? It makes very little sense to me. What jinja is doing here is not really kosher. There is no guarantee that We need to have the path set to something recognizable that is not a filesystem path to support other use cases (brought forward by the Pandas developers). If |
The editable mode for CI in pandas is just a legacy thing. That can be removed. However, this issue does effect local editable installs as well |
|
Hmm that's unfortunate. I am also not very familiar with the inner workings of jinja2 Since you mentioned that the pandas team asked for this You definitely know better than me, but from a quick glance at PEP 451 it seems like the intention is for that field to contain a list of valid directories containing modules |
The documentation of Only packages installed as directories (standard pip behavior) or zip/egg files (less common) are supported. The Python API for introspecting data in packages is too limited to support other installation methods the way this loader requires. |
The zip import mechanism in the standard library, uses |
I'm not sure the request was directly from Pandas developers. The trick with |
I can open an issue upstream to discuss in jinja if that will be helpful. This is all a bit out of my wheelhouse, so just to clarify the editable installation of a meson-python project injects a custom loader that is responsible for resolving paths like Is there a way for the custom loader to be queried by jinja to better resolve that path that I should suggest upstream? |
I don't think that opening an issue upstream is going to accomplish much: the jinja loader is documented to do not work with module loaders different than the standard filesystem loader and the zipimport loader. There is no API that would allow jinja to do what it does in a better way: the Python import system is not meant to be used that way. However, the fake path is added to the load path only for namespace packages (directories installed as packages that do not contain a |
I noticed when trying to upgrade the pandas CI to use more recent versions of meson-python that I started to see jinja2 failures in our test suite. As far as I can tell, jinja2 resolves paths to the package by loading the module specification via calls to
importlib.util.find_spec("pandas")
In meson-python < 0.16.0, the debugger shows that specification as:
With meson-python 0.16.0, that same specification now shows as:
The problem is that the submodule_search_locations in meson-python 0.16.0 are non-existent, so when jinja2 tries to navigate those it ends up throwing an error like
The text was updated successfully, but these errors were encountered: