-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
ValueError when using griffe as a docstring parser #51
Comments
Another example, from the docs, but without annotation: from griffe.dataclasses import Docstring, Function, Parameters, Parameter, ParameterKind
from griffe.docstrings.parsers import Parser, parse
function = Function(
"func",
parameters=Parameters(
Parameter("param1", annotation=None, kind=ParameterKind.positional_or_keyword), # I only changed this line
Parameter("param2", annotation="int", kind=ParameterKind.keyword_only),
),
)
text = """
Hello I'm a docstring!
Parameters:
param1: Description.
param2: Description.
"""
docstring = Docstring(text, lineno=1, parent=function)
parsed = parse(docstring, Parser.google) |
pawamoy
added a commit
that referenced
this issue
Feb 24, 2022
Thanks for the report! This is fixed in master (will push and release soon). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When using Griffe as a docstring-parsing library according to https://mkdocstrings.github.io/griffe/usage/#using-griffe-as-a-docstring-parsing-library , we sometimes get
ValueError
athttps://github.com/mkdocstrings/griffe/blob/master/src/griffe/dataclasses.py#L497
... which is caused by the
warning
methodhttps://github.com/mkdocstrings/griffe/blob/master/src/griffe/docstrings/utils.py#L37
... which is called from
https://github.com/mkdocstrings/griffe/blob/master/src/griffe/docstrings/google.py#L189
... when an annotation is missing.
To Reproduce
Run this:
Expected behavior
No error, just the usual warning. The warning need not contain the file path if there is no file path.
System (please complete the following information):
griffe
version: 0.13.0Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: