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

Bug: Various new "griffe: Failed to parse annotation from 'BoolOp' node at file" errors #102

Closed
shaypal5 opened this issue Sep 19, 2022 · 2 comments

Comments

@shaypal5
Copy link

Describe the bug
My readthedocs-hosted mkdocs build worked fine up until a recent commit - which changed nothing relevant as far as I can tell - where I started getting a lot of:
griffe: Failed to parse annotation from 'BoolOp' node at pdpipe/cond.py:1
On various files (always at line 1)

To Reproduce
See full build here:
https://readthedocs.org/projects/pdpipe/builds/18107492/

And the repo here:
https://github.com/pdpipe/pdpipe

Expected behavior
Build should complete successfully.

System (please complete the following information):

  • griffe version: griffe-0.22.1
  • Python version: 3.8
  • OS: Linux

See full build here:
https://readthedocs.org/projects/pdpipe/builds/18107492/

Stacktrace

INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /home/docs/checkouts/readthedocs.org/user_builds/pdpipe/checkouts/latest/_build/html
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BinOp' node at pdpipe/basic_stages.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/basic_stages.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/basic_stages.py:94: Parameter 'exclude_columns' does not appear in the function signature
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BinOp' node at pdpipe/basic_stages.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/basic_stages.py:154: Parameter 'exclude_columns' does not appear in the function signature
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/basic_stages.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/basic_stages.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/basic_stages.py:477: Parameter 'exclude_columns' does not appear in the function signature
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/basic_stages.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/basic_stages.py:654: Parameter 'exclude_columns' does not appear in the function signature
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/col_generation.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/cond.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/cond.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/core.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/core.py:1126: Parameter 'transform_getter' does not appear in the function signature
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'Tuple' node at pdpipe/core.py:1
�[33mWARNING  -  �[0mgriffe: pdpipe/core.py:1787: Confusing indentation for continuation line 6 in docstring, should be 4 spaces, not 3
�[31mERROR    -  �[0mgriffe: Failed to parse annotation from 'BoolOp' node at pdpipe/nltk_stages.py:1
�[31mERROR    -  �[0mmkdocstrings: No module named 'pdp'
�[31mERROR    -  �[0mError reading page 'reference/runtime_parameters.md':
�[31mERROR    -  �[0mCould not collect 'pdp.run_time_parameters'
@pawamoy
Copy link
Member

pawamoy commented Sep 22, 2022

Hi!

It seems you're using the "type" slot for the description in your docstrings, for example here: pdpipe/pdpipe@b7120ef#diff-ef300b911b47cd25532c53d54944b8153438298de58c57f3629c679341881a18R1207

I'm seeing other errors such as indentation and formatting of the returns section

Our parser tries to follow the Numpydoc style guide.

I'll go ahead and close this for now, don't hesitate to open new issues once your formatting is fixed 🙂
"BoolOp" warnings are already tracked in #93!

@pawamoy pawamoy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2022
@shaypal5
Copy link
Author

Got you.

Of course it's from a PR I received and that's the one thing I didn't check.

Ended up finding numpydoc, and the ability to run

python -m numpydoc pdpipe.run_time_parameters --validate

I'm going to create a numpy-docstring-linting job for my Github Actions, which will prevent this in the future. :)

Thank you!

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

No branches or pull requests

2 participants