Skip to content

Commit 6415cda

Browse files
Revathyvenugopal162pyansys-ci-botRobPasMue
authored
fix: raise exception for deprecated index pattern (#729)
Co-authored-by: pyansys-ci-bot <[email protected]> Co-authored-by: Roberto Pastor Muela <[email protected]>
1 parent 884e857 commit 6415cda

File tree

3 files changed

+9
-13
lines changed

3 files changed

+9
-13
lines changed

doc/changelog.d/729.fixed.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Raise exception for deprecated index pattern

src/ansys_sphinx_theme/search/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,12 @@ def update_search_config(app: Sphinx) -> None:
4040
theme_static_options["keys"] = ["title", "text", "objectID"]
4141
theme_static_options["threshold"] = theme_static_options.get("threshold", 0.2)
4242
theme_static_options["limit"] = theme_static_options.get("limit", 10)
43-
app.add_config_value("index_patterns", {}, "html")
4443
app.config.html_theme_options["static_search"] = theme_static_options
4544

45+
# TODO (RV): Deprecate this in release 0.16.0
46+
# https://github.com/ansys/ansys-sphinx-theme/issues/730
47+
app.add_config_value("index_patterns", {}, "html")
48+
4649

4750
__all__ = [
4851
"create_search_index",

src/ansys_sphinx_theme/search/fuse_search.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,16 @@ def create_search_index(app, exception):
194194
included_docs = app.env.found_docs
195195
filter_options = app.config.html_theme_options.get("search_filters", {})
196196

197+
# TODO (RV): Deprecate this in release 0.16.0
198+
# https://github.com/ansys/ansys-sphinx-theme/issues/730
197199
patterns = app.env.config.index_patterns or {}
198200
if patterns:
199-
logger.error(
200-
"The 'index_patterns' is depreciated and no longer supported. "
201+
raise TypeError(
202+
"The 'index_patterns' is deprecated and no longer supported. "
201203
"Please see the documentation https://sphinxdocs.ansys.com for the "
202204
"new search configuration options."
203205
)
204206

205-
patterns = app.env.config.index_patterns or {}
206-
if patterns:
207-
# Raise warning that this feature will deprecate in the future
208-
logger.warning(
209-
"The 'index_patterns' configuration option is deprecated and will be removed"
210-
" in v1.5.0 onwards. "
211-
"It will index all paragraphs, titles, and literals by default. "
212-
"More information can be found in the documentation at https://sphinxdocs.ansys.com.",
213-
)
214-
215207
for exclude_doc in excluded_docs:
216208
exclude_doc = Path(exclude_doc).resolve()
217209

0 commit comments

Comments
 (0)