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
Evaluate __all__
to find submodules
#1845
Comments
I think this is a good idea: it's standard Python, so supporting it might cover a few more cases that otherwise would require a hook. |
Seconded. It's not simply a good idea; it's a great idea. Three delicious green apples up! 🍏 🍏 🍏 But shouldn't this only (but always) be done for package-level star imports? My ideal algorithm might resemble:
Also, we probably don't want to unconditionally store the values of all globalnames – just the values of all Also, I'm unconvinced that globalnames are behaving as intended at the moment. Our
This hack appears to be responsible for at least one related issue. Why? Because But, yeah... I'm surprised we don't already process |
O.K. If we could defer this until after I submit my in-process pull request for #1919, that'd be awesome. I've refactored |
Has this been addressed, or is it closable? |
Hi , I am facing similar issue when packaging tqdm. tqdm_init_.py
|
@tourist-C please open a new issue for this. |
@htgoebel I'll look into implementing this when we switch over to modulegraph2. |
Issue #1834 shows an interesting case: The package Crypto.PublicKey uses
__all__
to refer to the submodules, but does not contain any import statement. Thus for finding the imports, evaluation__all__
would be sufficient and may save some hooks.We could extend modulegraph as follows:
__all__
.Deficits:
from ..dialects.sqlite import base as sqlite
plus lists these in__all__
.Is this feature worth the effort for implementing it?
The text was updated successfully, but these errors were encountered: