From e4cfb383f846bdec3aed14d9a0837f5d3f629156 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 5 Jan 2022 14:05:01 +0000 Subject: [PATCH 01/10] ci: use older version of `setuptools` to solve Python ICAT build issue --- .github/workflows/ci-build.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9a1cae61..09d48eda 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -76,6 +76,13 @@ jobs: run: pip install nox==2020.8.22 - name: Install Poetry run: pip install poetry==1.1.9 + + # Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99 + - name: Uninstall setuptools + run: poetry run pip uninstall -y setuptools + - name: Install older setuptools + run: poetry run pip install 'setuptools<58.0.0' + - name: Install dependencies run: poetry install @@ -207,6 +214,13 @@ jobs: run: cp datagateway_api/config.json.example datagateway_api/config.json - name: Install Poetry run: pip install poetry==1.1.9 + + # Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99 + - name: Uninstall setuptools + run: poetry run pip uninstall -y setuptools + - name: Install older setuptools + run: poetry run pip install 'setuptools<58.0.0' + - name: Install dependencies run: poetry install @@ -251,6 +265,13 @@ jobs: - name: Create config.json run: cp datagateway_api/config.json.example datagateway_api/config.json + + # Installing an older version of setuptools for reasons explained at: https://github.com/icatproject/python-icat/issues/99 + - name: Uninstall setuptools + run: poetry run pip uninstall -y setuptools + - name: Install older setuptools + run: poetry run pip install 'setuptools<58.0.0' + - name: Install dependencies run: poetry install From 2b66602cbeae0d74aff77df33f810ff1188fe579 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 5 Jan 2022 14:05:46 +0000 Subject: [PATCH 02/10] build: use older version of `setuptools` when running tests --- noxfile.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/noxfile.py b/noxfile.py index 4a97e124..60f2ddd6 100644 --- a/noxfile.py +++ b/noxfile.py @@ -85,5 +85,16 @@ def safety(session): @nox.session(python=["3.6", "3.7", "3.8", "3.9"], reuse_venv=True) def tests(session): args = session.posargs + # Installing setuptools that will work with `2to3` which is used when building + # `python-icat` < 1.0. 58.0.0 removes support of this tool during builds: + # https://setuptools.pypa.io/en/latest/history.html#v58-0-0 + # Ideally this would be done within `pyproject.toml` but specifying `setuptools` as + # a dependency requires Poetry 1.2: + # https://github.com/python-poetry/poetry/issues/4511#issuecomment-922420457 + # Currently, only a pre-release exists for Poetry 1.2. Testing on the pre-release + # version didn't fix the `2to3` issue when building Python ICAT, perhaps because + # Python ICAT isn't built on the downgraded version for some reason? + session.run("poetry", "run", "pip", "uninstall", "-y", "setuptools") + session.run("poetry", "run", "pip", "install", "setuptools<58.0.0") session.run("poetry", "install", external=True) session.run("pytest", *args) From c13c0db07a1a23a662d5ce32d7fb2f4709bc282d Mon Sep 17 00:00:00 2001 From: Matthew Richards <32678030+MRichards99@users.noreply.github.com> Date: Mon, 24 Jan 2022 16:56:05 +0000 Subject: [PATCH 03/10] refactor: update PaNOSC mappings Co-authored-by: Viktor Bozhinov <45173816+VKTB@users.noreply.github.com> --- datagateway_api/search_api_mapping.json.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datagateway_api/search_api_mapping.json.example b/datagateway_api/search_api_mapping.json.example index 57161585..f93c2a04 100644 --- a/datagateway_api/search_api_mapping.json.example +++ b/datagateway_api/search_api_mapping.json.example @@ -63,12 +63,12 @@ "affiliation": {"Affiliation": "user.dataPublicationUsers.affiliations"} }, "Parameter": { - "base_icat_entity": "InvestigationParameter", + "base_icat_entity": ["InvestigationParameter", "DatasetParameter"], "id": "id", - "name": "name", + "name": "type.name", "value": ["numericValue", "stringValue", "dateTimeValue"], "unit": "type.units", - "dataset": {"Dataset": "investigation.investigationInstruments.instrument.datasetInstruments.dataset"}, + "dataset": {"Dataset": ["investigation.investigationInstruments.instrument.datasetInstruments.dataset", "dataset"]}, "document": {"Document": "investigation"} }, "Person": { From 3802cc9ee71a355d0ad87529f65112e8c3f8b881 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Wed, 26 Jan 2022 12:38:09 +0000 Subject: [PATCH 04/10] fix: fix example mapping file --- datagateway_api/search_api_mapping.json.example | 1 - 1 file changed, 1 deletion(-) diff --git a/datagateway_api/search_api_mapping.json.example b/datagateway_api/search_api_mapping.json.example index ebef5f30..f93c2a04 100644 --- a/datagateway_api/search_api_mapping.json.example +++ b/datagateway_api/search_api_mapping.json.example @@ -71,7 +71,6 @@ "dataset": {"Dataset": ["investigation.investigationInstruments.instrument.datasetInstruments.dataset", "dataset"]}, "document": {"Document": "investigation"} }, - }, "Person": { "base_icat_entity": "User", "id": "id", From 8e472cff813cd2b5953824c763909dd904276321 Mon Sep 17 00:00:00 2001 From: Viktor Bozhinov Date: Fri, 28 Jan 2022 15:54:52 +0000 Subject: [PATCH 05/10] build: upgrade `python-icat` to 0.21.0 #305 --- poetry.lock | 67 +++++++++++++++++++++++++++----------------------- pyproject.toml | 2 +- 2 files changed, 37 insertions(+), 32 deletions(-) diff --git a/poetry.lock b/poetry.lock index 12bedca2..a7f7eafc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -18,12 +18,12 @@ optional = false python-versions = ">=3.5" [package.extras] -dev = ["PyYAML (>=3.10)", "prance[osv] (>=0.11)", "marshmallow (>=2.19.2)", "pytest", "mock", "flake8 (==3.7.9)", "flake8-bugbear (==20.1.4)", "pre-commit (>=1.20,<3.0)", "tox"] +tests = ["PyYAML (>=3.10)", "prance[osv] (>=0.11)", "marshmallow (>=2.19.2)", "pytest", "mock"] docs = ["marshmallow (>=2.19.2)", "pyyaml (==5.3)", "sphinx (==2.4.1)", "sphinx-issues (==1.2.0)", "sphinx-rtd-theme (==0.4.3)"] lint = ["flake8 (==3.7.9)", "flake8-bugbear (==20.1.4)", "pre-commit (>=1.20,<3.0)"] -tests = ["PyYAML (>=3.10)", "prance[osv] (>=0.11)", "marshmallow (>=2.19.2)", "pytest", "mock"] -validation = ["prance[osv] (>=0.11)"] +dev = ["PyYAML (>=3.10)", "prance[osv] (>=0.11)", "marshmallow (>=2.19.2)", "pytest", "mock", "flake8 (==3.7.9)", "flake8-bugbear (==20.1.4)", "pre-commit (>=1.20,<3.0)", "tox"] yaml = ["PyYAML (>=3.10)"] +validation = ["prance[osv] (>=0.11)"] [[package]] name = "appdirs" @@ -50,10 +50,10 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [package.extras] -dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] [[package]] name = "bandit" @@ -198,11 +198,11 @@ python-versions = ">=3.6" cffi = ">=1.12" [package.extras] -docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] -docstest = ["doc8", "pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"] pep8test = ["black", "flake8", "flake8-import-order", "pep8-naming"] +docstest = ["doc8", "pyenchant (>=1.6.11)", "twine (>=1.12.0)", "sphinxcontrib-spelling (>=4.0.1)"] sdist = ["setuptools_rust (>=0.11.4)"] ssh = ["bcrypt (>=3.1.5)"] +docs = ["sphinx (>=1.6.5,!=1.8.0,!=3.1.0,!=3.1.1)", "sphinx-rtd-theme"] test = ["pytest (>=6.2.0)", "pytest-cov", "pytest-subtests", "pytest-xdist", "pretend", "iso8601", "pytz", "hypothesis (>=1.11.4,!=3.79.2)"] [[package]] @@ -409,8 +409,8 @@ Jinja2 = ">=3.0" Werkzeug = ">=2.0" [package.extras] -async = ["asgiref (>=3.2)"] dotenv = ["python-dotenv"] +async = ["asgiref (>=3.2)"] [[package]] name = "flask-cors" @@ -528,8 +528,8 @@ zipp = ">=0.5" [package.extras] docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] -perf = ["ipython"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] +perf = ["ipython"] [[package]] name = "iniconfig" @@ -666,8 +666,8 @@ click = ">=7" six = "*" [package.extras] -coverage = ["pytest-cov"] testing = ["mock", "pytest", "pytest-rerunfailures"] +coverage = ["pytest-cov"] [[package]] name = "pkginfo" @@ -692,8 +692,8 @@ python-versions = ">=3.6" importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} [package.extras] -dev = ["pre-commit", "tox"] testing = ["pytest", "pytest-benchmark"] +dev = ["pre-commit", "tox"] [[package]] name = "pprintpp" @@ -862,12 +862,12 @@ requests = ">=2.25.0" requests-toolbelt = ">=0.9.1" [package.extras] -autocompletion = ["argcomplete (>=1.10.0,<2)"] yaml = ["PyYaml (>=5.2)"] +autocompletion = ["argcomplete (>=1.10.0,<2)"] [[package]] name = "python-icat" -version = "0.20.0" +version = "0.21.0" description = "Python interface to ICAT and IDS" category = "main" optional = false @@ -894,10 +894,10 @@ tomlkit = "0.7.0" twine = ">=3,<4" [package.extras] -dev = ["tox", "isort", "black"] +test = ["coverage (>=5,<6)", "pytest (>=5,<6)", "pytest-xdist (>=1,<2)", "pytest-mock (>=2,<3)", "responses (==0.13.3)", "mock (==1.3.0)"] docs = ["Sphinx (==1.3.6)"] mypy = ["mypy", "types-requests"] -test = ["coverage (>=5,<6)", "pytest (>=5,<6)", "pytest-xdist (>=1,<2)", "pytest-mock (>=2,<3)", "responses (==0.13.3)", "mock (==1.3.0)"] +dev = ["tox", "isort", "black"] [[package]] name = "pytz" @@ -962,8 +962,8 @@ idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} urllib3 = ">=1.21.1,<1.27" [package.extras] -socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] [[package]] name = "requests-toolbelt" @@ -1065,25 +1065,25 @@ greenlet = {version = "!=0.4.17", markers = "python_version >= \"3\" and (platfo importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [package.extras] -aiomysql = ["greenlet (!=0.4.17)", "aiomysql"] -aiosqlite = ["typing_extensions (!=3.10.0.1)", "greenlet (!=0.4.17)", "aiosqlite"] -asyncio = ["greenlet (!=0.4.17)"] -asyncmy = ["greenlet (!=0.4.17)", "asyncmy (>=0.2.3)"] -mariadb_connector = ["mariadb (>=1.0.1)"] mssql = ["pyodbc"] -mssql_pymssql = ["pymssql"] -mssql_pyodbc = ["pyodbc"] mypy = ["sqlalchemy2-stubs", "mypy (>=0.910)"] -mysql = ["mysqlclient (>=1.4.0,<2)", "mysqlclient (>=1.4.0)"] -mysql_connector = ["mysql-connector-python"] -oracle = ["cx_oracle (>=7,<8)", "cx_oracle (>=7)"] postgresql = ["psycopg2 (>=2.7)"] postgresql_asyncpg = ["greenlet (!=0.4.17)", "asyncpg"] -postgresql_pg8000 = ["pg8000 (>=1.16.6)"] -postgresql_psycopg2binary = ["psycopg2-binary"] postgresql_psycopg2cffi = ["psycopg2cffi"] +mysql_connector = ["mysql-connector-python"] pymysql = ["pymysql (<1)", "pymysql"] +mssql_pymssql = ["pymssql"] +oracle = ["cx_oracle (>=7,<8)", "cx_oracle (>=7)"] +postgresql_pg8000 = ["pg8000 (>=1.16.6)"] +aiosqlite = ["typing_extensions (!=3.10.0.1)", "greenlet (!=0.4.17)", "aiosqlite"] +asyncmy = ["greenlet (!=0.4.17)", "asyncmy (>=0.2.3)"] +postgresql_psycopg2binary = ["psycopg2-binary"] +mysql = ["mysqlclient (>=1.4.0,<2)", "mysqlclient (>=1.4.0)"] sqlcipher = ["sqlcipher3-binary"] +aiomysql = ["greenlet (!=0.4.17)", "aiomysql"] +mariadb_connector = ["mariadb (>=1.0.1)"] +mssql_pyodbc = ["pyodbc"] +asyncio = ["greenlet (!=0.4.17)"] [[package]] name = "stevedore" @@ -1149,9 +1149,9 @@ python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" colorama = {version = "*", markers = "platform_system == \"Windows\""} [package.extras] -dev = ["py-make (>=0.1.0)", "twine", "wheel"] -notebook = ["ipywidgets (>=6)"] telegram = ["requests"] +notebook = ["ipywidgets (>=6)"] +dev = ["py-make (>=0.1.0)", "twine", "wheel"] [[package]] name = "twine" @@ -1238,7 +1238,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.6.1,<4.0" -content-hash = "821a222ad69359ec266eff8d281ba0b3fe78c5249ff0d703f9359afb4c89efba" +content-hash = "489cc7708ea5d15d5c47bc7f4c21298761b4250ea93abdfcc7f1b7e85c7785d3" [metadata.files] aniso8601 = [ @@ -1525,6 +1525,7 @@ greenlet = [ {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:97e5306482182170ade15c4b0d8386ded995a07d7cc2ca8f27958d34d6736497"}, {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e6a36bb9474218c7a5b27ae476035497a6990e21d04c279884eb10d9b290f1b1"}, {file = "greenlet-1.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:abb7a75ed8b968f3061327c433a0fbd17b729947b400747c334a9c29a9af6c58"}, + {file = "greenlet-1.1.2-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:b336501a05e13b616ef81ce329c0e09ac5ed8c732d9ba7e3e983fcc1a9e86965"}, {file = "greenlet-1.1.2-cp310-cp310-win_amd64.whl", hash = "sha256:14d4f3cd4e8b524ae9b8aa567858beed70c392fdec26dbdb0a8a418392e71708"}, {file = "greenlet-1.1.2-cp35-cp35m-macosx_10_14_x86_64.whl", hash = "sha256:17ff94e7a83aa8671a25bf5b59326ec26da379ace2ebc4411d690d80a7fbcf23"}, {file = "greenlet-1.1.2-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:9f3cba480d3deb69f6ee2c1825060177a22c7826431458c697df88e6aeb3caee"}, @@ -1537,6 +1538,7 @@ greenlet = [ {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f9d29ca8a77117315101425ec7ec2a47a22ccf59f5593378fc4077ac5b754fce"}, {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:21915eb821a6b3d9d8eefdaf57d6c345b970ad722f856cd71739493ce003ad08"}, {file = "greenlet-1.1.2-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:eff9d20417ff9dcb0d25e2defc2574d10b491bf2e693b4e491914738b7908168"}, + {file = "greenlet-1.1.2-cp36-cp36m-musllinux_1_1_x86_64.whl", hash = "sha256:b8c008de9d0daba7b6666aa5bbfdc23dcd78cafc33997c9b7741ff6353bafb7f"}, {file = "greenlet-1.1.2-cp36-cp36m-win32.whl", hash = "sha256:32ca72bbc673adbcfecb935bb3fb1b74e663d10a4b241aaa2f5a75fe1d1f90aa"}, {file = "greenlet-1.1.2-cp36-cp36m-win_amd64.whl", hash = "sha256:f0214eb2a23b85528310dad848ad2ac58e735612929c8072f6093f3585fd342d"}, {file = "greenlet-1.1.2-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:b92e29e58bef6d9cfd340c72b04d74c4b4e9f70c9fa7c78b674d1fec18896dc4"}, @@ -1545,6 +1547,7 @@ greenlet = [ {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1e12bdc622676ce47ae9abbf455c189e442afdde8818d9da983085df6312e7a1"}, {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:8c790abda465726cfb8bb08bd4ca9a5d0a7bd77c7ac1ca1b839ad823b948ea28"}, {file = "greenlet-1.1.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f276df9830dba7a333544bd41070e8175762a7ac20350786b322b714b0e654f5"}, + {file = "greenlet-1.1.2-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:8c5d5b35f789a030ebb95bff352f1d27a93d81069f2adb3182d99882e095cefe"}, {file = "greenlet-1.1.2-cp37-cp37m-win32.whl", hash = "sha256:64e6175c2e53195278d7388c454e0b30997573f3f4bd63697f88d855f7a6a1fc"}, {file = "greenlet-1.1.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b11548073a2213d950c3f671aa88e6f83cda6e2fb97a8b6317b1b5b33d850e06"}, {file = "greenlet-1.1.2-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:9633b3034d3d901f0a46b7939f8c4d64427dfba6bbc5a36b1a67364cf148a1b0"}, @@ -1553,6 +1556,7 @@ greenlet = [ {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e859fcb4cbe93504ea18008d1df98dee4f7766db66c435e4882ab35cf70cac43"}, {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:00e44c8afdbe5467e4f7b5851be223be68adb4272f44696ee71fe46b7036a711"}, {file = "greenlet-1.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ec8c433b3ab0419100bd45b47c9c8551248a5aee30ca5e9d399a0b57ac04651b"}, + {file = "greenlet-1.1.2-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:2bde6792f313f4e918caabc46532aa64aa27a0db05d75b20edfc5c6f46479de2"}, {file = "greenlet-1.1.2-cp38-cp38-win32.whl", hash = "sha256:288c6a76705dc54fba69fbcb59904ae4ad768b4c768839b8ca5fdadec6dd8cfd"}, {file = "greenlet-1.1.2-cp38-cp38-win_amd64.whl", hash = "sha256:8d2f1fb53a421b410751887eb4ff21386d119ef9cde3797bf5e7ed49fb51a3b3"}, {file = "greenlet-1.1.2-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:166eac03e48784a6a6e0e5f041cfebb1ab400b394db188c48b3a84737f505b67"}, @@ -1561,6 +1565,7 @@ greenlet = [ {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b1692f7d6bc45e3200844be0dba153612103db241691088626a33ff1f24a0d88"}, {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7227b47e73dedaa513cdebb98469705ef0d66eb5a1250144468e9c3097d6b59b"}, {file = "greenlet-1.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7ff61ff178250f9bb3cd89752df0f1dd0e27316a8bd1465351652b1b4a4cdfd3"}, + {file = "greenlet-1.1.2-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0051c6f1f27cb756ffc0ffbac7d2cd48cb0362ac1736871399a739b2885134d3"}, {file = "greenlet-1.1.2-cp39-cp39-win32.whl", hash = "sha256:f70a9e237bb792c7cc7e44c531fd48f5897961701cdaa06cf22fc14965c496cf"}, {file = "greenlet-1.1.2-cp39-cp39-win_amd64.whl", hash = "sha256:013d61294b6cd8fe3242932c1c5e36e5d1db2c8afb58606c5a67efce62c1f5fd"}, {file = "greenlet-1.1.2.tar.gz", hash = "sha256:e30f5ea4ae2346e62cedde8794a56858a67b878dd79f7df76a0767e356b1744a"}, @@ -1784,7 +1789,7 @@ python-gitlab = [ {file = "python_gitlab-2.10.1-py3-none-any.whl", hash = "sha256:581a219759515513ea9399e936ed7137437cfb681f52d2641626685c492c999d"}, ] python-icat = [ - {file = "python-icat-0.20.0.tar.gz", hash = "sha256:d09e85f0269ac5f8f6a43f2365eb269b532e611a5eaa3ab23ad7f742ee2bfa25"}, + {file = "python-icat-0.21.0.tar.gz", hash = "sha256:fd4d1515b8075677ee3672274a55d6ca287ce1cfa4e17b6b25371904764be999"}, ] python-semantic-release = [ {file = "python-semantic-release-7.19.2.tar.gz", hash = "sha256:8ca0e5f72d31e7b0603b95caad6fb2d5315483ac1fadd86648771966d9ec6f2c"}, diff --git a/pyproject.toml b/pyproject.toml index 62c96806..8f996076 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,7 +26,7 @@ Flask-Cors = "3.0.9" apispec = "3.3.0" flask-swagger-ui = "3.25.0" PyYAML = "5.4" -python-icat = "0.20.0" +python-icat = "0.21.0" suds-community = "^0.8.4" py-object-pool = "^1.1" cachetools = "^4.2.1" From 31fa4ca3ece57fc19993bcd9dee0547b2b600e19 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 31 Jan 2022 15:30:28 +0000 Subject: [PATCH 06/10] 3.2.0 Automatically generated by python-semantic-release --- CHANGELOG.md | 5 +++++ pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fec3063b..808aaddf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ +## v3.2.0 (2022-01-31) +### Feature +* Add class to represent nested conditions #259 ([`583cbf2`](https://github.com/ral-facilities/datagateway-api/commit/583cbf29744b72c020429b61ae7442b19acef231)) +* Add first pass of query param implementation #259 ([`ee668e3`](https://github.com/ral-facilities/datagateway-api/commit/ee668e38cd43354851163616a93924ad84e14b90)) + ## v3.1.1 (2021-12-15) ### Fix * Correct reference to class name #264 ([`fc4c180`](https://github.com/ral-facilities/datagateway-api/commit/fc4c18085ab496d838e8d1e9e3f8c77f07826e9d)) diff --git a/pyproject.toml b/pyproject.toml index 8f996076..173742a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datagateway-api" -version = "3.1.1" +version = "3.2.0" description = "ICAT API to interface with the DataGateway" license = "Apache-2.0" readme = "README.md" From 2f0afa05101b411510bbb5f15c91c78fdc9db243 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 31 Jan 2022 16:09:24 +0000 Subject: [PATCH 07/10] test: tweak query params tests to avoid Parameter entity #259 --- .../test_search_api_query_filter_factory.py | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/test/search_api/test_search_api_query_filter_factory.py b/test/search_api/test_search_api_query_filter_factory.py index 90708c7c..5f836681 100644 --- a/test/search_api/test_search_api_query_filter_factory.py +++ b/test/search_api/test_search_api_query_filter_factory.py @@ -142,10 +142,10 @@ def test_valid_where_filter_text_operator( id="Multiple conditions (three), property values with no operator", ), pytest.param( - {"filter": {"where": {"and": [{"value": {"lt": 50}}]}}}, - "Parameter", + {"filter": {"where": {"and": [{"size": {"lt": 50}}]}}}, + "File", [], - [SearchAPIWhereFilter("value", 50, "lt")], + [SearchAPIWhereFilter("size", 50, "lt")], "and", id="Single condition, property value with operator", ), @@ -154,15 +154,15 @@ def test_valid_where_filter_text_operator( "filter": { "where": { "and": [ - {"name": {"like": "Test name"}}, - {"value": {"gte": 275}}, + {"role": {"like": "Test role"}}, + {"size": {"gte": 275}}, ], }, }, }, - "Parameter", - [SearchAPIWhereFilter("name", "Test name", "like")], - [SearchAPIWhereFilter("value", 275, "gte")], + "Member", + [SearchAPIWhereFilter("role", "Test role", "like")], + [SearchAPIWhereFilter("size", 275, "gte")], "and", id="Multiple conditions (two), property values with operator", ), @@ -172,18 +172,18 @@ def test_valid_where_filter_text_operator( "where": { "and": [ {"name": {"like": "Test name"}}, - {"value": {"gte": 275}}, - {"unit": {"nlike": "Test unit"}}, + {"size": {"gte": 275}}, + {"path": {"nlike": "Test path"}}, ], }, }, }, - "Parameter", + "File", [ SearchAPIWhereFilter("name", "Test name", "like"), - SearchAPIWhereFilter("value", 275, "gte"), + SearchAPIWhereFilter("size", 275, "gte"), ], - [SearchAPIWhereFilter("unit", "Test unit", "nlike")], + [SearchAPIWhereFilter("path", "Test path", "nlike")], "and", id="Multiple conditions (three), property values with operator", ), @@ -371,10 +371,10 @@ def test_valid_where_filter_with_and_boolean_operator( id="Multiple conditions (three), property values with no operator", ), pytest.param( - {"filter": {"where": {"or": [{"value": {"lt": 50}}]}}}, - "Parameter", + {"filter": {"where": {"or": [{"size": {"lt": 50}}]}}}, + "File", [], - [SearchAPIWhereFilter("value", 50, "lt")], + [SearchAPIWhereFilter("size", 50, "lt")], "or", id="Single condition, property value with operator", ), @@ -384,14 +384,14 @@ def test_valid_where_filter_with_and_boolean_operator( "where": { "or": [ {"name": {"like": "Test name"}}, - {"value": {"gte": 275}}, + {"size": {"gte": 275}}, ], }, }, }, - "Parameter", + "File", [SearchAPIWhereFilter("name", "Test name", "like")], - [SearchAPIWhereFilter("value", 275, "gte")], + [SearchAPIWhereFilter("size", 275, "gte")], "or", id="Multiple conditions (two), property values with operator", ), @@ -401,18 +401,18 @@ def test_valid_where_filter_with_and_boolean_operator( "where": { "or": [ {"name": {"like": "Test name"}}, - {"value": {"gte": 275}}, - {"unit": {"nlike": "Test unit"}}, + {"size": {"gte": 275}}, + {"path": {"nlike": "Test path"}}, ], }, }, }, - "Parameter", + "File", [ SearchAPIWhereFilter("name", "Test name", "like"), - SearchAPIWhereFilter("value", 275, "gte"), + SearchAPIWhereFilter("size", 275, "gte"), ], - [SearchAPIWhereFilter("unit", "Test unit", "nlike")], + [SearchAPIWhereFilter("path", "Test path", "nlike")], "or", id="Multiple conditions (three), property values with operator", ), From f94d361d3050dcfa62a2a600917cb59721715e3f Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 31 Jan 2022 16:25:52 +0000 Subject: [PATCH 08/10] build: update example mappings --- datagateway_api/search_api_mapping.json.example | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/datagateway_api/search_api_mapping.json.example b/datagateway_api/search_api_mapping.json.example index f93c2a04..643570bf 100644 --- a/datagateway_api/search_api_mapping.json.example +++ b/datagateway_api/search_api_mapping.json.example @@ -65,10 +65,10 @@ "Parameter": { "base_icat_entity": ["InvestigationParameter", "DatasetParameter"], "id": "id", - "name": "type.name", + "name": "name", "value": ["numericValue", "stringValue", "dateTimeValue"], "unit": "type.units", - "dataset": {"Dataset": ["investigation.investigationInstruments.instrument.datasetInstruments.dataset", "dataset"]}, + "dataset": {"Dataset": "investigation.investigationInstruments.instrument.datasetInstruments.dataset"}, "document": {"Document": "investigation"} }, "Person": { From 63d7c21e87f1a793b309f9c031d2a921d8f3ede8 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Mon, 31 Jan 2022 16:49:52 +0000 Subject: [PATCH 09/10] test: update mappings on tests #260 --- test/search_api/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/search_api/conftest.py b/test/search_api/conftest.py index e5bfb508..e507ec19 100644 --- a/test/search_api/conftest.py +++ b/test/search_api/conftest.py @@ -89,7 +89,7 @@ def test_search_api_mappings_data(): "affiliation": {"Affiliation": "user.dataPublicationUsers.affiliations"}, }, "Parameter": { - "base_icat_entity": "InvestigationParameter", + "base_icat_entity": ["InvestigationParameter", "DatasetParameter"], "id": "id", "name": "name", "value": ["numericValue", "stringValue", "dateTimeValue"], From 6c9780a3337823c95979b8bdff3ccf6b9a3a9fb6 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 31 Jan 2022 17:30:04 +0000 Subject: [PATCH 10/10] 3.3.0 Automatically generated by python-semantic-release --- CHANGELOG.md | 12 ++++++++++++ pyproject.toml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 808aaddf..97cd63f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ +## v3.3.0 (2022-01-31) +### Feature +* Add function to get PaNOSC to ICAT mapping for where filter #260 ([`34b1d81`](https://github.com/ral-facilities/datagateway-api/commit/34b1d819482aa3efdb4f8da321125d3e40d76617)) +* Convert PaNOSC to ICAT for where filter fields #260 ([`ff9595d`](https://github.com/ral-facilities/datagateway-api/commit/ff9595d2f571211db79dea02f702d4148b8879f3)) + +### Fix +* Fix example mapping file ([`3802cc9`](https://github.com/ral-facilities/datagateway-api/commit/3802cc9ee71a355d0ad87529f65112e8c3f8b881)) +* Update `__str__()` for WHERE filter to cope with applying filter #260 ([`8d259d7`](https://github.com/ral-facilities/datagateway-api/commit/8d259d75a28414f26cc569293720ef4e306e6844)) + +### Documentation +* Add docstring to static function #260 ([`618f6b9`](https://github.com/ral-facilities/datagateway-api/commit/618f6b9fead88f61a346b90cb2b85a90877b0410)) + ## v3.2.0 (2022-01-31) ### Feature * Add class to represent nested conditions #259 ([`583cbf2`](https://github.com/ral-facilities/datagateway-api/commit/583cbf29744b72c020429b61ae7442b19acef231)) diff --git a/pyproject.toml b/pyproject.toml index 173742a5..6fbb6040 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "datagateway-api" -version = "3.2.0" +version = "3.3.0" description = "ICAT API to interface with the DataGateway" license = "Apache-2.0" readme = "README.md"