Replace snowballstemmer with a dummy implementation
This commit is contained in:
parent
854fb579d5
commit
f7638cfd4c
265
Patch-out-snowballstemmer.patch
Normal file
265
Patch-out-snowballstemmer.patch
Normal file
@ -0,0 +1,265 @@
|
||||
From ec721111162a24a960b8c725340e183f970d4a1c Mon Sep 17 00:00:00 2001
|
||||
From: Lumir Balhar <lbalhar@redhat.com>
|
||||
Date: Mon, 10 Jun 2024 16:53:08 +0200
|
||||
Subject: [PATCH] Patch-out snowballstemmer and replace it with a dummy
|
||||
implementation
|
||||
|
||||
---
|
||||
pyproject.toml | 1 -
|
||||
sphinx/search/da.py | 2 +-
|
||||
sphinx/search/de.py | 2 +-
|
||||
sphinx/search/dummystemmer.py | 8 ++++++++
|
||||
sphinx/search/en.py | 2 +-
|
||||
sphinx/search/es.py | 2 +-
|
||||
sphinx/search/fi.py | 2 +-
|
||||
sphinx/search/fr.py | 2 +-
|
||||
sphinx/search/hu.py | 2 +-
|
||||
sphinx/search/it.py | 2 +-
|
||||
sphinx/search/nl.py | 2 +-
|
||||
sphinx/search/no.py | 2 +-
|
||||
sphinx/search/pt.py | 2 +-
|
||||
sphinx/search/ro.py | 2 +-
|
||||
sphinx/search/ru.py | 2 +-
|
||||
sphinx/search/sv.py | 2 +-
|
||||
sphinx/search/tr.py | 2 +-
|
||||
sphinx/search/zh.py | 2 +-
|
||||
18 files changed, 24 insertions(+), 17 deletions(-)
|
||||
create mode 100644 sphinx/search/dummystemmer.py
|
||||
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 0d19435..32cf5bf 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -58,7 +58,6 @@ dependencies = [
|
||||
"Jinja2>=3.0",
|
||||
"Pygments>=2.14",
|
||||
"docutils>=0.18.1,<0.21",
|
||||
- "snowballstemmer>=2.0",
|
||||
"babel>=2.9",
|
||||
"alabaster>=0.7,<0.8",
|
||||
"imagesize>=1.3",
|
||||
diff --git a/sphinx/search/da.py b/sphinx/search/da.py
|
||||
index 9b5b9f5..0ff9a56 100644
|
||||
--- a/sphinx/search/da.py
|
||||
+++ b/sphinx/search/da.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/de.py b/sphinx/search/de.py
|
||||
index 1c253fd..76af961 100644
|
||||
--- a/sphinx/search/de.py
|
||||
+++ b/sphinx/search/de.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/dummystemmer.py b/sphinx/search/dummystemmer.py
|
||||
new file mode 100644
|
||||
index 0000000..46f8fb7
|
||||
--- /dev/null
|
||||
+++ b/sphinx/search/dummystemmer.py
|
||||
@@ -0,0 +1,8 @@
|
||||
+# Dummy stemmer implementation doing nothing
|
||||
+
|
||||
+class stemmer:
|
||||
+ def __init__(self, *args, **kwargs):
|
||||
+ pass
|
||||
+
|
||||
+ def stemWord(self, word):
|
||||
+ return word
|
||||
diff --git a/sphinx/search/en.py b/sphinx/search/en.py
|
||||
index caa6f66..1e3fbb8 100644
|
||||
--- a/sphinx/search/en.py
|
||||
+++ b/sphinx/search/en.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
diff --git a/sphinx/search/es.py b/sphinx/search/es.py
|
||||
index c5d9a5c..96956be 100644
|
||||
--- a/sphinx/search/es.py
|
||||
+++ b/sphinx/search/es.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/fi.py b/sphinx/search/fi.py
|
||||
index 70114f8..5de87ad 100644
|
||||
--- a/sphinx/search/fi.py
|
||||
+++ b/sphinx/search/fi.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/fr.py b/sphinx/search/fr.py
|
||||
index 01319dd..9b43d74 100644
|
||||
--- a/sphinx/search/fr.py
|
||||
+++ b/sphinx/search/fr.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/hu.py b/sphinx/search/hu.py
|
||||
index eed08db..4dde945 100644
|
||||
--- a/sphinx/search/hu.py
|
||||
+++ b/sphinx/search/hu.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/it.py b/sphinx/search/it.py
|
||||
index 7bf712b..9e44732 100644
|
||||
--- a/sphinx/search/it.py
|
||||
+++ b/sphinx/search/it.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/nl.py b/sphinx/search/nl.py
|
||||
index a610b12..f85bec7 100644
|
||||
--- a/sphinx/search/nl.py
|
||||
+++ b/sphinx/search/nl.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/no.py b/sphinx/search/no.py
|
||||
index a69380b..8f9be62 100644
|
||||
--- a/sphinx/search/no.py
|
||||
+++ b/sphinx/search/no.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/pt.py b/sphinx/search/pt.py
|
||||
index 908a417..ee266ef 100644
|
||||
--- a/sphinx/search/pt.py
|
||||
+++ b/sphinx/search/pt.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/ro.py b/sphinx/search/ro.py
|
||||
index b6c9d67..ee77c77 100644
|
||||
--- a/sphinx/search/ro.py
|
||||
+++ b/sphinx/search/ro.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict, Set
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
diff --git a/sphinx/search/ru.py b/sphinx/search/ru.py
|
||||
index b8412c1..bda63bd 100644
|
||||
--- a/sphinx/search/ru.py
|
||||
+++ b/sphinx/search/ru.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/sv.py b/sphinx/search/sv.py
|
||||
index 88cc560..52e4983 100644
|
||||
--- a/sphinx/search/sv.py
|
||||
+++ b/sphinx/search/sv.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage, parse_stop_word
|
||||
|
||||
diff --git a/sphinx/search/tr.py b/sphinx/search/tr.py
|
||||
index f4a865c..934fd41 100644
|
||||
--- a/sphinx/search/tr.py
|
||||
+++ b/sphinx/search/tr.py
|
||||
@@ -4,7 +4,7 @@ from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING, Dict, Set
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
diff --git a/sphinx/search/zh.py b/sphinx/search/zh.py
|
||||
index 2a3a6e7..e3ee9d0 100644
|
||||
--- a/sphinx/search/zh.py
|
||||
+++ b/sphinx/search/zh.py
|
||||
@@ -6,7 +6,7 @@ import os
|
||||
import re
|
||||
from typing import TYPE_CHECKING, Dict, List
|
||||
|
||||
-import snowballstemmer
|
||||
+from . import dummystemmer as snowballstemmer
|
||||
|
||||
from sphinx.search import SearchLanguage
|
||||
|
||||
--
|
||||
2.45.2
|
||||
|
@ -25,7 +25,7 @@ Name: python-sphinx
|
||||
#global prerel ...
|
||||
%global upstream_version %{general_version}%{?prerel}
|
||||
Version: %{general_version}%{?prerel:~%{prerel}}
|
||||
Release: 6%{?dist}
|
||||
Release: 7%{?dist}
|
||||
Epoch: 1
|
||||
Summary: Python documentation generator
|
||||
|
||||
@ -60,6 +60,10 @@ Patch: Make-the-first-party-extensions-optional.patch
|
||||
# Proposed upstream.
|
||||
Patch: https://github.com/sphinx-doc/sphinx/pull/11774.patch
|
||||
|
||||
# Downstream-only patch replacing snowballstemmer
|
||||
# with a dummy implementation doing nothing.
|
||||
Patch: Patch-out-snowballstemmer.patch
|
||||
|
||||
BuildArch: noarch
|
||||
|
||||
BuildRequires: make
|
||||
@ -365,6 +369,18 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
|
||||
# test_build_latex_doc needs internet to download pictures,
|
||||
# but fails also with it enabled, we decided to skip it entirely
|
||||
# In RHEL builds, skip tests which use html5lib (excluded above)
|
||||
# Without snowballstememr, some tests have to be skipped as well.
|
||||
k="${k-}${k+ and }not test_meta_keys_are_handled_for_language_en"
|
||||
k="${k-}${k+ and }not test_stemmer"
|
||||
k="${k-}${k+ and }not test_term_in_heading_and_section"
|
||||
k="${k-}${k+ and }not test_IndexBuilder"
|
||||
|
||||
%if %{without internet}
|
||||
k="${k-}${k+ and }not linkcheck"
|
||||
k="${k-}${k+ and }not test_latex_images"
|
||||
k="${k-}${k+ and }not test_build_latex_doc"
|
||||
%endif
|
||||
|
||||
%pytest \
|
||||
%if %{defined rhel}
|
||||
--ignore tests/test_build_html.py \
|
||||
@ -373,10 +389,7 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
|
||||
--ignore tests/test_domain_std.py \
|
||||
--ignore tests/test_smartquotes.py \
|
||||
%endif
|
||||
%if %{without internet}
|
||||
-k "not linkcheck and not test_latex_images and not test_build_latex_doc" \
|
||||
%endif
|
||||
;
|
||||
${k+-k }"${k-}"
|
||||
%endif
|
||||
|
||||
|
||||
@ -403,6 +416,9 @@ mkdir %{buildroot}%{python3_sitelib}/sphinxcontrib
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Jun 10 2024 Lumír Balhar <lbalhar@redhat.com> - 1:7.2.6-7
|
||||
- Replace snowballstemmer with a dummy implementation
|
||||
|
||||
* Wed Jan 24 2024 Karolina Surma <ksurma@redhat.com> - 1:7.2.6-6
|
||||
- Suppress traceback when importing the weakened sphinxcontrib* dependencies
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user