Skip to content

bug: cannot generate docs on python 3.10 #1362

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

Closed
sierzput opened this issue Mar 22, 2024 · 5 comments
Closed

bug: cannot generate docs on python 3.10 #1362

sierzput opened this issue Mar 22, 2024 · 5 comments

Comments

@sierzput
Copy link

sierzput commented Mar 22, 2024

output from make docs:

make -C docs html
make[1]: Entering directory '/mnt/c/Repos/python-docx/docs'
sphinx-build -b html -d .build/doctrees   . .build/html
Traceback (most recent call last):
  File "/mnt/c/Repos/python-docx/.venv/bin/sphinx-build", line 5, in <module>
    from sphinx.cmd.build import main
  File "/mnt/c/Repos/python-docx/.venv/lib/python3.10/site-packages/sphinx/cmd/build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "/mnt/c/Repos/python-docx/.venv/lib/python3.10/site-packages/sphinx/application.py", line 48, in <module>
    from sphinx.util.tags import Tags
  File "/mnt/c/Repos/python-docx/.venv/lib/python3.10/site-packages/sphinx/util/tags.py", line 11, in <module>
    from jinja2 import nodes
  File "/mnt/c/Repos/python-docx/.venv/lib/python3.10/site-packages/jinja2/__init__.py", line 6, in <module>
    from markupsafe import escape
  File "/mnt/c/Repos/python-docx/.venv/lib/python3.10/site-packages/markupsafe/__init__.py", line 13, in <module>
    from collections import Mapping
ImportError: cannot import name 'Mapping' from 'collections' (/usr/lib/python3.10/collections/__init__.py)
make[1]: *** [Makefile:20: html] Error 1
make[1]: Leaving directory '/mnt/c/Repos/python-docx/docs'
make: *** [Makefile:43: docs] Error 2
@scanny
Copy link
Contributor

scanny commented Mar 22, 2024

Did you run pip install -r requirements-docs.txt in your virtualenv? The versions of Sphinx and its dependencies are quite specific for these docs. It works for me locally and on ReadTheDocs so I'd look there first.

@scanny scanny closed this as completed Mar 22, 2024
@sierzput
Copy link
Author

sierzput commented Mar 22, 2024

Yes, I installed requirements-docs.txt in my virtualenv. Problem is fixed when I updated dependencies from requirements-docs.txt to the latest versions. It looks like an issue with some dependency, probably on Python 3.10. Which Python version do you use @scanny ?

@scanny
Copy link
Contributor

scanny commented Mar 22, 2024

My local virtualenv for python-docx has Python 3.8.18 installed. I expect that was on purpose because I got a new machine a few months ago, and I vaguely remember downgrading it for the purpose of building the docs.

@sierzput
Copy link
Author

I think it would be good to update soon anyway, because the end of support for Python 3.8 is October 2024.

@scanny
Copy link
Contributor

scanny commented Mar 22, 2024

Yeah, at some point ReadTheDocs won't support that version anymore and we'll be forced to update I suppose. Switching to the new templates will require pretty broad changes I expect so that's not going to be a quick job :)

The docs aren't really something designed for folks to build for themselves. I don't even use them locally myself, I always go to ReadTheDocs to consult them. But I suppose if you were working offline for some reason that might be handy.

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

No branches or pull requests

2 participants