Added try-catch for autodoc mock-import#89
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
- Coverage 50.19% 50.15% -0.04%
==========================================
Files 18 18
Lines 1289 1292 +3
Branches 262 262
==========================================
+ Hits 647 648 +1
- Misses 598 600 +2
Partials 44 44
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| try: | ||
| from sphinx.ext.autodoc.mock import mock | ||
| except ImportError: | ||
| from sphinx.ext.autodoc import mock | ||
| # A persistent bug in sphinx / autodoc causes problems during importing (#82) | ||
|
|
There was a problem hiding this comment.
Hm, I'm a little in doubt now. I feel the intended method to import is the short version:
from sphinx.ext.autodoc import mock
So maybe we should prioritize that one. If for no other reason then to prevent us being the cause of an import error for the next package.
EDIT: I changed it but let's see what the bosses say over at sphinx-doc/sphinx#14333
|
FYI: We are still/again seeing this issue with khard 0.21.0, sphinx 9.1.0 when trying to build the package for Arch Linux: lucc/khard#356 |
88cd1f0 to
46a37d2
Compare
|
I want to merge this try-catch import, I think that should be future proof even if Sphinx rearranged their module structure. With pip you can do this with an install like this: |
Resolving #82 (again...)
This is the suggestion of @lucc , posted here: #82 (comment)