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: RecursionError: maximum recursion depth exceeded #302

Closed
quantfreedom opened this issue Jul 5, 2024 · 14 comments
Closed

bug: RecursionError: maximum recursion depth exceeded #302

quantfreedom opened this issue Jul 5, 2024 · 14 comments
Assignees
Labels
bug Something isn't working

Comments

@quantfreedom
Copy link

Description of the bug

this file used to work perfectly fine but now it doesn't ... i was on python 3.10.10 and griffe v 0.45.2 but now i am on 3.12.4 and griffe 0.47.0 so not sure if that is causing the problem or i am just an idiot

I keep getting a RecursionError: maximum recursion depth exceeded when i run this code
https://github.com/quantfreedom/QuantFreedom/blob/efb0cc838d70b7c56ae21702d05d8ff02b2a2447/gen_ref_pages.py

To Reproduce

just download my quantfreedom dev branch and you can try to run the gen_ref_pages.py file

Full traceback

Full traceback
File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in has_docstrings
    return any(member.has_docstrings for member in self.members.values())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 412, in <genexpr>
    return any(member.has_docstrings for member in self.members.values())
               ^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 879, in has_docstrings
    return self.final_target.has_docstrings
           ^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 1339, in final_target
    target = target.target  # type: ignore[assignment]
             ^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 1308, in target
    self.resolve_target()
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 1367, in resolve_target
    self._resolve_target()
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 1375, in _resolve_target
    raise AliasResolutionError(self) from error
          ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\exceptions.py", line 45, in __init__
    filepath = alias.parent.relative_filepath  # type: ignore[union-attr]
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "e:\Coding\venvs\qfree_3_12_4\Lib\site-packages\griffe\dataclasses.py", line 633, in relative_filepath
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    other = self.with_segments(other, *_deprecated)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 385, in with_segments
    return type(self)(*pathsegments)
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    other = self.with_segments(other, *_deprecated)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 385, in with_segments
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    other = self.with_segments(other, *_deprecated)
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    other = self.with_segments(other, *_deprecated)
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    return self.filepath.relative_to(cwd)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 677, in relative_to
    other = self.with_segments(other, *_deprecated)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 385, in with_segments
    return type(self)(*pathsegments)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 1162, in __init__
    super().__init__(*args)
  File "C:\Users\User\AppData\Local\Programs\Python\Python312\Lib\pathlib.py", line 358, in __init__
    def __init__(self, *args):

RecursionError: maximum recursion depth exceeded

Expected behavior

it is supposed to grab all the py files that have doc strings and turn the doc strings into md files

Environment information

griffe --debug-info  # | xclip -selection clipboard
  • System: Windows-10-10.0.19045-SP0
  • Python: cpython 3.12.4 (E:\coding\venvs\qfree_3_12_4\Scripts\python.exe)
  • Environment variables:
    • PYTHONPATH: E:\Coding\my_stuff
  • Installed packages:
    • griffe v0.47.0

Additional context

the error just keeps repeating forever
image

@quantfreedom quantfreedom added the unconfirmed This bug was not reproduced yet label Jul 5, 2024
@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

Hi @quantfreedom, thank you for the report. Unfortunately I am not able to reproduce the issue you describe. Here is what I tried:

git clone https://github.com/quantfreedom/QuantFreedom
cd QuantFreedom
git checkout dev
poetry install -E docs
poetry run python gen_ref_pages.py

(These are the instructions you should have posted instead of "just download my quantfreedom dev branch" by the way 🙏 )

It fails with Config value 'docs_dir': The path '/media/data/dev/QuantFreedom/docs' isn't an existing directory..

Then I upgrade Griffe in the venv and try again:

poetry run pip install -U griffe
poetry run python gen_ref_pages.py

It fails again with Config value 'docs_dir': The path '/media/data/dev/QuantFreedom/docs' isn't an existing directory.. If it reaches code from mkdocs-gen-files (which I suspect is triggering the loading of the MkDocs configuration, hence the error above), to me it means that Griffe was able to load your package API.

Indeed, the following works fine:

