sphinx-doc / sphinxcontrib-django

This is a sphinx extension which improves the documentation of Django apps.
https://pypi.org/project/sphinxcontrib-django/
Apache License 2.0
43 stars 25 forks source link

AttributeError: 'ModuleAnalyzer' object has no attribute 'analyze' #49

Closed WhyNotHugo closed 1 year ago

WhyNotHugo commented 1 year ago

I'm seeing this very unusual error in readthedocs:

https://readthedocs.org/projects/django-afip/builds/22035160/

However, I can't reproduce this locally. I don't see the analyze method in the Sphinx documentation https://pydoc.dev/sphinx/latest/sphinx.pycode.ModuleAnalyzer.html. However, I do see the method right there in /usr/lib/python3.11/site-packages/sphinx/pycode/__init__.py.

Any idea what might be wrong?

timobrembeck commented 1 year ago

Ah, apparently analyze() was named parse() prior to sphinx version v3.4.0 (see deprecation): https://github.com/sphinx-doc/sphinx/commit/8e29d57395f9cc964ac0de7e407c84bb45ec7906

I guess it's fine to declare sphinx v3.4.0 as requirement for this extension? Or would you have any problems upgrading the version in your project?

WhyNotHugo commented 1 year ago

Nice find. It turns out that readthedocs pins sphinx < 2 for older project (but I can manually opt-in for a specific version).