global: migrate to v10

This commit is contained in:
Mojib Wali
2022-10-13 11:12:14 +02:00
committed by GitHub
parent 4a8b02ec4a
commit 62256b346f
5 changed files with 13 additions and 12 deletions

View File

@@ -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 }}

View File

@@ -15,7 +15,6 @@ encoding = utf-8
[jinja2: **/templates/**.*]
encoding = utf-8
extensions = jinja2.ext.autoescape, jinja2.ext.with_
# Extraction from JavaScript files

View File

@@ -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:

View File

@@ -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."""

View File

@@ -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 =