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

autoapi-inheritance-diagram: TypeError: '<' not supported between instances of 'NoneType' and 'str' #396

Closed
kenodegard opened this issue Jun 16, 2023 · 0 comments · Fixed by #397

Comments

@kenodegard
Copy link
Contributor

If a tooltip cannot be derived from the cls.__doc__ we risk performing a sort between None and strs:

To reproduce:

$ mkdir scratch
$ cd scratch
$ echo "from setuptools.command.sdist import sdist" > code.py
$ echo ".. autoapi-inheritance-diagram:: code.sdist" > index.rst
$ echo "extensions = ['autoapi.extension']" > conf.py
$ echo "autoapi_dirs = ['.']" >> conf.py
$ sphinx-build -M html . _build
Running Sphinx v4.2.0
[AutoAPI] Reading files... [100%] /Users/kodegard/scratch/sphinx-error/code.py
[AutoAPI] Mapping Data... [100%] /Users/kodegard/scratch/sphinx-error/code.py
[AutoAPI] Rendering Data... [ 50%] conf
[AutoAPI] Rendering Data... [100%] code

[autosummary] generating autosummary for: index.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [new config] 4 added, 0 changed, 0 removed
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... /Users/kodegard/scratch/sphinx-error/autoapi/index.rst: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [100%] index
Exception occurred:
  File "/Users/kodegard/.conda/arm64/23.3.1/3.10/envs/docs/lib/python3.10/site-packages/sphinx/ext/inheritance_diagram.py", line 300, in generate_dot
    for name, fullname, bases, tooltip in sorted(self.class_info):
TypeError: '<' not supported between instances of 'NoneType' and 'str'
The full traceback has been saved in /var/folders/9l/7sv3nyt57w74wg3l3yvzz4b40000gn/T/sphinx-err-ismlgube.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!

sphinx-err-ismlgube.log

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

Successfully merging a pull request may close this issue.

1 participant