Chilipp / autodocsumm

Extending your autodoc API docs with a summary
Apache License 2.0
48 stars 14 forks source link

Default falsy 'get_doc' result to the empty-list #42

Closed EpicWink closed 3 years ago

EpicWink commented 3 years ago

Fixes TypeError: 'NoneType' object is not iterable when using Sphinx v3.4 or later. Sphinx v3.4 (specifically sphinx-doc/sphinx@6c645e4) made Documenter.get_doc for variables which were aliases of classes return None

Chilipp commented 3 years ago

thanks for the hint @EpicWink! there seems to be more things that changed with sphinx 3.4. I did not yet had the chance to look. See https://github.com/Chilipp/autodocsumm/runs/1958587169?check_suite_focus=true

hogepodge commented 3 years ago

We are also running into this issue when building docs for https://github.com/apache/tvm

EpicWink commented 3 years ago

I've found a work-around: you can override the get_doc method of autodocsumm's documenters with something that returns the empty list.

See this gist: https://gist.github.com/EpicWink/ed8f471a17c3c3a6ff13c5c483669489

codecov[bot] commented 3 years ago

Codecov Report

Merging #42 (3ab8843) into master (6bc5815) will increase coverage by 1.19%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #42      +/-   ##
==========================================
+ Coverage   85.76%   86.95%   +1.19%     
==========================================
  Files           1        1              
  Lines         274      276       +2     
==========================================
+ Hits          235      240       +5     
+ Misses         39       36       -3     
Impacted Files Coverage Δ
autodocsumm/__init__.py 86.95% <100.00%> (+1.19%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6bc5815...3ab8843. Read the comment docs.