From 97a2f2f93a527eebf597ed56e17d730a480391e4 Mon Sep 17 00:00:00 2001 From: Peter Weber Date: Thu, 17 Feb 2022 15:37:35 +0100 Subject: [PATCH] module: invenio-record-resources * Updates `invenio-record-resources` from version v.0.12.5 to v0.16.14. Versions greater then 17 are not working for `invenio 3.4`. * Adds `--port` parameter to `server` script. Co-Authored-by: Peter Weber --- poetry.lock | 239 +++++++++------------ pyproject.toml | 8 +- scripts/server | 22 +- sonar/dedicated/hepvs/projects/resource.py | 37 ++-- sonar/ext.py | 6 +- sonar/resources/projects/resource.py | 17 +- sonar/resources/projects/service.py | 4 +- sonar/resources/service.py | 5 - 8 files changed, 163 insertions(+), 175 deletions(-) diff --git a/poetry.lock b/poetry.lock index 93bc9274e..c50c4725c 100644 --- a/poetry.lock +++ b/poetry.lock @@ -994,10 +994,10 @@ description = "Flask Resources module to create REST APIs." name = "flask-resources" optional = false python-versions = "*" -version = "0.6.0" +version = "0.7.3" [package.dependencies] -Flask = ">=1.1.2,<1.2.0" +Flask = ">=1.1.4,<2.0.0" marshmallow = ">=3.0,<4.0" speaklater = ">=1.3,<2.0" @@ -1357,7 +1357,7 @@ optional = true version = ">=1.2.5,<1.3.0" [package.dependencies.invenio-db] -extras = ["versioning", "postgresql"] +extras = ["postgresql", "versioning"] optional = true version = ">=1.0.8,<1.1.0" @@ -1650,14 +1650,6 @@ importlib-metadata = ">=4.4" importlib-resources = ">=5.0" invenio-base = ">=1.2.3" -[package.dependencies.SQLAlchemy-Continuum] -optional = true -version = ">=1.3.11" - -[package.dependencies.psycopg2-binary] -optional = true -version = ">=2.8.6" - [package.extras] all = ["Sphinx (4.2.0)", "pymysql (>=0.10.1)", "psycopg2-binary (>=2.8.6)", "SQLAlchemy-Continuum (>=1.3.11)", "pytest-invenio (>=1.4.0)", "cryptography (>=2.1.4)", "mock (>=4.0.0)"] docs = ["Sphinx (4.2.0)"] @@ -1806,14 +1798,15 @@ description = "Module providing logging capabilities." name = "invenio-logging" optional = false python-versions = "*" -version = "1.3.0" +version = "1.3.1" [package.dependencies] -invenio-base = ">=1.2.2" +invenio-base = ">=1.2.5" +invenio-db = ">=1.0.12" [package.dependencies.flask-celeryext] optional = true -version = ">=0.2.2" +version = ">=0.3.4" [package.dependencies.raven] extras = ["flask"] @@ -1823,14 +1816,14 @@ version = ">=6" [package.dependencies.sentry-sdk] extras = ["flask"] optional = true -version = ">=0.10.2" +version = ">=1.0.0" [package.extras] -all = ["Sphinx (>=1.5.1)", "check-manifest (>=0.25)", "coverage (>=4.0)", "flask-login (>=0.3.2,<0.5.0)", "httpretty (>=0.8.14)", "isort (>=4.2.2)", "mock (>=1.3.0)", "pydocstyle (>=1.0.0)", "pytest-cov (>=1.8.0)", "pytest-pep8 (>=1.0.6)", "pytest (>=2.8.0)", "raven (>=6)", "flask-celeryext (>=0.2.2)", "sentry-sdk (>=0.10.2)"] +all = ["Sphinx (>=1.5.1)", "flask-login (>=0.3.2,<0.5.0)", "httpretty (>=0.8.14)", "mock (>=1.3.0)", "pytest-invenio (>=1.4.2)", "iniconfig (>=1.1.1)", "raven (>=6)", "flask-celeryext (>=0.3.4)", "sentry-sdk (>=1.0.0)"] docs = ["Sphinx (>=1.5.1)"] -sentry = ["raven (>=6)", "flask-celeryext (>=0.2.2)"] -sentry-sdk = ["sentry-sdk (>=0.10.2)"] -tests = ["check-manifest (>=0.25)", "coverage (>=4.0)", "flask-login (>=0.3.2,<0.5.0)", "httpretty (>=0.8.14)", "isort (>=4.2.2)", "mock (>=1.3.0)", "pydocstyle (>=1.0.0)", "pytest-cov (>=1.8.0)", "pytest-pep8 (>=1.0.6)", "pytest (>=2.8.0)"] +sentry = ["raven (>=6)", "flask-celeryext (>=0.3.4)"] +sentry-sdk = ["sentry-sdk (>=1.0.0)"] +tests = ["flask-login (>=0.3.2,<0.5.0)", "httpretty (>=0.8.14)", "mock (>=1.3.0)", "pytest-invenio (>=1.4.2)", "iniconfig (>=1.1.1)"] [[package]] category = "main" @@ -2101,7 +2094,7 @@ description = "Permission policies for Invenio records." name = "invenio-records-permissions" optional = false python-versions = "*" -version = "0.11.0" +version = "0.12.1" [package.dependencies] invenio-access = ">=1.4.2,<2.0.0" @@ -2111,11 +2104,11 @@ invenio-records = ">=1.4.0" [package.extras] all = ["Sphinx (>=3)", "pytest-mock (>=1.6.0)", "pytest-invenio (>=1.4.1)", "invenio-accounts (>=1.4.3)", "invenio-app (>=1.3.0)"] docs = ["Sphinx (>=3)"] -elasticsearch6 = ["invenio-search (>=1.4.0,<2.0.0)"] -elasticsearch7 = ["invenio-search (>=1.4.0,<2.0.0)"] -mysql = ["invenio-db (>=1.0.5,<2.0.0)"] -postgresql = ["invenio-db (>=1.0.5,<2.0.0)"] -sqlite = ["invenio-db (>=1.0.5,<2.0.0)"] +elasticsearch6 = ["invenio-search (>=1.4.1,<2.0.0)"] +elasticsearch7 = ["invenio-search (>=1.4.1,<2.0.0)"] +mysql = ["invenio-db (>=1.0.9,<2.0.0)"] +postgresql = ["invenio-db (>=1.0.9,<2.0.0)"] +sqlite = ["invenio-db (>=1.0.9,<2.0.0)"] tests = ["pytest-mock (>=1.6.0)", "pytest-invenio (>=1.4.1)", "invenio-accounts (>=1.4.3)", "invenio-app (>=1.3.0)", "Sphinx (>=3)"] [[package]] @@ -2124,31 +2117,33 @@ description = "Invenio Resources module to create REST APIs." name = "invenio-records-resources" optional = false python-versions = "*" -version = "0.12.5" +version = "0.16.14" [package.dependencies] -flask-resources = ">=0.6.0,<0.7.0" -invenio-accounts = ">=1.4.3" -invenio-base = ">=1.2.3" +flask-resources = ">=0.7.3,<0.8.0" +invenio-accounts = ">=1.4.5" +invenio-base = ">=1.2.4" invenio-files-rest = ">=1.2.0" -invenio-i18n = ">=1.2.0" -invenio-indexer = ">=1.2.0" -invenio-jsonschemas = ">=1.1.0" +invenio-i18n = ">=1.3.0" +invenio-indexer = ">=1.2.1" +invenio-jsonschemas = ">=1.1.3" invenio-pidstore = ">=1.2.2" -invenio-records = ">=1.5.0a2" -invenio-records-permissions = ">=0.11.0,<0.12.0" -marshmallow-utils = ">=0.3.4,<0.4.0" +invenio-records = ">=1.5.0b1" +invenio-records-permissions = ">=0.12.1,<0.13.0" +luqum = ">=0.11.0" +marshmallow-utils = ">=0.5.2,<0.6.0" uritemplate = ">=3.0.1" +wand = ">=0.6.6,<0.7.0" xmltodict = ">=0.12.0,<0.13.0" [package.extras] -all = ["Sphinx (>=2.4,<3)", "invenio-db (>=1.0.5,<2.0.0)", "invenio-db (>=1.0.5,<2.0.0)", "invenio-db (>=1.0.5,<2.0.0)", "invenio-app (>=1.3.0)", "pytest-invenio (>=1.4.1)"] +all = ["Sphinx (>=2.4,<3)", "invenio-db (>=1.0.9,<2.0.0)", "invenio-db (>=1.0.9,<2.0.0)", "invenio-db (>=1.0.9,<2.0.0)", "invenio-app (>=1.3.0)", "pytest-invenio (>=1.4.1)"] docs = ["Sphinx (>=2.4,<3)"] -elasticsearch6 = ["invenio-search (>=1.4.1,<2.0.0)"] -elasticsearch7 = ["invenio-search (>=1.4.1,<2.0.0)"] -mysql = ["invenio-db (>=1.0.5,<2.0.0)"] -postgresql = ["invenio-db (>=1.0.5,<2.0.0)"] -sqlite = ["invenio-db (>=1.0.5,<2.0.0)"] +elasticsearch6 = ["invenio-search (>=1.4.2,<2.0.0)"] +elasticsearch7 = ["invenio-search (>=1.4.2,<2.0.0)"] +mysql = ["invenio-db (>=1.0.9,<2.0.0)"] +postgresql = ["invenio-db (>=1.0.9,<2.0.0)"] +sqlite = ["invenio-db (>=1.0.9,<2.0.0)"] tests = ["invenio-app (>=1.3.0)", "pytest-invenio (>=1.4.1)"] [[package]] @@ -2281,20 +2276,20 @@ description = "Invenio standard theme." name = "invenio-theme" optional = false python-versions = "*" -version = "1.3.13" +version = "1.3.16" [package.dependencies] Flask-Breadcrumbs = ">=0.4.0" Flask-Menu = ">=0.5.0" -invenio-assets = ">=1.2.2" -invenio-base = ">=1.2.3" -invenio-i18n = ">=1.2.0" -jsmin = ">=2.1.6" +invenio-assets = ">=1.2.7" +invenio-base = ">=1.2.5" +invenio-i18n = ">=1.3.1" +jsmin = ">=3.0.0" [package.extras] -all = ["Sphinx (>=1.5.1)", "pytest-invenio (>=1.4.0)"] -docs = ["Sphinx (>=1.5.1)"] -tests = ["pytest-invenio (>=1.4.0)"] +all = ["Sphinx (4.2.0)", "pytest-invenio (>=1.4.2)"] +docs = ["Sphinx (4.2.0)"] +tests = ["pytest-invenio (>=1.4.2)"] [[package]] category = "main" @@ -2603,13 +2598,24 @@ version = "1.6" [package.dependencies] six = ">=1.4.1" +[[package]] +category = "main" +description = "A Lucene query parser generating ElasticSearch queries and more !" +name = "luqum" +optional = false +python-versions = "*" +version = "0.11.0" + +[package.dependencies] +ply = ">=3.11" + [[package]] category = "main" description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." name = "lxml" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, != 3.4.*" -version = "4.7.1" +version = "4.8.0" [package.extras] cssselect = ["cssselect (>=0.7)"] @@ -2703,7 +2709,7 @@ description = "Extras and utilities for Marshmallow" name = "marshmallow-utils" optional = false python-versions = "*" -version = "0.3.10" +version = "0.5.4" [package.dependencies] arrow = ">=0.16.0" @@ -2720,8 +2726,8 @@ uritemplate = ">=3.0.1" werkzeug = ">=1.0.0" [package.extras] -all = ["Sphinx (>=3.0.0)", "check-manifest (>=0.42)", "coverage (>=5.2.1)", "pytest-cov (>=2.10.1)", "pytest-isort (>=1.2.0)", "pytest-pycodestyle (>=2.2.0)", "pytest-pydocstyle (>=2.2.0)", "pytest (>=6.0)"] -docs = ["Sphinx (>=3.0.0)"] +all = ["Sphinx (>=4.2.0)", "check-manifest (>=0.42)", "coverage (>=5.2.1)", "pytest-cov (>=2.10.1)", "pytest-isort (>=1.2.0)", "pytest-pycodestyle (>=2.2.0)", "pytest-pydocstyle (>=2.2.0)", "pytest (>=6.0)"] +docs = ["Sphinx (>=4.2.0)"] tests = ["check-manifest (>=0.42)", "coverage (>=5.2.1)", "pytest-cov (>=2.10.1)", "pytest-isort (>=1.2.0)", "pytest-pycodestyle (>=2.2.0)", "pytest-pydocstyle (>=2.2.0)", "pytest (>=6.0)"] [[package]] @@ -3012,6 +3018,14 @@ version = ">=0.12" [package.extras] dev = ["pre-commit", "tox"] +[[package]] +category = "main" +description = "Python Lex & Yacc" +name = "ply" +optional = false +python-versions = "*" +version = "3.11" + [[package]] category = "main" description = "A library to manipulate gettext files (po and mo files)." @@ -3332,11 +3346,11 @@ setuptools = "*" [[package]] category = "main" -description = "A Python Slugify application that handles Unicode" +description = "A Python slugify application that also handles Unicode" name = "python-slugify" optional = false -python-versions = ">=3.6" -version = "5.0.2" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +version = "6.0.1" [package.dependencies] text-unidecode = ">=1.3" @@ -3994,11 +4008,11 @@ description = "Ctypes-based simple MagickWand API binding for Python" name = "wand" optional = false python-versions = "*" -version = "0.5.9" +version = "0.6.7" [package.extras] -doc = ["Sphinx (>=1.0)"] -test = ["pytest (>=2.3.0)", "pytest-xdist (>=1.8)", "psutil (>=1.0.1)"] +doc = ["Sphinx (>=2.4.1)"] +test = ["pytest (>=5.3.5)"] [[package]] category = "main" @@ -4173,7 +4187,7 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] testing = ["pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] [metadata] -content-hash = "1fc85ed991e69334ca0260669a092268e988fbc35814f50c366441e7c0d75e01" +content-hash = "e46bc6205d0f83f78929e68f027d80da45ff59be5e215922724ec103a79a9122" lock-version = "1.0" python-versions = ">= 3.7, <3.10" @@ -4584,8 +4598,8 @@ flask-principal = [ {file = "Flask-Principal-0.4.0.tar.gz", hash = "sha256:f5d6134b5caebfdbb86f32d56d18ee44b080876a27269560a96ea35f75c99453"}, ] flask-resources = [ - {file = "flask-resources-0.6.0.tar.gz", hash = "sha256:ca29486e492b6638c6bb916b0bae00ae590f5e0db9030f90f020d55c7a87c43a"}, - {file = "flask_resources-0.6.0-py2.py3-none-any.whl", hash = "sha256:64f6b5c20f96075c1f6a965d0f7a1eda1961abbd854a2f78f30c73702aa801f0"}, + {file = "flask-resources-0.7.3.tar.gz", hash = "sha256:89e1744de549229b44517a0b7064a799035cb3933cb4330e731c7723aebc4926"}, + {file = "flask_resources-0.7.3-py2.py3-none-any.whl", hash = "sha256:0d4a85f2e9a02220c485604bacebdab836891162dfc417e96d4fb6d5369b3591"}, ] flask-restful = [ {file = "Flask-RESTful-0.3.9.tar.gz", hash = "sha256:ccec650b835d48192138c85329ae03735e6ced58e9b2d9c2146d6c84c06fa53e"}, @@ -4742,8 +4756,8 @@ invenio-jsonschemas = [ {file = "invenio_jsonschemas-1.1.3-py2.py3-none-any.whl", hash = "sha256:566249180cc2ccec93eb941b0121aa0159a2abfde3ead0b8dd72391afbd9ab9a"}, ] invenio-logging = [ - {file = "invenio-logging-1.3.0.tar.gz", hash = "sha256:fc2ccf7a3da8533cec4a87353a9c48d05dcc1fc9467c4314f6779bf088cb3cbc"}, - {file = "invenio_logging-1.3.0-py2.py3-none-any.whl", hash = "sha256:3b98778ade4b1a4887f827dbaa095473b5d43d6e39aa4da2ae311b7201a6ef9f"}, + {file = "invenio-logging-1.3.1.tar.gz", hash = "sha256:5910ed72bdec214ef14b254a9542017d60f0756838511c39a0c504c9e3a5d564"}, + {file = "invenio_logging-1.3.1-py2.py3-none-any.whl", hash = "sha256:0e0bc419d0f6296cde3bfa3c035bcfcd23ac80c4e8db3e748a91f81816092358"}, ] invenio-mail = [ {file = "invenio-mail-1.0.2.tar.gz", hash = "sha256:898952aa8984426074fd92b60bbe3ac67117cae0c724724aa63476416a7b7647"}, @@ -4780,12 +4794,12 @@ invenio-records-files = [ {file = "invenio_records_files-1.2.1-py2.py3-none-any.whl", hash = "sha256:46155d8a21b7b9ef7ba0665b824c35c86b44e06b940953990473c252a8d9e18b"}, ] invenio-records-permissions = [ - {file = "invenio-records-permissions-0.11.0.tar.gz", hash = "sha256:f8e4fb95aabadc39e07c9247ee33661a194d57e281478bf670be392128f603a7"}, - {file = "invenio_records_permissions-0.11.0-py2.py3-none-any.whl", hash = "sha256:0e069f303b8afbbaa96f347fcd2e83989d8678896abcae779ca1f70948b12b8c"}, + {file = "invenio-records-permissions-0.12.1.tar.gz", hash = "sha256:8926522cacf7777298adfddf9e701cac3c18d448ba5bdfca7bd6a6495de6aa3e"}, + {file = "invenio_records_permissions-0.12.1-py2.py3-none-any.whl", hash = "sha256:ac14c264b663db58ab9f8069bc81d3f19e3f65861b4614afa98211386dc4dc6c"}, ] invenio-records-resources = [ - {file = "invenio-records-resources-0.12.5.tar.gz", hash = "sha256:5932c9cbb8c4ba94ae50dd40e1c0c34b7df3da19801fcd9a85fa023a8522251f"}, - {file = "invenio_records_resources-0.12.5-py2.py3-none-any.whl", hash = "sha256:d597941a0f55f3ef89139a96d6a114c5846a8dcb667eceb82d45579a6edcfa98"}, + {file = "invenio-records-resources-0.16.14.tar.gz", hash = "sha256:cdd94b553ca9c459a912dc6c4665c8026f9e5810382b84460f93464913b0865e"}, + {file = "invenio_records_resources-0.16.14-py2.py3-none-any.whl", hash = "sha256:389ad78177e09af6c8283c5a24312bf79b33905801dfede18f49e99ba4133d5d"}, ] invenio-records-rest = [ {file = "invenio-records-rest-1.8.0.tar.gz", hash = "sha256:70ba741f19f8c9a1ae14a700d82c632175e881fd786ffdc4692f2718482e8dd1"}, @@ -4808,8 +4822,8 @@ invenio-stats = [ {file = "invenio_stats-1.0.0a18-py2.py3-none-any.whl", hash = "sha256:91a377a1e5db8a43ebf52c15868550f336682beb16337f8052acfccb74a78f10"}, ] invenio-theme = [ - {file = "invenio-theme-1.3.13.tar.gz", hash = "sha256:e35f8ad7daef34bf5b5dfe935b1fe03fc0682fbe62b044674be46227c742423e"}, - {file = "invenio_theme-1.3.13-py2.py3-none-any.whl", hash = "sha256:2ea409805daee890fd3556c3c7ab1671bdbb07ef08b9d6b72f5d140615dc5f7e"}, + {file = "invenio-theme-1.3.16.tar.gz", hash = "sha256:e90c1f6d58bda5441daa1c5f999264dda403da19228ed25069fe8ed2e1e34efb"}, + {file = "invenio_theme-1.3.16-py2.py3-none-any.whl", hash = "sha256:207606bea70e6f897c7e95ddfb81c8c4ff7e2ed73334d5e91efbd747567d30c6"}, ] invenio-userprofiles = [ {file = "invenio-userprofiles-1.2.4.tar.gz", hash = "sha256:09817499c49a8437b55f2fa7e7d0107dd9c380571c0183e1747b79e6f9519d8d"}, @@ -4885,67 +4899,16 @@ limits = [ {file = "limits-1.6-py3-none-any.whl", hash = "sha256:12ae4449cf7daadee43edf4096acd9cb9f4bfdec3a995aa9fbd0f72b0b9af762"}, {file = "limits-1.6.tar.gz", hash = "sha256:6c0a57b42647f1141f5a7a0a8479b49e4367c24937a01bd9d4063a595c2dd48a"}, ] +luqum = [ + {file = "luqum-0.11.0-py3-none-any.whl", hash = "sha256:f7518558bcfd219771083fcca9c2c877c3ff621beb2f5197d569e14ec2c6fe6f"}, + {file = "luqum-0.11.0.linux-x86_64.tar.gz", hash = "sha256:2910a6d1eaba62a7fbaf3ea867b0da9b0d80739f87eb804906dc6bc4cbf6647f"}, +] lxml = [ - {file = "lxml-4.7.1-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:d546431636edb1d6a608b348dd58cc9841b81f4116745857b6cb9f8dadb2725f"}, - {file = "lxml-4.7.1-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6308062534323f0d3edb4e702a0e26a76ca9e0e23ff99be5d82750772df32a9e"}, - {file = "lxml-4.7.1-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:f76dbe44e31abf516114f6347a46fa4e7c2e8bceaa4b6f7ee3a0a03c8eba3c17"}, - {file = "lxml-4.7.1-cp27-cp27m-win32.whl", hash = "sha256:d5618d49de6ba63fe4510bdada62d06a8acfca0b4b5c904956c777d28382b419"}, - {file = "lxml-4.7.1-cp27-cp27m-win_amd64.whl", hash = "sha256:9393a05b126a7e187f3e38758255e0edf948a65b22c377414002d488221fdaa2"}, - {file = "lxml-4.7.1-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:50d3dba341f1e583265c1a808e897b4159208d814ab07530202b6036a4d86da5"}, - {file = "lxml-4.7.1-cp27-cp27mu-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:44f552e0da3c8ee3c28e2eb82b0b784200631687fc6a71277ea8ab0828780e7d"}, - {file = "lxml-4.7.1-cp310-cp310-macosx_10_14_x86_64.whl", hash = "sha256:e662c6266e3a275bdcb6bb049edc7cd77d0b0f7e119a53101d367c841afc66dc"}, - {file = "lxml-4.7.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:4c093c571bc3da9ebcd484e001ba18b8452903cd428c0bc926d9b0141bcb710e"}, - {file = "lxml-4.7.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:3e26ad9bc48d610bf6cc76c506b9e5ad9360ed7a945d9be3b5b2c8535a0145e3"}, - {file = "lxml-4.7.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a5f623aeaa24f71fce3177d7fee875371345eb9102b355b882243e33e04b7175"}, - {file = "lxml-4.7.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:7b5e2acefd33c259c4a2e157119c4373c8773cf6793e225006a1649672ab47a6"}, - {file = "lxml-4.7.1-cp310-cp310-win32.whl", hash = "sha256:67fa5f028e8a01e1d7944a9fb616d1d0510d5d38b0c41708310bd1bc45ae89f6"}, - {file = "lxml-4.7.1-cp310-cp310-win_amd64.whl", hash = "sha256:b1d381f58fcc3e63fcc0ea4f0a38335163883267f77e4c6e22d7a30877218a0e"}, - {file = "lxml-4.7.1-cp35-cp35m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:38d9759733aa04fb1697d717bfabbedb21398046bd07734be7cccc3d19ea8675"}, - {file = "lxml-4.7.1-cp35-cp35m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:dfd0d464f3d86a1460683cd742306d1138b4e99b79094f4e07e1ca85ee267fe7"}, - {file = "lxml-4.7.1-cp35-cp35m-win32.whl", hash = "sha256:534e946bce61fd162af02bad7bfd2daec1521b71d27238869c23a672146c34a5"}, - {file = "lxml-4.7.1-cp35-cp35m-win_amd64.whl", hash = "sha256:6ec829058785d028f467be70cd195cd0aaf1a763e4d09822584ede8c9eaa4b03"}, - {file = "lxml-4.7.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:ade74f5e3a0fd17df5782896ddca7ddb998845a5f7cd4b0be771e1ffc3b9aa5b"}, - {file = "lxml-4.7.1-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:41358bfd24425c1673f184d7c26c6ae91943fe51dfecc3603b5e08187b4bcc55"}, - {file = "lxml-4.7.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:6e56521538f19c4a6690f439fefed551f0b296bd785adc67c1777c348beb943d"}, - {file = "lxml-4.7.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5b0f782f0e03555c55e37d93d7a57454efe7495dab33ba0ccd2dbe25fc50f05d"}, - {file = "lxml-4.7.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:490712b91c65988012e866c411a40cc65b595929ececf75eeb4c79fcc3bc80a6"}, - {file = "lxml-4.7.1-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:34c22eb8c819d59cec4444d9eebe2e38b95d3dcdafe08965853f8799fd71161d"}, - {file = "lxml-4.7.1-cp36-cp36m-win32.whl", hash = "sha256:2a906c3890da6a63224d551c2967413b8790a6357a80bf6b257c9a7978c2c42d"}, - {file = "lxml-4.7.1-cp36-cp36m-win_amd64.whl", hash = "sha256:36b16fecb10246e599f178dd74f313cbdc9f41c56e77d52100d1361eed24f51a"}, - {file = "lxml-4.7.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:a5edc58d631170de90e50adc2cc0248083541affef82f8cd93bea458e4d96db8"}, - {file = "lxml-4.7.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:87c1b0496e8c87ec9db5383e30042357b4839b46c2d556abd49ec770ce2ad868"}, - {file = "lxml-4.7.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:0a5f0e4747f31cff87d1eb32a6000bde1e603107f632ef4666be0dc065889c7a"}, - {file = "lxml-4.7.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:bf6005708fc2e2c89a083f258b97709559a95f9a7a03e59f805dd23c93bc3986"}, - {file = "lxml-4.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fc15874816b9320581133ddc2096b644582ab870cf6a6ed63684433e7af4b0d3"}, - {file = "lxml-4.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:0b5e96e25e70917b28a5391c2ed3ffc6156513d3db0e1476c5253fcd50f7a944"}, - {file = "lxml-4.7.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:ec9027d0beb785a35aa9951d14e06d48cfbf876d8ff67519403a2522b181943b"}, - {file = "lxml-4.7.1-cp37-cp37m-win32.whl", hash = "sha256:9fbc0dee7ff5f15c4428775e6fa3ed20003140560ffa22b88326669d53b3c0f4"}, - {file = "lxml-4.7.1-cp37-cp37m-win_amd64.whl", hash = "sha256:1104a8d47967a414a436007c52f533e933e5d52574cab407b1e49a4e9b5ddbd1"}, - {file = "lxml-4.7.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:fc9fb11b65e7bc49f7f75aaba1b700f7181d95d4e151cf2f24d51bfd14410b77"}, - {file = "lxml-4.7.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:317bd63870b4d875af3c1be1b19202de34c32623609ec803b81c99193a788c1e"}, - {file = "lxml-4.7.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:610807cea990fd545b1559466971649e69302c8a9472cefe1d6d48a1dee97440"}, - {file = "lxml-4.7.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:09b738360af8cb2da275998a8bf79517a71225b0de41ab47339c2beebfff025f"}, - {file = "lxml-4.7.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:6a2ab9d089324d77bb81745b01f4aeffe4094306d939e92ba5e71e9a6b99b71e"}, - {file = "lxml-4.7.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:eed394099a7792834f0cb4a8f615319152b9d801444c1c9e1b1a2c36d2239f9e"}, - {file = "lxml-4.7.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:735e3b4ce9c0616e85f302f109bdc6e425ba1670a73f962c9f6b98a6d51b77c9"}, - {file = "lxml-4.7.1-cp38-cp38-win32.whl", hash = "sha256:772057fba283c095db8c8ecde4634717a35c47061d24f889468dc67190327bcd"}, - {file = "lxml-4.7.1-cp38-cp38-win_amd64.whl", hash = "sha256:13dbb5c7e8f3b6a2cf6e10b0948cacb2f4c9eb05029fe31c60592d08ac63180d"}, - {file = "lxml-4.7.1-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:718d7208b9c2d86aaf0294d9381a6acb0158b5ff0f3515902751404e318e02c9"}, - {file = "lxml-4.7.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:5bee1b0cbfdb87686a7fb0e46f1d8bd34d52d6932c0723a86de1cc532b1aa489"}, - {file = "lxml-4.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl", hash = "sha256:e410cf3a2272d0a85526d700782a2fa92c1e304fdcc519ba74ac80b8297adf36"}, - {file = "lxml-4.7.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:585ea241ee4961dc18a95e2f5581dbc26285fcf330e007459688096f76be8c42"}, - {file = "lxml-4.7.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:a555e06566c6dc167fbcd0ad507ff05fd9328502aefc963cb0a0547cfe7f00db"}, - {file = "lxml-4.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:adaab25be351fff0d8a691c4f09153647804d09a87a4e4ea2c3f9fe9e8651851"}, - {file = "lxml-4.7.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:82d16a64236970cb93c8d63ad18c5b9f138a704331e4b916b2737ddfad14e0c4"}, - {file = "lxml-4.7.1-cp39-cp39-win32.whl", hash = "sha256:59e7da839a1238807226f7143c68a479dee09244d1b3cf8c134f2fce777d12d0"}, - {file = "lxml-4.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:a1bbc4efa99ed1310b5009ce7f3a1784698082ed2c1ef3895332f5df9b3b92c2"}, - {file = "lxml-4.7.1-pp37-pypy37_pp73-macosx_10_14_x86_64.whl", hash = "sha256:0607ff0988ad7e173e5ddf7bf55ee65534bd18a5461183c33e8e41a59e89edf4"}, - {file = "lxml-4.7.1-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:6c198bfc169419c09b85ab10cb0f572744e686f40d1e7f4ed09061284fc1303f"}, - {file = "lxml-4.7.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:a58d78653ae422df6837dd4ca0036610b8cb4962b5cfdbd337b7b24de9e5f98a"}, - {file = "lxml-4.7.1-pp38-pypy38_pp73-macosx_10_14_x86_64.whl", hash = "sha256:e18281a7d80d76b66a9f9e68a98cf7e1d153182772400d9a9ce855264d7d0ce7"}, - {file = "lxml-4.7.1-pp38-pypy38_pp73-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_24_i686.whl", hash = "sha256:8e54945dd2eeb50925500957c7c579df3cd07c29db7810b83cf30495d79af267"}, - {file = "lxml-4.7.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl", hash = "sha256:447d5009d6b5447b2f237395d0018901dcc673f7d9f82ba26c1b9f9c3b444b60"}, - {file = "lxml-4.7.1.tar.gz", hash = "sha256:a1613838aa6b89af4ba10a0f3a972836128801ed008078f8c1244e65958f1b24"}, + {file = "lxml-4.8.0-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:e1ab2fac607842ac36864e358c42feb0960ae62c34aa4caaf12ada0a1fb5d99b"}, + {file = "lxml-4.8.0-cp27-cp27m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:28d1af847786f68bec57961f31221125c29d6f52d9187c01cd34dc14e2b29430"}, + {file = "lxml-4.8.0-cp27-cp27m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b92d40121dcbd74831b690a75533da703750f7041b4bf951befc657c37e5695a"}, + {file = "lxml-4.8.0-cp27-cp27mu-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1010042bfcac2b2dc6098260a2ed022968dbdfaf285fc65a3acf8e4eb1ffd1bc"}, + {file = "lxml-4.8.0.tar.gz", hash = "sha256:f63f62fc60e6228a4ca9abae28228f35e1bd3ce675013d1dfb828688d50c6e23"}, ] mako = [ {file = "Mako-1.1.6-py2.py3-none-any.whl", hash = "sha256:afaf8e515d075b22fad7d7b8b30e4a1c90624ff2f3733a06ec125f5a5f043a57"}, @@ -5004,8 +4967,8 @@ marshmallow-oneofschema = [ {file = "marshmallow_oneofschema-3.0.1-py2.py3-none-any.whl", hash = "sha256:bd29410a9f2f7457a2b428286e2a80ef76b8ddc3701527dc1f935a88914b02f2"}, ] marshmallow-utils = [ - {file = "marshmallow-utils-0.3.10.tar.gz", hash = "sha256:2f32e4b12f0a74fb3dcb24b11f464bb70ba24d4a10d95d606206771629b79274"}, - {file = "marshmallow_utils-0.3.10-py2.py3-none-any.whl", hash = "sha256:50c74cd89f2d2a977b7c122009c35de2fef65db733cdaf3720340e6d61861710"}, + {file = "marshmallow-utils-0.5.4.tar.gz", hash = "sha256:25d4c9b063b62107a643d21205f7f00bec07bb6ef683225ae8e5cc8b44a22a43"}, + {file = "marshmallow_utils-0.5.4-py2.py3-none-any.whl", hash = "sha256:7bf53458d554bcdcd8d21e2dd429a5913039c7256873723c1c6fdb48e57a5214"}, ] matplotlib-inline = [ {file = "matplotlib-inline-0.1.3.tar.gz", hash = "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee"}, @@ -5157,6 +5120,10 @@ pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, ] +ply = [ + {file = "ply-3.11-py2.py3-none-any.whl", hash = "sha256:096f9b8350b65ebd2fd1346b12452efe5b9607f7482813ffca50c22722a807ce"}, + {file = "ply-3.11.tar.gz", hash = "sha256:00c7c1aaa88358b9c765b6d3000c6eec0ba42abca5351b095321aef446081da3"}, +] polib = [ {file = "polib-1.1.1-py2.py3-none-any.whl", hash = "sha256:d3ee85e0c6788f789353416b1612c6c92d75fe6ccfac0029711974d6abd0f86d"}, {file = "polib-1.1.1.tar.gz", hash = "sha256:e02c355ae5e054912e3b0d16febc56510eff7e49d60bf22aecb463bd2f2a2dfa"}, @@ -5331,8 +5298,8 @@ python-levenshtein = [ {file = "python-Levenshtein-0.12.2.tar.gz", hash = "sha256:dc2395fbd148a1ab31090dd113c366695934b9e85fe5a4b2a032745efd0346f6"}, ] python-slugify = [ - {file = "python-slugify-5.0.2.tar.gz", hash = "sha256:f13383a0b9fcbe649a1892b9c8eb4f8eab1d6d84b84bb7a624317afa98159cab"}, - {file = "python_slugify-5.0.2-py2.py3-none-any.whl", hash = "sha256:6d8c5df75cd4a7c3a2d21e257633de53f52ab0265cd2d1dc62a730e8194a7380"}, + {file = "python-slugify-6.0.1.tar.gz", hash = "sha256:ba72aa9d9f0514c0c3dd4430442f698ccc27a24d19630473663a71e3ec606bc1"}, + {file = "python_slugify-6.0.1-py2.py3-none-any.whl", hash = "sha256:89eec682c5180ba64811c9906a28184bbcc0a35792ba1bda3b5c2ab0cb2d0f67"}, ] python3-saml = [ {file = "python3-saml-1.12.0.tar.gz", hash = "sha256:f1e57ecdbb29c9ac80f338cc3ec2597a9e46667d237bae889ba53ac1787ed82b"}, @@ -5715,8 +5682,8 @@ vine = [ {file = "vine-5.0.0.tar.gz", hash = "sha256:7d3b1624a953da82ef63462013bbd271d3eb75751489f9807598e8f340bd637e"}, ] wand = [ - {file = "Wand-0.5.9-py2.py3-none-any.whl", hash = "sha256:598e13e46779e48fcecba7b37fd9d61fcdd1e70007ccba5d5b2e731186a2ec2e"}, - {file = "Wand-0.5.9.tar.gz", hash = "sha256:6eaca78e53fbe329b163f0f0b28f104de98edbd69a847268cc5d6a6e392b9b28"}, + {file = "Wand-0.6.7-py2.py3-none-any.whl", hash = "sha256:5ba497e90741a05ebce4603b04ee843150c566482a753554da54dc57d8503bba"}, + {file = "Wand-0.6.7.tar.gz", hash = "sha256:ebc01bccc25dba68414ab55b482341f9ad2b197d7f49d5e724f339bbf63fb6db"}, ] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, diff --git a/pyproject.toml b/pyproject.toml index 6b29b7e35..88cc159e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,9 +20,9 @@ invenio-pidstore = ">=1.2.1,<1.3.0" invenio-records-rest = ">=1.8.0,<1.9.0" invenio-records-ui= ">=1.2.0,<1.3.0" invenio-records = "<=1.6.0" -invenio-stats = "^1.0.0-alpha.18" +invenio-stats = "^1.0.0a18" # TODO: update invenio-records-resources -invenio-records-resources = "==0.12.5" +invenio-records-resources = "<0.17.0" invenio = {version = ">=3.4.0,<3.5.0", extras = ["base", "files", "postgresql", "auth", "elasticsearch7", "docs", "tests"]} uwsgi = ">=2.0" @@ -37,7 +37,7 @@ pycountry = "*" flask-wiki = {git = "https://github.com/rero/flask-wiki.git"} markdown-captions = "*" bleach = ">3.11" -wand = ">=0.5.0,<0.6.0" +wand = ">=0.6.6,<0.7.0" python-dotenv = "*" flask-cors = ">3.0.8" cryptography = ">=3.2" @@ -58,6 +58,8 @@ wtforms = "<3.0.0" flask-wtf = "<1.0.0" zipp = "*" pycparser = "*" +sqlalchemy_continuum = "<2.0.0" +psycopg2-binary = "<3.0.0" [tool.poetry.dev-dependencies] Flask-Debugtoolbar = ">=0.10.1" diff --git a/scripts/server b/scripts/server index 1b7ceb750..3e43c5dab 100755 --- a/scripts/server +++ b/scripts/server @@ -19,6 +19,7 @@ source $(dirname "$0")/functions set -e +PORT=5000 # Poetry is a mandatory condition to launch this program! if [[ -z "${VIRTUAL_ENV}" ]]; then @@ -26,6 +27,23 @@ if [[ -z "${VIRTUAL_ENV}" ]]; then exit 1 fi +if ! options=$(getopt -o p: port: -- "$@") +then + # something went wrong, getopt will put out an error message for us + exit 1 +fi + +while [ $# -gt 0 ] +do + case $1 in + -p|--port) PORT=$2; shift;; + (--) shift; break;; + (-*) error_msg+exit "$0: Unrecognized option $1";; + esac + shift +done + + title "Start web server and celery" script_path=$(dirname "$0") @@ -41,7 +59,9 @@ message "Done" "success" section "Start web server" "info" invenio run \ --cert "$script_path"/../docker/nginx/test.crt \ - --key "$script_path"/../docker/nginx/test.key & pid_server=$! + --key "$script_path"/../docker/nginx/test.key \ + -p $PORT & pid_server=$! + message "Done" "success" trap 'kill $pid_celery $pid_server &>/dev/null' EXIT diff --git a/sonar/dedicated/hepvs/projects/resource.py b/sonar/dedicated/hepvs/projects/resource.py index 9b3f0899d..693a22efc 100644 --- a/sonar/dedicated/hepvs/projects/resource.py +++ b/sonar/dedicated/hepvs/projects/resource.py @@ -17,10 +17,11 @@ """HEP Valais Projects resource.""" +from flask_resources import ResponseHandler from flask_resources.serializers import JSONSerializer from invenio_records_resources.resources import \ RecordResourceConfig as BaseRecordResourceConfig -from invenio_records_resources.resources.records.response import RecordResponse +from invenio_records_resources.resources.records.headers import etag_headers from sonar.dedicated.hepvs.projects.serializers.csv import CSVSerializer from sonar.resources.projects.resource import \ @@ -32,21 +33,21 @@ class RecordResourceConfig(BaseRecordResourceConfig): """HEP Valais Projects resource configuration.""" response_handlers = { - 'application/json': - RecordResponse(JSONSerializer()), - 'text/csv': - StreamResponse(CSVSerializer(csv_included_fields=[ - 'pid', 'name', 'approvalDate', 'projectSponsor', 'statusHep', - 'mainTeam', 'innerSearcher', 'secondaryTeam', 'externalPartners', - 'status', 'startDate', 'endDate', 'description', 'keywords', - 'realizationFramework', 'funding_funder_type', - 'funding_funder_name', 'funding_funder_number', - 'funding_fundingReceived', 'actorsInvolved', 'benefits', - 'impactOnFormation', 'impactOnProfessionalEnvironment', - 'impactOnPublicAction', 'promoteInnovation', - 'relatedToMandate_mandate', 'relatedToMandate_name', - 'relatedToMandate_briefDescription', 'educationalDocument', - 'searchResultsValorised' - ]), - filename='projects.csv') + 'application/json': ResponseHandler( + JSONSerializer(), headers=etag_headers), + 'text/csv': StreamResponse( + CSVSerializer(csv_included_fields=[ + 'pid', 'name', 'approvalDate', 'projectSponsor', 'statusHep', + 'mainTeam', 'innerSearcher', 'secondaryTeam', + 'externalPartners', 'status', 'startDate', 'endDate', + 'description', 'keywords', 'realizationFramework', + 'funding_funder_type', 'funding_funder_name', + 'funding_funder_number', 'funding_fundingReceived', + 'actorsInvolved', 'benefits', 'impactOnFormation', + 'impactOnProfessionalEnvironment', 'impactOnPublicAction', + 'promoteInnovation', 'relatedToMandate_mandate', + 'relatedToMandate_name', 'relatedToMandate_briefDescription', + 'educationalDocument', 'searchResultsValorised' + ]), + filename='projects.csv') } diff --git a/sonar/ext.py b/sonar/ext.py index 7435bcb75..4c0055dec 100644 --- a/sonar/ext.py +++ b/sonar/ext.py @@ -42,6 +42,8 @@ RecordResource as ProjectRecordResource from sonar.resources.projects.service import \ RecordService as ProjectRecordService +from sonar.resources.projects.service import \ + RecordServiceConfig as ProjectRecordServiceConfig from . import config_sonar from .route_converters import OrganisationCodeConverter @@ -175,7 +177,7 @@ def create_resources(self): """Create resources.""" # Initialize the project resource with the corresponding service. projects_resource = ProjectRecordResource( - service=ProjectRecordService()) + service=ProjectRecordService(config=ProjectRecordServiceConfig)) self.resources['projects'] = projects_resource def get_endpoints(self): @@ -211,7 +213,7 @@ def register_blueprints(self, app): """Register the blueprints.""" # Register REST endpoint for projects resource. app.register_blueprint( - self.resources['projects'].as_blueprint('projects')) + self.resources['projects'].as_blueprint()) @app.before_request def set_accept_mimetype(): diff --git a/sonar/resources/projects/resource.py b/sonar/resources/projects/resource.py index ab837f4cc..532ff7d66 100644 --- a/sonar/resources/projects/resource.py +++ b/sonar/resources/projects/resource.py @@ -17,10 +17,11 @@ """Projects resource.""" +from flask_resources import ResponseHandler from flask_resources.serializers import JSONSerializer from invenio_records_resources.resources import \ RecordResourceConfig as BaseRecordResourceConfig -from invenio_records_resources.resources.records.response import RecordResponse +from invenio_records_resources.resources.records.headers import etag_headers from sonar.resources.projects.serializers.csv import CSVSerializer from sonar.resources.resource import RecordResource as BaseRecordResource @@ -35,13 +36,13 @@ class RecordResourceConfig(BaseRecordResourceConfig): item_route = f'{list_route}/' response_handlers = { - 'application/json': - RecordResponse(JSONSerializer()), - 'text/csv': - StreamResponse(CSVSerializer(csv_included_fields=[ - 'pid', 'name', 'description', 'startDate', 'endDate' - ]), - filename='projects.csv') + 'application/json': ResponseHandler( + JSONSerializer(), headers=etag_headers), + 'text/csv': StreamResponse( + CSVSerializer(csv_included_fields=[ + 'pid', 'name', 'description', 'startDate', 'endDate' + ]), + filename='projects.csv') } diff --git a/sonar/resources/projects/service.py b/sonar/resources/projects/service.py index e6f12a27e..9cf164a3a 100644 --- a/sonar/resources/projects/service.py +++ b/sonar/resources/projects/service.py @@ -18,7 +18,7 @@ """Projects service.""" from invenio_records_resources.services.records.schema import \ - MarshmallowServiceSchema + ServiceSchemaWrapper from invenio_records_rest.utils import obj_or_import_string from sonar.config import DEFAULT_AGGREGATION_SIZE @@ -101,4 +101,4 @@ def schema(self): schema = obj_or_import_string(schema_path) - return MarshmallowServiceSchema(self, schema=schema) + return ServiceSchemaWrapper(self, schema=schema) diff --git a/sonar/resources/service.py b/sonar/resources/service.py index c1e352bf1..11695a060 100644 --- a/sonar/resources/service.py +++ b/sonar/resources/service.py @@ -24,15 +24,10 @@ from invenio_records_resources.services.records import \ RecordService as BaseRecordService -from .params import FilterParams - class RecordServiceConfig(BaseRecordServiceConfig): """Service factory configuration.""" - search_params_interpreters_cls = \ - [FilterParams] + BaseRecordServiceConfig.search_params_interpreters_cls - class RecordService(BaseRecordService): """SONAR resources base service class."""