You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
In the ecosystem, we have common conventions to mark objects as public:
redundant imports: import x as x
redundant from-imports: from a import x as x
wildcard imports: from a import *
Users rely on those, but Griffe currently does not support them. This affects both our API checker and mkdocstrings-python: some objects might be wrongly considered private instead of public, or the opposite.
Describe the solution you'd like
Support these conventions.
A few solution ideas:
Use the public attribute? When visiting modules, set public = True on objects imported like that. Later, if we find __all__ is defined, set them back to None. Not sure I like using public like that, internally.
Write extensions. I think this would require adding a hook like on_alias? Extensions do not run during wildcard expansion though.
Add metadata to objects? This metadata ²would then be used by the "public" logic?
Since we don't recommend relying on these conventions in our docs, we should probably implement this as (insiders) extensions. For this we'll probably need new hooks:
on_alias: we could name it on_import, but during inspection we're not sure it's actually an import. Since we create an Alias, that follows the existing naming pattern (on module, on function, etc.).
on_wildcard_expansion? or maybe we can combine it in on_alias by passing relevant info?
Is your feature request related to a problem? Please describe.
In the ecosystem, we have common conventions to mark objects as public:
import x as x
from a import x as x
from a import *
Users rely on those, but Griffe currently does not support them. This affects both our API checker and mkdocstrings-python: some objects might be wrongly considered private instead of public, or the opposite.
Describe the solution you'd like
Support these conventions.
A few solution ideas:
public
attribute? When visiting modules, setpublic = True
on objects imported like that. Later, if we find__all__
is defined, set them back toNone
. Not sure I like usingpublic
like that, internally.on_alias
? Extensions do not run during wildcard expansion though.Describe alternatives you've considered
/
Additional context
See mkdocstrings/python#39.
The text was updated successfully, but these errors were encountered: