From 7cb510cddb4157eaa5cc432e91dc7140c07ae716 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Sat, 30 Nov 2024 20:28:03 +0100 Subject: [PATCH 1/4] setup: bump major dependencies --- setup.cfg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.cfg b/setup.cfg index c50e0b5f..9b671278 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. -# Copyright (C) 2022 Graz University of Technology. +# Copyright (C) 2022-2024 Graz University of Technology. # Copyright (C) 2022 TU Wien. # # Invenio is free software; you can redistribute it and/or modify it @@ -28,17 +28,17 @@ packages = find: python_requires = >=3.7 zip_safe = False install_requires = - invenio-base>=1.2.3,<2.0.0 + invenio-base>=2.0.0,<3.0.0 dictdiffer>=0.9.0 [options.extras_require] tests = - pytest-black>=0.3.0 - invenio-db[versioning]>=1.0.0,<2.0.0 + pytest-black-ng>=0.4.0 + invenio-db[versioning]>=2.0.0,<3.0.0 mock>=1.3.0 - pytest-invenio>=2.0.0,<3.0.0 + pytest-invenio>=3.0.0,<4.0.0 Sphinx>=3 - invenio-accounts>=2.0.0,<3.0.0 + invenio-accounts>=6.0.0,<7.0.0 elasticsearch7 = elasticsearch>=7.0.0,<7.14 elasticsearch-dsl>=7.0.0,<8.0.0 From d7eabc42dc85c5e6144b8457947adf39ba1ec3b0 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Sat, 30 Nov 2024 20:28:18 +0100 Subject: [PATCH 2/4] setup: change to reusable workflows --- .github/workflows/pypi-publish.yml | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index a158b225..3222bc82 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -2,6 +2,7 @@ # # This file is part of Invenio. # Copyright (C) 2020 CERN. +# Copyright (C) 2024 Graz University of Technology. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -15,27 +16,5 @@ on: jobs: Publish: - runs-on: ubuntu-20.04 - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: 3.7 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel - - - name: Build package - run: | - python setup.py sdist bdist_wheel - - - name: Publish on PyPI - uses: pypa/gh-action-pypi-publish@v1.3.1 - with: - user: __token__ - password: ${{ secrets.pypi_token }} + uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master + secrets: inherit From d222a09da4d99bb32aef8e4b3400ed137edba0d8 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 5 Dec 2024 22:30:01 +0100 Subject: [PATCH 3/4] fix: tests * that is a proactive fix. it happens locally but not really on github. this should be reconsidered. --- tests/test_cli.py | 12 ++++++++---- tests/test_invenio_search.py | 23 ++++++++++++----------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 75561249..b280ece6 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -2,7 +2,7 @@ # # This file is part of Invenio. # Copyright (C) 2015-2024 CERN. -# Copyright (C) 2022 Graz University of Technology. +# Copyright (C) 2022-2024 Graz University of Technology. # Copyright (C) 2022 TU Wien. # # Invenio is free software; you can redistribute it and/or modify it @@ -63,7 +63,7 @@ def test_init(app, template_entrypoints): assert "record-view-{}".format(_get_version()) in invenio_search.templates current_search_client.indices.delete_alias("_all", "_all", ignore=[400, 404]) - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") aliases = current_search_client.indices.get_alias() assert 0 == len(aliases) @@ -171,7 +171,9 @@ def test_create_put_and_delete(app): obj=script_info, ) assert result.exit_code == 0 - assert name in list(current_search_client.indices.get("*").keys()) + assert name in list( + current_search_client.indices.get("*", expand_wildcards="all").keys() + ) is_OS = SEARCH_DISTRIBUTION == OS is_ES = SEARCH_DISTRIBUTION == ES @@ -206,4 +208,6 @@ def test_create_put_and_delete(app): obj=script_info, ) assert result.exit_code == 0 - assert name not in list(current_search_client.indices.get("*").keys()) + assert name not in list( + current_search_client.indices.get("*", expand_wildcards="all").keys() + ) diff --git a/tests/test_invenio_search.py b/tests/test_invenio_search.py index bf999f2b..76c13ddf 100644 --- a/tests/test_invenio_search.py +++ b/tests/test_invenio_search.py @@ -3,6 +3,7 @@ # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # Copyright (C) 2022 TU Wien. +# Copyright (C) 2024 Graz University of Technology. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -157,7 +158,7 @@ def test_whitelisted_aliases(app, aliases_config, expected_aliases): app.config.update(SEARCH_MAPPINGS=aliases_config) current_search_client.indices.delete_alias("_all", "_all", ignore=[400, 404]) - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") list(current_search.create(ignore=None)) aliases = current_search_client.indices.get_alias() @@ -197,7 +198,7 @@ def test_creating_alias_existing_index( search.register_mappings("authors", "mock_module.mappings") search._current_suffix = suffix current_search_client.indices.delete_alias("_all", "_all", ignore=[400, 404]) - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") new_indexes = [] if create_index: current_search_client.indices.create(index=create_index) @@ -215,7 +216,7 @@ def test_creating_alias_existing_index( assert len(results) == len(expected) for result in results: assert result[0] in expected - indices = current_search_client.indices.get("*") + indices = current_search_client.indices.get("*", expand_wildcards="all") index_names = list(indices.keys()) alias_names = [] for index in index_names: @@ -228,7 +229,7 @@ def test_creating_alias_existing_index( else: with pytest.raises(Exception): results = list(current_search.create(ignore=None)) - indices = current_search_client.indices.get("*") + indices = current_search_client.indices.get("*", expand_wildcards="all") index_names = list(indices.keys()) assert index_names == new_indexes if create_index: @@ -270,7 +271,7 @@ def _test_prefix_indices(app, prefix_value): search.register_mappings("records", "mock_module.mappings") # clean-up in case something failed previously - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") # create indices and test list(search.create()) es_indices = current_search_client.indices.get_alias() @@ -302,7 +303,7 @@ def _f(name): # formatting helper _f("{p}records"): all_indices, } # clean-up - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") def test_indices_prefix_empty_value(app): @@ -389,7 +390,7 @@ def test_current_suffix(app): def test_not_dry_run_and_index_exists(app): """Test create_index and no dry run when index exists.""" - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") current_search_client.indices.create(index="records-default-v1.0.0", body="") search = app.extensions["invenio-search"] search.register_mappings("records", "mock_module.mappings") @@ -399,7 +400,7 @@ def test_not_dry_run_and_index_exists(app): def test_create_selected_indexes(app): search = app.extensions["invenio-search"] - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") search.register_mappings("authors", "mock_module.mappings") search.register_mappings("records", "mock_module.mappings") list(search.create(index_list=["records-bibliographic-bibliographic-v1.0.0"])) @@ -423,7 +424,7 @@ def test_create_selected_indexes(app): def test_delete_selected_indexes(app): search = app.extensions["invenio-search"] - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") search.register_mappings("authors", "mock_module.mappings") search.register_mappings("records", "mock_module.mappings") list(search.create()) @@ -438,7 +439,7 @@ def test_delete_selected_indexes(app): def test_create_when_indexes_already_exists_with_ignore_existing_true(app): search = app.extensions["invenio-search"] - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") search.register_mappings("authors", "mock_module.mappings") search.register_mappings("records", "mock_module.mappings") list(search.create(index_list=["authors-authors-v1.0.0", "records-default-v1.0.0"])) @@ -453,7 +454,7 @@ def test_update_mappings(app): """Test if mapping gets correctly updated.""" mapping_path = "tests/mock_module/mappings/os-v2/records/default-v1.0.0.json" - current_search_client.indices.delete("*") + current_search_client.indices.delete("*", expand_wildcards="all") with open(mapping_path, "r") as body: initial_mapping = json.load(body) From 52a7a16aeadad1fd8e5359881357ee0070b5638e Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Fri, 6 Dec 2024 08:10:39 +0100 Subject: [PATCH 4/4] release: v3.0.0 --- CHANGES.rst | 6 ++++++ invenio_search/__init__.py | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 7bc0f129..e5f007eb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,6 +1,7 @@ .. This file is part of Invenio. Copyright (C) 2015-2024 CERN. + Copyright (C) 2024 Graz University of Technology. Invenio is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more details. @@ -8,6 +9,11 @@ Changes ======= +Version 3.0.0 (released 2024-12-06) + +- setup: change to reusable workflows +- setup: bump major dependencies + Version v2.4.1 (released 2024-08-07) - fix: avoid closing db session diff --git a/invenio_search/__init__.py b/invenio_search/__init__.py index d7fb7ac5..303fae73 100644 --- a/invenio_search/__init__.py +++ b/invenio_search/__init__.py @@ -2,8 +2,9 @@ # # This file is part of Invenio. # Copyright (C) 2015-2024 CERN. -# Copyright (C) 2022 University Münster. -# Copyright (C) 2022 TU Wien. +# Copyright (C) 2022 University Münster. +# Copyright (C) 2022 TU Wien. +# Copyright (C) 2024 Graz University of Technology. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. @@ -415,7 +416,7 @@ def index(): from .ext import InvenioSearch from .proxies import current_search, current_search_client -__version__ = "2.4.1" +__version__ = "3.0.0" __all__ = (