Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump major #236

Merged
merged 4 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_token }}
uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master
secrets: inherit
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
..
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.

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
Expand Down
7 changes: 4 additions & 3 deletions invenio_search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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__ = (
Expand Down
12 changes: 6 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
12 changes: 8 additions & 4 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
)
23 changes: 12 additions & 11 deletions tests/test_invenio_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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")
Expand All @@ -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"]))
Expand All @@ -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())
Expand All @@ -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"]))
Expand All @@ -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)
Expand Down