From 19fada59407c563026af29afaea361f012cc3ad6 Mon Sep 17 00:00:00 2001 From: Mojib Wali <44528277+mb-wali@users.noreply.github.com> Date: Thu, 13 Oct 2022 11:32:22 +0200 Subject: [PATCH] global: migrate to v10 --- .github/workflows/tests.yml | 6 +++--- docs/conf.py | 2 +- invenio_theme_tugraz/search.py | 4 ++-- invenio_theme_tugraz/views.py | 2 +- setup.cfg | 14 ++++++++++---- 5 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1bfce6b..a41a831 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -31,10 +31,10 @@ jobs: python-version: [3.8, 3.9] requirements-level: [pypi] db-service: [postgresql13] - search-service: [elasticsearch7] + search-service: [opensearch2] include: - - search-service: elasticsearch7 - SEARCH_EXTRAS: "elasticsearch7" + - search-service: opensearch2 + SEARCH_EXTRAS: "opensearch2" env: DB: ${{ matrix.db-service }} diff --git a/docs/conf.py b/docs/conf.py index 640f403..dca30c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,7 @@ release = __version__ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: diff --git a/invenio_theme_tugraz/search.py b/invenio_theme_tugraz/search.py index 30ffd6b..a12d6ed 100644 --- a/invenio_theme_tugraz/search.py +++ b/invenio_theme_tugraz/search.py @@ -8,8 +8,8 @@ """Frontpage records.""" -from elasticsearch_dsl.query import Q from invenio_search.api import RecordsSearch +from invenio_search.engine import dsl class FrontpageRecordsSearch(RecordsSearch): @@ -19,7 +19,7 @@ class FrontpageRecordsSearch(RecordsSearch): """Default index and filter for frontpage search.""" index = "rdmrecords-records" - default_filter = Q( + default_filter = dsl.Q( "query_string", query=("access.record:public " "AND versions.is_latest:true"), ) diff --git a/invenio_theme_tugraz/views.py b/invenio_theme_tugraz/views.py index 8d1a49a..d7d88d4 100644 --- a/invenio_theme_tugraz/views.py +++ b/invenio_theme_tugraz/views.py @@ -10,9 +10,9 @@ from typing import Dict -from elasticsearch_dsl.utils import AttrDict from flask import Blueprint, render_template from invenio_rdm_records.resources.serializers import UIJSONSerializer +from opensearch_dsl.utils import AttrDict from .search import FrontpageRecordsSearch diff --git a/setup.cfg b/setup.cfg index ffb590e..5fbced4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -40,16 +40,18 @@ install_requires = Flask-WebpackExt>=1.0.0 invenio-assets>=1.2.7,<1.3.0 invenio-i18n>=1.3.1,<1.4.0 - invenio_config_tugraz>=0.9.0,<0.10.0 + invenio_config_tugraz>=0.10.0,<0.11.0 [options.extras_require] tests = pytest-black>=0.3.0,<0.3.10 - sphinx>=4.2.0,<5 + Sphinx>=4.5.0 pytest-invenio>=1.4.7 invenio-app>=1.3.0,<2.0.0 -elasticsearch7 = - invenio-search[elasticsearch7]>=1.4.2,<2.0 +# elasticsearch7 = +# invenio-search[elasticsearch7]>=2.1.0,<3.0.0 +opensearch2 = + invenio-search[opensearch2]>=2.1.0,<3.0.0 [options.entry_points] invenio_base.apps = @@ -98,6 +100,10 @@ output-dir = invenio_theme_tugraz/translations/ [isort] profile=black +[check-manifest] +ignore = + *-requirements.txt + [tool:pytest] addopts = --black --isort --pydocstyle --doctest-glob="*.rst" --doctest-modules --cov=invenio_theme_tugraz --cov-report=term-missing tests invenio_theme_tugraz testpaths = tests invenio_theme_tugraz