diff --git a/Pipfile b/Pipfile index 6042b606..3bd09988 100644 --- a/Pipfile +++ b/Pipfile @@ -14,6 +14,8 @@ invenio-app-rdm = {version = "~=12.0.0b2.dev3", extras = ["opensearch2"]} invenio-logging = {extras = ["sentry_sdk"], version = "~=2.0"} zenodo_rdm = {editable="True", path="./site"} zenodo_legacy = {editable="True", path="./legacy"} +# TODO: Remove once we fix PyPI package issues +invenio-swh = {git = "https://github.com/inveniosoftware/invenio-swh", ref = "v0.2.1"} jsonschema = ">=4.17.0,<4.18.0" # due to compatibility issues with alpha ipython = "!=8.1.0" uwsgi = ">=2.0" diff --git a/Pipfile.lock b/Pipfile.lock index 71b4896e..865a71a0 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "6534efd6425e7531416cf9e5101db260ae6192e55e9a3f39bea02117bfb7950e" + "sha256": "672a3240847ed7155c99c0fbb3c7e5c83729ec93dd587d619a395b0a98afbebb" }, "pipfile-spec": 6, "requires": { @@ -890,6 +890,13 @@ "markers": "python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'", "version": "==1.1" }, + "httplib2": { + "hashes": [ + "sha256:8af66c1c52c7ffe1aa5dc4bcd7c769885254b0756e6e69f953c7f0ab49a70ba3", + "sha256:ca2914b015b6247791c4866782fa6042f495b94401a0f0bd3e1d6e0ba2236782" + ], + "version": "==0.18.1" + }, "humanize": { "hashes": [ "sha256:582a265c931c683a7e9b8ed9559089dea7edcf6cc95be39a3cbc2c5d5ac2bcfa", @@ -1058,10 +1065,6 @@ "version": "==1.0.3" }, "invenio-db": { - "extras": [ - "mysql", - "postgresql" - ], "hashes": [ "sha256:c02120e22d22498fcd23c3761a1d160c177261c760c38ccfddb4d671fcb7ddef", "sha256:cbbe6d53678a04e21afd8220498a9ddde041bf5c7afd66df00fb46907b109c13" @@ -1209,11 +1212,11 @@ }, "invenio-rdm-records": { "hashes": [ - "sha256:cadcad033d279c021201cb90785849fb418765596aaae795c3d668447545e4cb", - "sha256:dfc6ade79a3f63273ab78b21158df16087d53de3d3c3788d2a145407ee200731" + "sha256:4834c0c337757130dc0143f671c274d0e5cfde596d33900e4ba1d5cd3a647f01", + "sha256:a62e9817e0fb8fc97752d09c68bcca89aea4b285c10fef410d5d37d4eb33d4b5" ], "markers": "python_version >= '3.7'", - "version": "==4.41.0" + "version": "==4.42.0" }, "invenio-records": { "hashes": [ @@ -1303,6 +1306,10 @@ "markers": "python_version >= '3.7'", "version": "==4.0.1" }, + "invenio-swh": { + "git": "https://github.com/inveniosoftware/invenio-swh", + "ref": "a04c8473c27ce4ade9351c49f63bfc2292d11658" + }, "invenio-theme": { "hashes": [ "sha256:020eba28f19238d55c73116bc89f0dcd7a4027407c612c025a6b62eacd1ea9ef", @@ -2943,6 +2950,14 @@ ], "version": "==0.6.3" }, + "sword2": { + "hashes": [ + "sha256:720f171ff13ff69baef682f753b8636b074469c38441dfaedaa08de1d4f419ec", + "sha256:ae8a7165b2c0389cc1aa4ad75a4ca866c232e4506e6a4b7dd50b81082049c89f" + ], + "markers": "python_version >= '3.7'", + "version": "==0.3" + }, "text-unidecode": { "hashes": [ "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8", diff --git a/site/setup.cfg b/site/setup.cfg index 71ed4c2b..ad7eb426 100644 --- a/site/setup.cfg +++ b/site/setup.cfg @@ -23,7 +23,8 @@ install_requires = nameparser>=1.1.1 pyinstrument>=4.5.1 sqltap>=0.3.11 - invenio_swh>=0.20.0,<1.0.0 + # TODO: Add once we fix PyPI package issues + # invenio-swh>=0.2.0,<1.0.0 [options.extras_require] tests = diff --git a/site/zenodo_rdm/custom_fields.py b/site/zenodo_rdm/custom_fields.py index d47439dd..16938fb6 100644 --- a/site/zenodo_rdm/custom_fields.py +++ b/site/zenodo_rdm/custom_fields.py @@ -117,7 +117,7 @@ def field(self): "obo": "http://purl.obolibrary.org/obo/", "dc": "http://purl.org/dc/terms/", "legacy": "", - **CODEMETA_NAMESPACE, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) + **CODEMETA_NAMESPACE, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) **JOURNAL_NAMESPACE, **MEETING_NAMESPACE, **IMPRINT_NAMESPACE, @@ -182,7 +182,7 @@ def field(self): # obo RelationshipListCF(name="obo:RO_0002453"), # codemeta, - *CODEMETA_CUSTOM_FIELDS, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) + *CODEMETA_CUSTOM_FIELDS, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) # journal *JOURNAL_CUSTOM_FIELDS, # meeting @@ -522,7 +522,7 @@ def field(self): # zenodo custom fields ZENODO_CUSTOM_FIELDS_UI, # codemeta - CODEMETA_CUSTOM_FIELDS_UI, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) + CODEMETA_CUSTOM_FIELDS_UI, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) # publishing information { "section": _("Publishing information"), @@ -543,5 +543,5 @@ def field(self): # Custom fields facets CUSTOM_FIELDS_FACETS = { - **CODEMETA_FACETS, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) + **CODEMETA_FACETS, # TODO enable when fixed (see https://github.com/zenodo/rdm-project/issues/217) } diff --git a/site/zenodo_rdm/utils.py b/site/zenodo_rdm/utils.py index bd4077ff..1098f7b3 100644 --- a/site/zenodo_rdm/utils.py +++ b/site/zenodo_rdm/utils.py @@ -12,11 +12,10 @@ import idutils from flask import current_app, url_for from invenio_app_rdm.records_ui.utils import dump_external_resource +from invenio_i18n import _ from invenio_rdm_records.proxies import current_rdm_records_service as service from invenio_swh.proxies import current_swh_service as service_swh -from invenio_i18n import _ - from zenodo_rdm.openaire.utils import openaire_link @@ -137,7 +136,6 @@ def openaire_link_render(record): def swh_link_render(record): """Render the swh link.""" - if not current_app.config.get("SWH_ENABLED"): return None