Skip to content
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

Use Griffe's public API #548

Closed
pawamoy opened this issue Dec 26, 2024 · 1 comment · Fixed by #550
Closed

Use Griffe's public API #548

pawamoy opened this issue Dec 26, 2024 · 1 comment · Fixed by #550

Comments

@pawamoy
Copy link
Contributor

pawamoy commented Dec 26, 2024

Any reason you're importing from the internal API?

from _griffe.enumerations import DocstringSectionKind
from _griffe.models import Docstring, Object as GriffeObject

You're exposing yourself to breakages if I change these internals 😅
Public equivalent:

from griffe import DocstringSectionKind, Docstring, Object as GriffeObject 

If it's to avoid loading too many things, note that _griffe.models imports a lot of stuff anyway:

from _griffe.c3linear import c3linear_merge
from _griffe.docstrings.parsers import DocstringStyle, parse
from _griffe.enumerations import Kind, ParameterKind, Parser
from _griffe.exceptions import AliasResolutionError, BuiltinModuleError, CyclicAliasError, NameResolutionError
from _griffe.expressions import ExprCall, ExprName
from _griffe.logger import logger
from _griffe.mixins import ObjectAliasMixin
@samuelcolvin
Copy link
Member

I'd love to use public APIs only.

PR welcome to fix it, otherwise I'll try soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants