Skip to content

Commit 6029d10

Browse files
bbielawxakopytkokblaszczak-intel
authored
[DOCS] Bump Sphinx and Pydata versions (openvinotoolkit#24083)
Sphinx -> 7.2.6 PyData -> 0.14.4 --------- Co-authored-by: Andrzej Kopytko <andrzejx.kopytko@intel.com> Co-authored-by: Karol Blaszczak <karol.blaszczak@intel.com>
1 parent 7b7650e commit 6029d10

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+845
-890
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ temp/
2828
CMakeLists.txt.user
2929
docs/IE_PLUGIN_DG/html/
3030
CMakeUserPresets.json
31+
venv
3132

3233
*.project
3334
*.cproject
@@ -73,4 +74,4 @@ coverage
7374
/src/plugins/intel_cpu/tools/commit_slider/*.json
7475
/src/plugins/intel_cpu/tools/commit_slider/slider_cache/*
7576
/src/plugins/intel_cpu/thirdparty/ComputeLibrary/build/*
76-
.github/GITHUB_OUTPUT
77+
.github/GITHUB_OUTPUT

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,4 @@ endif()
165165
# provides a callback function to describe each component in repo
166166
include(cmake/packaging/packaging.cmake)
167167

168-
ov_cpack(${OV_CPACK_COMPONENTS_ALL})
168+
ov_cpack(${OV_CPACK_COMPONENTS_ALL})

docs/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ function(build_docs)
3131
set(ARTICLES_HELPER_SCRIPT "${SCRIPTS_DIR}/articles_helper.py")
3232
set(COPY_IMAGES_SCRIPT "${SCRIPTS_DIR}/copy_images.py")
3333
set(DOXYGEN_MAPPING_SCRIPT "${SCRIPTS_DIR}/create_mapping.py")
34+
set(DOCS_MAPPING_SCRIPT "${SCRIPTS_DIR}/create_doc_mapping.py")
3435
set(BREATHE_APIDOC_SCRIPT "${SCRIPTS_DIR}/apidoc.py")
3536

3637
# Doxygen/Sphinx setup
@@ -107,6 +108,7 @@ function(build_docs)
107108
POST_BUILD
108109
COMMAND ${Python3_EXECUTABLE} ${COPY_IMAGES_SCRIPT} ${DOXYGEN_XML_OUTPUT} ${SPHINX_SOURCE_DIR}
109110
COMMAND ${Python3_EXECUTABLE} ${DOXYGEN_MAPPING_SCRIPT} ${DOXYGEN_XML_OUTPUT} ${DOCS_BUILD_DIR} ${OpenVINO_SOURCE_DIR}/../
111+
COMMAND ${Python3_EXECUTABLE} ${DOCS_MAPPING_SCRIPT} ${DOCS_BUILD_DIR} ${ARTICLES_EN_DIR}
110112
COMMAND ${CMAKE_COMMAND} -E copy_directory ${SPHINX_SETUP_DIR} ${SPHINX_SOURCE_DIR}
111113
${post_commands}
112114
VERBATIM)

docs/home.rst

-186
This file was deleted.

docs/index.html

-1
This file was deleted.

docs/openvino_custom_sphinx_sitemap/openvino_custom_sphinx_sitemap/__init__.py

+21-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
import xml.etree.ElementTree as ET
2-
from sphinx_sitemap import setup as base_setup, get_locales, hreflang_formatter
2+
import queue
3+
from pathlib import Path
4+
from sphinx_sitemap import setup as base_setup, get_locales, hreflang_formatter, add_html_link, record_builder_type
5+
from sphinx.util.logging import getLogger
36

7+
logger = getLogger(__name__)
48

59
def setup(app):
610
app.add_config_value(
@@ -19,7 +23,9 @@ def setup(app):
1923
for listener in app.events.listeners['build-finished']:
2024
if listener.handler.__name__ == 'create_sitemap':
2125
app.disconnect(listener.id)
22-
26+
27+
app.connect("builder-inited", record_builder_type)
28+
app.connect("html-page-context", add_html_link)
2329
app.connect('build-finished', create_sitemap)
2430
return setup
2531

@@ -30,11 +36,15 @@ def create_sitemap(app, exception):
3036
urlset = app.builder.config.ov_sitemap_urlset
3137
meta = app.builder.config.ov_sitemap_meta
3238

33-
site_url = app.builder.config.site_url
34-
site_url = site_url.rstrip('/') + '/'
35-
if not site_url:
36-
print("sphinx-sitemap error: no site_url"
37-
"are set in conf.py. Sitemap not built.")
39+
site_url = app.builder.config.site_url or app.builder.config.html_baseurl
40+
if site_url:
41+
site_url.rstrip("/") + "/"
42+
else:
43+
logger.warning(
44+
"sphinx-sitemap: html_baseurl is required in conf.py." "Sitemap not built.",
45+
type="sitemap",
46+
subtype="configuration",
47+
)
3848
return
3949
if (not app.sitemap_links):
4050
print("sphinx-sitemap warning: No pages generated for %s" %
@@ -51,7 +61,7 @@ def create_sitemap(app, exception):
5161
for item in urlset:
5262
root.set(*item)
5363

54-
get_locales(app, exception)
64+
locales = get_locales(app, exception)
5565

5666
if app.builder.config.version:
5767
version = app.builder.config.version + '/'
@@ -78,7 +88,7 @@ def create_sitemap(app, exception):
7888
ET.SubElement(namespace_element, tag_name).text = tag_value
7989

8090
if len(app.locales) > 0:
81-
for lang in app.locales:
91+
for lang in locales:
8292
lang = lang + '/'
8393
linktag = ET.SubElement(
8494
url,
@@ -90,10 +100,10 @@ def create_sitemap(app, exception):
90100
lang=lang, version=version, link=link
91101
))
92102

93-
filename = app.outdir + "/" + app.config.sitemap_filename
103+
filename = Path(app.outdir) / app.config.sitemap_filename
94104
ET.ElementTree(root).write(filename,
95105
xml_declaration=True,
96106
encoding='utf-8',
97107
method="xml")
98108
print("%s was generated for URL %s in %s" % (app.config.sitemap_filename,
99-
site_url, filename))
109+
site_url, filename))

0 commit comments

Comments
 (0)