From dc39ed0997896ccd6a7007cba1e8ed105b3cd838 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Fri, 18 Aug 2023 16:37:52 +0200 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=A7=AA=20CI:=20Fail=20on=20sphinx-bui?= =?UTF-8?q?ld=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/js_test.yml | 10 +++++++++- docs/conf.py | 5 +++++ sphinx_needs/debug.py | 1 - 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/js_test.yml b/.github/workflows/js_test.yml index 69bf86aed..099da7958 100644 --- a/.github/workflows/js_test.yml +++ b/.github/workflows/js_test.yml @@ -39,7 +39,15 @@ jobs: run: npm install cypress - name: Build Docs id: sphinx-build-docs - run: sphinx-build -a -T -E -j 4 -b html -d /tmp/sphinx_build/doctrees ./docs /tmp/sphinx_build/html + # run sphinx with options: + # -n nitpicky mode + # -W turn warnings into errors + # --keep-going keep going when sphinx encounters errors (only error out at the end) + # -a write all files + # -T show full traceback on exception + # -E don't use a saved environment + # -j 4 use 4 parallel processes + run: sphinx-build -n -W --keep-going -a -T -E -j 4 -b html -d /tmp/sphinx_build/doctrees ./docs /tmp/sphinx_build/html - name: E2E Cypress Test on Chrome uses: cypress-io/github-action@v6 with: diff --git a/docs/conf.py b/docs/conf.py index 07abd022c..51cfeaf59 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,6 +62,11 @@ "sphinx": ("https://www.sphinx-doc.org/en/master", None), } +nitpick_ignore = [ + ("py:class", "T"), + ("py:class", "sphinx_needs.data.NeedsInfoType"), +] + # smartquotes = False needs_debug_measurement = True diff --git a/sphinx_needs/debug.py b/sphinx_needs/debug.py index b340510bf..253bd5725 100644 --- a/sphinx_needs/debug.py +++ b/sphinx_needs/debug.py @@ -50,7 +50,6 @@ def my_cool_function(a, b,c ): :param category: Name of a category, which helps to cluster the measured functions. :param source: Should be "internal" or "user". Used to easily structure function written by user. :param name: Name to use for the measured. If not given, the function name is used. - :param func: Can contain a func, which shall get decorated. Not used if ``measure_time`` is used as decorator. """ def inner(func: T) -> T: From ff65c500dca636237828442d65ac973ce73cc73c Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 31 Aug 2023 15:03:25 +0200 Subject: [PATCH 2/7] Update .readthedocs.yml --- .readthedocs.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index b156c2885..dfe091dfa 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -2,6 +2,8 @@ version: 2 sphinx: configuration: docs/conf.py + builder: html + fail_on_warning: true python: install: From 954944fcb42649cb26245883461727ccfe43b859 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 31 Aug 2023 15:11:01 +0200 Subject: [PATCH 3/7] Don't fail js_tests on docs warning --- .github/workflows/js_test.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/js_test.yml b/.github/workflows/js_test.yml index 099da7958..69bf86aed 100644 --- a/.github/workflows/js_test.yml +++ b/.github/workflows/js_test.yml @@ -39,15 +39,7 @@ jobs: run: npm install cypress - name: Build Docs id: sphinx-build-docs - # run sphinx with options: - # -n nitpicky mode - # -W turn warnings into errors - # --keep-going keep going when sphinx encounters errors (only error out at the end) - # -a write all files - # -T show full traceback on exception - # -E don't use a saved environment - # -j 4 use 4 parallel processes - run: sphinx-build -n -W --keep-going -a -T -E -j 4 -b html -d /tmp/sphinx_build/doctrees ./docs /tmp/sphinx_build/html + run: sphinx-build -a -T -E -j 4 -b html -d /tmp/sphinx_build/doctrees ./docs /tmp/sphinx_build/html - name: E2E Cypress Test on Chrome uses: cypress-io/github-action@v6 with: From ca2cc5046f9063e01e53c95dfcacec5ecd16173f Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Thu, 31 Aug 2023 15:13:13 +0200 Subject: [PATCH 4/7] set nitpicky to always true --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index 51cfeaf59..35d89f883 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,6 +62,7 @@ "sphinx": ("https://www.sphinx-doc.org/en/master", None), } +nitpicky = True nitpick_ignore = [ ("py:class", "T"), ("py:class", "sphinx_needs.data.NeedsInfoType"), From 8421ff3185a845a5df6ec0400543a404a12698e4 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 27 Sep 2023 09:14:16 -0300 Subject: [PATCH 5/7] Update changelog.rst --- docs/changelog.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 44b2c43ee..c26a5b040 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -15,13 +15,11 @@ Released: under development 1.4.0 ----- Released: under development + * Improvement: Added Builder :ref:`needs_id_builder` added and config option :ref:`needs_build_json_per_id` in `conf.py`. -* Improvement: Reduce document build time, by memoizing the inline parse in ``build_need`` - (`#968 `_) -* Change `NeedsBuilder` format to `needs` - (`#978 `_) -* Improvement: Suffix all warnings with ``[needs]``, and allow them to be suppressed - (`#975 `_) +* Improvement: Reduce document build time, by memoizing the inline parse in ``build_need`` (`#968 `_) +* Change `NeedsBuilder` format to `needs` (`#978 `_) +* Improvement: Suffix all warnings with ``[needs]``, and allow them to be suppressed (`#975 `_) * Improvement: :ref:`needextend` for single needs is much faster. * Improvement: external_needs is using cached templates to save generation time. From ae93b701d7b651e688761c9fe09d4715aa8f488c Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 27 Sep 2023 09:20:38 -0300 Subject: [PATCH 6/7] Update conf.py --- docs/conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/conf.py b/docs/conf.py index f00f2a356..08a5646b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -65,6 +65,7 @@ nitpicky = True nitpick_ignore = [ ("py:class", "T"), + ("py:class", "sphinx_needs.debug.T"), ("py:class", "sphinx_needs.data.NeedsInfoType"), ] From d8360d49bc6d23db626262969c99d858fad16756 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Wed, 27 Sep 2023 09:25:56 -0300 Subject: [PATCH 7/7] Update requirements.txt --- docs/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/requirements.txt b/docs/requirements.txt index 633d78ae6..ed19d3bf9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -7,4 +7,4 @@ sphinxcontrib-programoutput sphinx-design click tabulate -sphinx-immaterial==0.11.6 +sphinx-immaterial==0.11.7