moja-global / moja_global_docs

Repository to host the moja global technical documentation
https://docs.moja.global/en/master/
Mozilla Public License 2.0
35 stars 67 forks source link

Bug🐛: Docs build fails for Python 3.10 #163

Closed HarshCasper closed 2 years ago

HarshCasper commented 2 years ago

Describe the bug.

Currently, the moja global docs build fails for Python 3.10.

Describe the steps to reproduce the behavior.

  1. Clone the repo
  2. Create a virtual environment with Python 3.10
  3. Install the deps and build the site
  4. See the error

Expected behavior.

The docs build should be successful.

Screenshots.

Here are the logs:

Traceback (most recent call last):
  File "C:\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\Scripts\sphinx-build.exe\__main__.py", line 4, in <module>
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\cmd\build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\application.py", line 32, in <module>
    from sphinx.config import Config
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\config.py", line 23, in <module>
    from sphinx.util import logging
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\util\__init__.py", line 35, in <module>
    from sphinx.util import smartypants  # noqa
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\util\smartypants.py", line 33, in <module>
    from sphinx.util.docutils import __version_info__ as docutils_version
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\util\docutils.py", line 31, in <module>
    from sphinx.util.typing import RoleFunction
  File "C:\Users\Inspiron\maizzle\moja_global_docs\docs\env\lib\site-packages\sphinx\util\typing.py", line 34, in <module>
    from types import Union as types_Union
ImportError: cannot import name 'Union' from 'types' (C:\Python310\lib\types.py)
make: *** [Makefile:20: html] Error 1

Operating Environment

Windows, Python 3.10

Additional context.

Bug reported after a message from @padmajabhol on Slack

aornugent commented 2 years ago

This is reported here, we need Sphinx 4.2. https://github.com/sphinx-doc/sphinx/issues/9562