bagel897 / pytoolconfig

Python tool configuration
GNU Lesser General Public License v3.0
4 stars 2 forks source link

Documentation fails to build #10

Closed mweinelt closed 1 year ago

mweinelt commented 1 year ago

Looks related to a change introduced in v1.2.2. https://github.com/bagel897/pytoolconfig/commit/c6772e7f711033654aedc03e42a84fc6ba74c2d0


❯ pdm run sphinx-build docs docsout
Running Sphinx v5.3.0
WARNING: html_static_path entry '_static' does not exist
[autosummary] generating autosummary for: api.rst, command_line.rst, documentation.rst, global_configuration.rst, index.rst, pydantic.rst, universal_config.rst
[autosummary] generating autosummary for: /tmp/pytoolconfig/docs/generated/pytoolconfig.PyToolConfig.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.sources.IniConfig.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.sources.PyProject.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.sources.PyTool.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.sources.SetupConfig.rst, /tmp/pytoolconfig/docs/generated/pytoolconfig.sources.Source.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 7 source files that are out of date
updating environment: [new config] 14 added, 0 changed, 0 removed
/tmp/pytoolconfig/pytoolconfig/pytoolconfig.py:docstring of pytoolconfig.pytoolconfig.PyToolConfig.__init__:15: WARNING: Inline emphasis start-string without end-string.               
/tmp/pytoolconfig/pytoolconfig/pytoolconfig.py:docstring of pytoolconfig.pytoolconfig.PyToolConfig.__init__:16: WARNING: Inline strong start-string without end-string.
/tmp/pytoolconfig/docs/generated/pytoolconfig.sources.PyTool.rst:26: WARNING: autosummary: failed to import PyTool.tool.
Possible hints:
* ModuleNotFoundError: No module named 'PyTool'
* KeyError: 'PyTool'
* AttributeError: type object 'PyTool' has no attribute 'tool'
* ImportError: 
* ModuleNotFoundError: No module named 'pytoolconfig.sources.PyTool'
* AttributeError: type object 'PyTool' has no attribute 'PyTool'
/tmp/pytoolconfig/docs/generated/pytoolconfig.sources.PyTool.rst:26: WARNING: autosummary: failed to import PyTool.file.
Possible hints:
* ModuleNotFoundError: No module named 'PyTool'
* KeyError: 'PyTool'
* AttributeError: type object 'PyTool' has no attribute 'file'
* ImportError: 
* ModuleNotFoundError: No module named 'pytoolconfig.sources.PyTool'
* AttributeError: type object 'PyTool' has no attribute 'PyTool'

Exception occurred:
  File "/tmp/pytoolconfig/pytoolconfig/documentation.py", line 31, in _type_to_str
    return type_to_print.__name__
AttributeError: 'str' object has no attribute '__name__'
The full traceback has been saved in /tmp/sphinx-err-azhj1kct.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
mweinelt commented 1 year ago
  • ModuleNotFoundError: No module named 'pytoolconfig.sources.PyTool'

Also, sphinx tries to import these names as modules, which cannot work, since they're in __all__.

https://github.com/bagel897/pytoolconfig/blob/c861c188ccb42bebd38824f05f9f775db07eed72/docs/api.rst