Skip to content

Commit

Permalink
config: add GND to concepts and places
Browse files Browse the repository at this point in the history
* Adds GND to concepts and places.
* Dependencies updates.
* Adds safety ignore for sentry-sdk version 1.45.1.

Co-Authored-by: Peter Weber <[email protected]>
  • Loading branch information
rerowep committed Aug 26, 2024
1 parent 95116c0 commit c156c84
Show file tree
Hide file tree
Showing 9 changed files with 1,049 additions and 1,002 deletions.
1,989 changes: 1,019 additions & 970 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions rero_ils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3159,18 +3159,18 @@ def _(x):
},
'concepts': {
'base_url': os.environ.get('RERO_ILS_MEF_CONCEPTS_URL', 'https://mef.rero.ch/api/concepts'),
'sources': ['idref']
'sources': ['idref', 'gnd']
},
'concepts-genreForm': {
'concepts_genreForm': {
'base_url': os.environ.get('RERO_ILS_MEF_CONCEPTS_URL', 'https://mef.rero.ch/api/concepts'),
'sources': ['idref'],
'sources': ['idref', 'gnd'],
'filters': [
{'idref.bnf_type': 'genre/forme Rameau'}
]
},
'places': {
'base_url': os.environ.get('RERO_ILS_MEF_PLACES_URL', 'https://mef.rero.ch/api/places'),
'sources': ['idref']
'sources': ['idref', 'gnd']
},
}
RERO_ILS_ENTITY_TYPES = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"options": [
{
"label": "Genre, form",
"value": "concepts-genreForm"
"value": "concepts_genreForm"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion rero_ils/modules/entities/local_entities/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
'person': Q('term', type=EntityType.PERSON),
'organisation': Q('term', type=EntityType.ORGANISATION),
'concepts': Q('term', type=EntityType.TOPIC),
'concepts-genreForm':
'concepts_genreForm':
Q('term', type=EntityType.TOPIC) & Q('term', genreForm=True)
}

Expand Down
4 changes: 2 additions & 2 deletions rero_ils/modules/entities/remote_entities/proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def create_proxy(category):
'class': MefConceptsProxy,
'entities': (EntityType.TEMPORAL, )
},
'concepts-genreForm': {
'concepts_genreForm': {
'class': MefConceptsGenreFormProxy,
'entities': (EntityType.TOPIC,)
},
Expand Down Expand Up @@ -326,7 +326,7 @@ def _post_process_result_hit(self, hit):
class MefConceptsGenreFormProxy(MefConceptsProxy):
"""Proxy on RERO-MEF authority system for specific `genreForm` concepts."""

mef_entrypoint = 'concepts-genreForm'
mef_entrypoint = 'concepts_genreForm'


class MefPlacesProxy(MEFProxyMixin):
Expand Down
36 changes: 17 additions & 19 deletions scripts/test
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,30 @@ if [[ -z "${VIRTUAL_ENV}" ]]; then
fi

function pretests () {
# -> Vulnerability found in flask-caching version 2.3.0
# Vulnerability ID: 40459
# -> Vulnerability found in flask-caching version 2.0.1
# Vulnerability ID: 40459
# -> Vulnerability found in flask-cors version 4.0.1
# Vulnerability ID: 70624
# -> Vulnerability found in sqlalchemy version 1.4.53
# Vulnerability ID: 51668
# -> Vulnerability found in sqlalchemy-utils version 0.38.3
# Vulnerability ID: 42194
# Vulnerability ID: 42194
# -> Vulnerability found in wtforms version 2.3.3
# Vulnerability ID: 42852
# -> Vulnerability found in py version 1.11.0
# Vulnerability ID: 51457
# -> Vulnerability found in sqlalchemy version 1.4.52
# Vulnerability ID: 51668
# Vulnerability ID: 42852
# -> Vulnerability found in werkzeug version 2.2.3
# Vulnerability ID: 62019
# -> Vulnerability found in black version 22.12.0
# Vulnerability ID: 66742
# -> Vulnerability found in jinja2 version 3.1.4
# Vulnerability ID: 70612
# -> Vulnerability found in flask-cors version 4.0.1
# Vulnerability ID: 70624
# Vulnerability ID: 62019
# -> Vulnerability found in werkzeug version 2.2.3
# Vulnerability ID: 71594
# Vulnerability ID: 71595
# -> Vulnerability found in werkzeug version 2.2.3
# Vulnerability ID: 71595
# Vulnerability ID: 71594
# -> Vulnerability found in jinja2 version 3.1.4
# Vulnerability ID: 70612
# -> Vulnerability found in py version 1.11.0
# Vulnerability ID: 51457
# -> Vulnerability found in sentry-sdk version 1.45.1
# Vulnerability ID: 72260
# Vulnerability ID: 72260
info_msg "Check vulnerabilities:"
safety_exceptions="-i 40459 -i 70624 -i 51668 -i 42194 -i 42852 -i 71594 -i 62019 -i 71595 -i 70612 -i 51457 -i 72260"
safety_exceptions="-i 40459 -i 70624 -i 51668 -i 42194 -i 42852 -i 62019 -i 71595 -i 71594 -i 70612 -i 51457 -i 72260"
msg=$(safety check -o text ${safety_exceptions}) || {
echo "Safety vulnerabilites found for packages:" $(safety check -o bare ${safety_exceptions})
echo "Run: \"safety check -o screen ${safety_exceptions} | grep -i vulnerability\" for more details"
Expand Down
6 changes: 3 additions & 3 deletions tests/api/entities/local_entities/test_local_entities_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def test_local_search_by_proxy(
"""Test local entity search proxy."""
response = client.get(url_for(
'api_local_entities.local_search_proxy',
entity_type='concepts-genreForm',
entity_type='concepts_genreForm',
term='personal',
size='dummy_qs_arg'
))
Expand All @@ -167,7 +167,7 @@ def test_local_search_by_proxy(

response = client.get(url_for(
'api_local_entities.local_search_proxy',
entity_type='concepts-genreForm',
entity_type='concepts_genreForm',
term='personal',
size='0'
))
Expand All @@ -176,7 +176,7 @@ def test_local_search_by_proxy(

response = client.get(url_for(
'api_local_entities.local_search_proxy',
entity_type='concepts-genreForm',
entity_type='concepts_genreForm',
term='dummy_key'
))
assert response.status_code == 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_remote_search_proxy(

response = client.get(url_for(
'api_remote_entities.remote_search_proxy',
entity_type='concepts-genreForm',
entity_type='concepts_genreForm',
term='side-car'
))
assert response.status_code == 200
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def app_config(app_config):
'base_url': 'https://mef.rero.ch/api/concepts',
'sources': ['idref']
},
'concepts-genreForm': {
'concepts_genreForm': {
'base_url': 'https://mef.rero.ch/api/concepts',
'sources': ['idref'],
'filters': [
Expand Down

0 comments on commit c156c84

Please sign in to comment.