% poetry run python                 
Python 3.11.5 (main, Aug 26 2023, 14:36:58) [GCC 13.2.1 20230801] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import griffe
>>> griffe.load("quantfreedom")
Module(PosixPath('/media/data/dev/QuantFreedom/quantfreedom/__init__.py'))

Happy to investigate further if you can give me instructions to reproduce the recursion error 🙂

@quantfreedom
Copy link
Author

@pawamoy i think it is because in the main quantfreedom folder u have no folder named docs ... so I think if u create that folder then it should work

@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

Thanks. I did just that, then ran again the gen_ref_pages.py script, and it worked. It created all the reference files in the docs folder with mkdocstrings ::: instructions.

@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

The poetry run mkdocs serve command also works fine, I'm able to browse the site on localhost:8000 🙂 I confirm that griffe==0.47.0 is installed.

@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

It works on both Python 3.11 and 3.12.

@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

Maybe try to reset your virtual environment (removing and recreating it)?

@quantfreedom
Copy link
Author

@pawamoy hmmmm maybe I need to delete my docs folder or something and try from scratch

Also what version of python are u running

I am running 3.12.4

@quantfreedom
Copy link
Author

@pawamoy ok i am dumb ... i didn't push my changes to the dev branch but now i did so you can try it again

also i tried to delete my docs folder and make a new one and it was still giving me the same error

also i know you said it works on 3.12 but specifically 3.12.4? which 3.12 are you running?

@quantfreedom
Copy link
Author

900

@pawamoy
Copy link
Member

pawamoy commented Jul 5, 2024

Thanks for the update. has_docstrings is a bit too greedy indeed, it will recurse in every member even if it already scanned it. We could change its semantics a bit and only scan members that are considered public, which drastically reduces the recursivity.

I'm left wondering if has_docstrings is actually a good idea 🤔 But in the mean time we can consider this bug fix of only recursing into public members. What do you think? If you want to try locally, patch Griffe's code to replace

        return any(member.has_docstrings for member in self.members.values())

by

        return any(member.has_docstrings for member in self.members.values() if member.is_public)

...in griffe/dataclasses.py line 433.

@quantfreedom
Copy link
Author

quantfreedom commented Jul 6, 2024

@pawamoy ok it works now ... but i don't know enough about why has_docstrings is a good or bad idea ... are you talking about in general or are you talking about in this specific situation?

also there is probably an extremely high chance that i am not doing something like most coders would do as far as good coding practice. So if you think i should or shouldn't be doing something on documenting my code that you noticed please let me know as i am 100% self taught and never really spoke to anyone who has a high amount of skill in python about the dos and don'ts of documentation

@pawamoy
Copy link
Member

pawamoy commented Jul 6, 2024

but i don't know enough about why has_docstrings is a good or bad idea ... are you talking about in general or are you talking about in this specific situation?

I meant in general. The semantics of has_docstrings are pretty vague, it's not clear what it means when we say that an object "has docstrings". Does it include all members? Or just members declared within this object, so excluding imported objects or inherited members? Does it include private objects? etc. I suppose I could make the docs more clear.

[...] that you noticed please let me know as i am 100% self taught and [...]

Congrats on being self-taught! I am too myself, in the sense that I never had private lessons to learn Python, only read tons of code and online tutorials, articles, blog posts, etc. 🙂

I didn't carefully read all your code but I don't think you're doing anything wrong, don't worry 👍

@pawamoy pawamoy added bug Something isn't working and removed unconfirmed This bug was not reproduced yet labels Jul 6, 2024
@quantfreedom
Copy link
Author

@pawamoy ok sounds good ... so the hot fix that i added, will that be something maybe you will look to upgrade in the future or what should i do with that hot fix vs updating when you update griffe?

@pawamoy
Copy link
Member

pawamoy commented Jul 6, 2024

I'll push a new release soon with the fix :) You'll just have to upgrade.

pawamoy added a commit that referenced this issue Aug 10, 2024
…om `has_docstrings`, unless they're public

Issue-302: #302
@pawamoy pawamoy closed this as completed Aug 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants