Skip to content

Can't build documentation after creating submodules #285

@fabifont

Description

@fabifont

Problem Description

I had a project with that structure:

buchino/
|-- init.py
|-- data.py
|-- controller.py
|-- documents/
|-- user.py
|-- place.py
|-- validation.py
|-- config.py
|-- bot.py
|-- scraper.py
|-- booker.py
|-- main.py

and I could build the documentation with: pdoc -d google *.py -o docs/
Then I decided to put some files into some folders and the last project structure is:

buchino/
|-- db/
|    |-- __init__.py
|    |-- init.py
|    |-- data.py
|    |-- controller.py
|    |-- user.py
|    |-- place.py
|-- utils/
|    |-- __init__.py
|    |-- validation.py
|    |-- config.py
|-- __init__.py
|-- bot.py
|-- scraper.py
|-- booker.py
|-- main.py

But now when I try to build the documentation with the same command I get that error:

Traceback (most recent call last):
  File "/usr/lib/python3.9/pathlib.py", line 736, in __str__
    return self._str
AttributeError: _str

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/pdoc", line 33, in <module>
    sys.exit(load_entry_point('pdoc==7.1.1', 'console_scripts', 'pdoc')())
  File "/usr/lib/python3.9/site-packages/pdoc/__main__.py", line 159, in cli
    pdoc.pdoc(
  File "/usr/lib/python3.9/site-packages/pdoc/__init__.py", line 384, in pdoc
    all_modules = extract.walk_specs(modules)
  File "/usr/lib/python3.9/site-packages/pdoc/extract.py", line 49, in walk_specs
    modname = parse_spec(spec)
  File "/usr/lib/python3.9/site-packages/pdoc/extract.py", line 119, in parse_spec
    return parse_spec(spec.parent) + f".{spec.stem}"
  File "/usr/lib/python3.9/site-packages/pdoc/extract.py", line 119, in parse_spec
    return parse_spec(spec.parent) + f".{spec.stem}"
  File "/usr/lib/python3.9/site-packages/pdoc/extract.py", line 119, in parse_spec
    return parse_spec(spec.parent) + f".{spec.stem}"
  [Previous line repeated 984 more times]
  File "/usr/lib/python3.9/site-packages/pdoc/extract.py", line 118, in parse_spec
    if (spec.parent / "__init__.py").exists():
  File "/usr/lib/python3.9/pathlib.py", line 1414, in exists
    self.stat()
  File "/usr/lib/python3.9/pathlib.py", line 1222, in stat
    return self._accessor.stat(self)
  File "/usr/lib/python3.9/pathlib.py", line 743, in __fspath__
    return str(self)
  File "/usr/lib/python3.9/pathlib.py", line 738, in __str__
    self._str = self._format_parsed_parts(self._drv, self._root,
  File "/usr/lib/python3.9/pathlib.py", line 720, in _format_parsed_parts
    return cls._flavour.join(parts)
RecursionError: maximum recursion depth exceeded while calling a Python object

More info about the project structure: fabifont/buchino#16 (comment)

Steps to reproduce the behavior:

  1. https://github.com/fabifont/buchino.git
  2. cd buchino
  3. git checkout dev
  4. pdoc -d google *.py -o docs/

System Information

pdoc: 7.1.1
Python: 3.9.6
Platform: Linux-5.13.5-arch1-1-x86_64-with-glibc2.33

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions