From a88879ea699e758695f9e11e4bf1d4c4f668b4d3 Mon Sep 17 00:00:00 2001 From: "Hasko, Vladimir" Date: Thu, 10 Aug 2023 16:14:39 +0000 Subject: [PATCH] fix sphinx problems with constraints Reviewed-by: vladimirhasko Co-authored-by: Hasko, Vladimir Co-committed-by: Hasko, Vladimir --- api-ref/source/conf.py | 11 + .../source/conf.py | 11 + doc/component-operation-guide/source/conf.py | 11 + tox.ini | 202 +++++++++--------- umn/source/conf.py | 11 + 5 files changed, 146 insertions(+), 100 deletions(-) diff --git a/api-ref/source/conf.py b/api-ref/source/conf.py index b44a368..575b3a7 100644 --- a/api-ref/source/conf.py +++ b/api-ref/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/mapreduce-service' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/mapreduce-service/api-ref/' +otcdocs_doc_title = 'API Reference' +otcdocs_doc_type = 'api-ref' +otcdocs_service_category = 'big_data' +otcdocs_service_title = 'MapReduce Service' +otcdocs_service_type = 'mrs' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/doc/component-operation-guide-lts/source/conf.py b/doc/component-operation-guide-lts/source/conf.py index 8c94fca..ee08366 100644 --- a/doc/component-operation-guide-lts/source/conf.py +++ b/doc/component-operation-guide-lts/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/mapreduce-service' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/mapreduce-service/operation-guide-lts/' +otcdocs_doc_title = 'Component Operation Guide (LTS)' +otcdocs_doc_type = 'operation-guide-lts' +otcdocs_service_category = 'big_data' +otcdocs_service_title = 'MapReduce Service' +otcdocs_service_type = 'mrs' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/doc/component-operation-guide/source/conf.py b/doc/component-operation-guide/source/conf.py index 470c485..e47df4e 100644 --- a/doc/component-operation-guide/source/conf.py +++ b/doc/component-operation-guide/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/mapreduce-service' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/mapreduce-service/operation-guide/' +otcdocs_doc_title = 'Component Operation Guide' +otcdocs_doc_type = 'operation-guide' +otcdocs_service_category = 'big_data' +otcdocs_service_title = 'MapReduce Service' +otcdocs_service_type = 'mrs' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. diff --git a/tox.ini b/tox.ini index e27f99d..a29aef6 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,9 @@ commands = {posargs} # This env is invoked in the periodic pipeline and is therefore responsible to # build all relevant docs at once. [testenv:docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = + -r{toxinidir}/doc/requirements.txt + -c https://raw.githubusercontent.com/opentelekomcloud-docs/docs-constraints/main/constraints.txt allowlist_externals = mkdir cp @@ -34,17 +36,17 @@ allowlist_externals = commands = rm -rf doc/build/html doc/build/doctrees sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html - {[testenv:api-ref]commands} - {[testenv:json-api-ref]commands} - {[testenv:operation-guide]commands} - {[testenv:json-operation-guide]commands} {[testenv:operation-guide-lts]commands} {[testenv:json-operation-guide-lts]commands} {[testenv:umn]commands} {[testenv:json-umn]commands} + {[testenv:operation-guide]commands} + {[testenv:json-operation-guide]commands} + {[testenv:api-ref]commands} + {[testenv:json-api-ref]commands} [testenv:docs-pdf] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = rm mkdir @@ -53,101 +55,15 @@ allowlist_externals = cp commands = mkdir -p doc/build/pdf - {[testenv:api-ref-pdf-docs]commands} - {[testenv:operation-guide-pdf-docs]commands} {[testenv:operation-guide-lts-pdf-docs]commands} {[testenv:umn-pdf-docs]commands} - - -# HTML version -[testenv:api-ref] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir -commands = - sphinx-build -W --keep-going -b html api-ref/source doc/build/html/api-ref - mkdir -p api-ref/build/html - cp -av doc/build/html/api-ref api-ref/build/html - -# Json version (for search) -[testenv:json-api-ref] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir - sh -commands = - sphinx-build -W --keep-going -b json api-ref/source doc/build/json/api-ref - # Drop data useless for the search - wrap it also with sh/xargs due to bugs - # in tox - sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" - mkdir -p api-ref/build/json - cp -av doc/build/json/api-ref api-ref/build/json - -# PDF version -[testenv:api-ref-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - rm - mkdir - make - bash - cp -commands = - rm -rf api-ref/build/pdf - sphinx-build -W --keep-going -b latex api-ref/source api-ref/build/pdf/ - bash -c "for f in api-ref/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" - bash -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" - make -C api-ref/build/pdf - mkdir -p doc/build/pdf - cp api-ref/build/pdf/mrs-api-ref.pdf doc/build/pdf/ - - -# HTML version -[testenv:operation-guide] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir -commands = - sphinx-build -W --keep-going -b html doc/component-operation-guide/source doc/build/html/operation-guide - -# Json version (for search) -[testenv:json-operation-guide] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - cp - mkdir - sh -commands = - sphinx-build -W --keep-going -b json doc/component-operation-guide/source doc/build/json/operation-guide - # Drop data useless for the search - wrap it also with sh/xargs due to bugs - # in tox - sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" - -# PDF version -[testenv:operation-guide-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt -allowlist_externals = - rm - mkdir - make - bash - cp -commands = - rm -rf doc/component-operation-guide/build/pdf - sphinx-build -W --keep-going -b latex doc/component-operation-guide/source doc/component-operation-guide/build/pdf/ - bash -c "for f in doc/component-operation-guide/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" - bash -c "for f in doc/component-operation-guide/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" - make -C doc/component-operation-guide/build/pdf - mkdir -p doc/build/pdf - cp doc/component-operation-guide/build/pdf/mrs-component-operation-guide.pdf doc/build/pdf/ + {[testenv:operation-guide-pdf-docs]commands} + {[testenv:api-ref-pdf-docs]commands} # HTML version [testenv:operation-guide-lts] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -156,7 +72,7 @@ commands = # Json version (for search) [testenv:json-operation-guide-lts] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -169,7 +85,7 @@ commands = # PDF version [testenv:operation-guide-lts-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = rm mkdir @@ -188,7 +104,7 @@ commands = # HTML version [testenv:umn] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -199,7 +115,7 @@ commands = # Json version (for search) [testenv:json-umn] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = cp mkdir @@ -214,7 +130,7 @@ commands = # PDF version [testenv:umn-pdf-docs] -deps = -r{toxinidir}/doc/requirements.txt +deps = {[testenv:docs]deps} allowlist_externals = rm mkdir @@ -231,6 +147,92 @@ commands = cp umn/build/pdf/mrs-umn.pdf doc/build/pdf/ +# HTML version +[testenv:operation-guide] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir +commands = + sphinx-build -W --keep-going -b html doc/component-operation-guide/source doc/build/html/operation-guide + +# Json version (for search) +[testenv:json-operation-guide] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir + sh +commands = + sphinx-build -W --keep-going -b json doc/component-operation-guide/source doc/build/json/operation-guide + # Drop data useless for the search - wrap it also with sh/xargs due to bugs + # in tox + sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" + +# PDF version +[testenv:operation-guide-pdf-docs] +deps = {[testenv:docs]deps} +allowlist_externals = + rm + mkdir + make + bash + cp +commands = + rm -rf doc/component-operation-guide/build/pdf + sphinx-build -W --keep-going -b latex doc/component-operation-guide/source doc/component-operation-guide/build/pdf/ + bash -c "for f in doc/component-operation-guide/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in doc/component-operation-guide/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + make -C doc/component-operation-guide/build/pdf + mkdir -p doc/build/pdf + cp doc/component-operation-guide/build/pdf/mrs-component-operation-guide.pdf doc/build/pdf/ + + +# HTML version +[testenv:api-ref] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir +commands = + sphinx-build -W --keep-going -b html api-ref/source doc/build/html/api-ref + mkdir -p api-ref/build/html + cp -av doc/build/html/api-ref api-ref/build/html + +# Json version (for search) +[testenv:json-api-ref] +deps = {[testenv:docs]deps} +allowlist_externals = + cp + mkdir + sh +commands = + sphinx-build -W --keep-going -b json api-ref/source doc/build/json/api-ref + # Drop data useless for the search - wrap it also with sh/xargs due to bugs + # in tox + sh -c "find doc/build/json -type d -and '(' -name '_images' -or -name '_static' -or -name '_sources' ')' -print0 | xargs -0 rm -rf" + mkdir -p api-ref/build/json + cp -av doc/build/json/api-ref api-ref/build/json + +# PDF version +[testenv:api-ref-pdf-docs] +deps = {[testenv:docs]deps} +allowlist_externals = + rm + mkdir + make + bash + cp +commands = + rm -rf api-ref/build/pdf + sphinx-build -W --keep-going -b latex api-ref/source api-ref/build/pdf/ + bash -c "for f in api-ref/build/pdf/*.gif; do convert $f $\{f/%gif/png\}; done || true" + bash -c "for f in api-ref/build/pdf/*.tex; do sed -iorig 's/\.gif//g' $f; done" + make -C api-ref/build/pdf + mkdir -p doc/build/pdf + cp api-ref/build/pdf/mrs-api-ref.pdf doc/build/pdf/ + + [doc8] ignore = D001 diff --git a/umn/source/conf.py b/umn/source/conf.py index da49224..65d6d7c 100644 --- a/umn/source/conf.py +++ b/umn/source/conf.py @@ -30,6 +30,17 @@ otcdocs_repo_name = 'docs/mapreduce-service' otcdocs_git_fqdn = 'gitea.eco.tsi-dev.otc-service.com' otcdocs_git_type = 'gitea' +# Those variables are needed for indexing into OpenSearch +otcdocs_doc_environment = 'internal' +otcdocs_doc_link = '/mapreduce-service/umn/' +otcdocs_doc_title = 'User Guide' +otcdocs_doc_type = 'umn' +otcdocs_service_category = 'big_data' +otcdocs_service_title = 'MapReduce Service' +otcdocs_service_type = 'mrs' +otcdocs_search_environment = 'hc_de' +otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here.