diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index caa741c..7382ae4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,13 +23,13 @@ jobs: python-version: [3.8, 3.9] requirements-level: [pypi] db-service: [postgresql13] - search-service: [elasticsearch7] + search-service: [opensearch2] include: - db-service: postgresql13 DB_EXTRAS: "postgresql" - - search-service: elasticsearch7 - SEARCH_EXTRAS: "elasticsearch7" + - search-service: opensearch2 + SEARCH_EXTRAS: "opensearch2" env: DB: ${{ matrix.db-service }} diff --git a/babel.ini b/babel.ini index 3320fd8..a87405a 100644 --- a/babel.ini +++ b/babel.ini @@ -15,7 +15,6 @@ encoding = utf-8 [jinja2: **/templates/**.*] encoding = utf-8 -extensions = jinja2.ext.autoescape, jinja2.ext.with_ # Extraction from JavaScript files diff --git a/docs/conf.py b/docs/conf.py index d42896c..fa26a42 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -64,7 +64,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_config_tugraz/generators.py b/invenio_config_tugraz/generators.py index 62e9fe1..b9c3e56 100644 --- a/invenio_config_tugraz/generators.py +++ b/invenio_config_tugraz/generators.py @@ -151,10 +151,10 @@ The succinct encoding of the permissions for your instance gives you - great flexibility by defining your own actions, generators and policies """ -from elasticsearch_dsl.query import Q from flask import current_app, request from invenio_access.permissions import any_user from invenio_records_permissions.generators import Generator +from invenio_search.engine import dsl class RecordIp(Generator): @@ -208,10 +208,10 @@ class RecordIp(Generator): if not visible: # If user ip is not on the list, and If the record contains 'singleip' will not be seen - return ~Q("match", **{"access.access_right": "singleip"}) + return ~dsl.Q("match", **{"access.access_right": "singleip"}) # Lists all records - return Q("match_all") + return dsl.Q("match_all") def check_permission(self): """Check for User IP address in config variable.""" diff --git a/setup.cfg b/setup.cfg index 49ed0ed..15bc050 100644 --- a/setup.cfg +++ b/setup.cfg @@ -37,16 +37,18 @@ python_requires = >=3.8 zip_safe = False install_requires = # keep this dependencies identical to invenio-app-rdm - invenio-rdm-records>=0.35.16,<0.36.0 + invenio-rdm-records>=0.39.0,<0.40.0 invenio-cache>=1.1.1,<1.2.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 -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 =