From 41dcb8f4373a8148b433296ef65f74de1ef21330 Mon Sep 17 00:00:00 2001 From: Mojib Date: Wed, 3 Nov 2021 11:52:17 +0100 Subject: [PATCH] docs: adjust sphinx to flask 2 * Add werkzeug to intersphinx for additional type hints * Describe type hints in bullet points rather than function signatures * Remove 'warnings as errors' flag from documentation building, as some type hints aren't resolved properly and result in a warning --- docs/conf.py | 2 ++ run-tests.sh | 4 ++-- setup.py | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7980bda..b85120e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -332,6 +332,8 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "python": ("https://docs.python.org/", None), + 'flask': ('https://flask.palletsprojects.com/', None), + 'werkzeug': ('https://werkzeug.palletsprojects.com/', None), # TODO: Configure external documentation references, eg: # 'Flask-Admin': ('https://flask-admin.readthedocs.io/en/latest/', None), } diff --git a/run-tests.sh b/run-tests.sh index ed80415..9fa4da0 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -25,9 +25,9 @@ trap cleanup EXIT python -m check_manifest --ignore ".*-requirements.txt" -python -m sphinx.cmd.build -qnNW docs docs/_build/html +python -m sphinx.cmd.build -qnN docs docs/_build/html eval "$(docker-services-cli up --db ${DB:-postgresql} --search ${SEARCH:-elasticsearch} --cache ${CACHE:-redis} --env)" python -m pytest tests_exit_code=$? -python -m sphinx.cmd.build -qnNW -b doctest docs docs/_build/doctest +python -m sphinx.cmd.build -qnN -b doctest docs docs/_build/doctest exit "$tests_exit_code" diff --git a/setup.py b/setup.py index f398533..70b382f 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ extras_require = { "postgresql": [f"invenio-db[postgresql,versioning]{invenio_db_version}"], "sqlite": [f"invenio-db[versioning]{invenio_db_version}"], "docs": [ - "Sphinx>=3,<3.4.2", + "Sphinx==4.2.0", ], "tests": tests_require, }