sphinx-contrib / napoleon

Other
149 stars 48 forks source link

Python 3.10 compatibility #38

Open hoodmane opened 2 years ago

hoodmane commented 2 years ago

Trying to use in Python 3.10 yields the error:

  File "/usr/local/lib/python3.10/site-packages/sphinxcontrib/napoleon/__init__.py", line 13, in <module>
    from sphinxcontrib.napoleon.docstring import GoogleDocstring, NumpyDocstring
  File "/usr/local/lib/python3.10/site-packages/sphinxcontrib/napoleon/docstring.py", line 16, in <module>
    from collections import Callable
ImportError: cannot import name 'Callable' from 'collections' (/usr/local/lib/python3.10/collections/__init__.py)
marscher commented 2 years ago

Thanks for bringing it up @hoodmane and thanks for fixing it @Mab879. Any idea, when this will be released?

tomvothecoder commented 2 years ago

Any update on when a new version will be released that includes this fix?

https://github.com/sphinx-contrib/napoleon/commit/572de996794305117443a9c29118c6781f2b3ad2

demberto commented 2 years ago

Callable is in collections.abc

tomvothecoder commented 1 year ago

I think this package is deprecated (https://github.com/sphinx-contrib/napoleon/issues/43).

It is now available directly through Sphinx via sphinx.ext.napoleon. I was able to update my conda environments to Python 3.10 with this method.