From 7108340b5d3a2162052d90631ffc67d7148f088c Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 12 Dec 2024 11:43:23 +0100 Subject: [PATCH 1/4] setup: bump major dependencies --- setup.cfg | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/setup.cfg b/setup.cfg index fa2bbaac..7f9566a7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -26,23 +26,23 @@ packages = find: python_requires = >=3.7 zip_safe = False install_requires = - invenio-records-resources>=6.0.0,<7.0.0 - invenio-theme>=3.0.0,<4.0.0 - invenio-users-resources>=6.0.0,<7.0.0 + invenio-records-resources>=7.0.0,<8.0.0 + invenio-theme>=4.0.0,<5.0.0 + invenio-users-resources>=7.0.0.dev1,<8.0.0 [options.extras_require] tests = pytest-black-ng>=0.4.0 - invenio-app>=1.4.0,<2.0.0 - invenio-db[postgresql,mysql]>=1.0.13,<2.0.0 - pytest-invenio>=2.1.0,<3.0.0 + invenio-app>=2.0.0,<3.0.0 + invenio-db[postgresql,mysql]>=2.0.0,<3.0.0 + pytest-invenio>=3.0.0,<4.0.0 sphinx>=4.5.0 elasticsearch7 = - invenio-search[elasticsearch7]>=2.1.0,<3.0.0 + invenio-search[elasticsearch7]>=3.0.0,<4.0.0 opensearch1 = - invenio-search[opensearch1]>=2.1.0,<3.0.0 + invenio-search[opensearch1]>=3.0.0,<4.0.0 opensearch2 = - invenio-search[opensearch2]>=2.1.0,<3.0.0 + invenio-search[opensearch2]>=3.0.0,<4.0.0 [options.entry_points] invenio_base.apps = From 7d706006c5e6550071e992a596fc087c18a52610 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 12 Dec 2024 13:24:31 +0100 Subject: [PATCH 2/4] comp: make compatible to flask-sqlalchemy>=3.1 --- tests/test_alembic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_alembic.py b/tests/test_alembic.py index 06311992..96ef1413 100644 --- a/tests/test_alembic.py +++ b/tests/test_alembic.py @@ -2,6 +2,7 @@ # # This file is part of Invenio. # Copyright (C) 2016-2021 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. @@ -23,7 +24,7 @@ def test_alembic(base_app, database): base_app.config["ALEMBIC_CONTEXT"] = alembic_test_context() # Check that this package's SQLAlchemy models have been properly registered - tables = [x.name for x in db.get_tables_for_bind()] + tables = [x for x in db.metadata.tables] assert "request_metadata" in tables assert "request_events" in tables From 1ad0923f560f3ce4135b1da8dabea04c79d445b0 Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 12 Dec 2024 14:33:37 +0100 Subject: [PATCH 3/4] fix: sqlalchemy.exc.ArgumentError * Textual SQL expression 'SELECT setval(pg_get_seri...' should be explicitly declared as text('SELECT setval(pg_get_seri...') --- invenio_requests/records/models.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/invenio_requests/records/models.py b/invenio_requests/records/models.py index d398c988..1095ce4c 100644 --- a/invenio_requests/records/models.py +++ b/invenio_requests/records/models.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # # Copyright (C) 2021 TU Wien. +# Copyright (C) 2024 Graz University of Technology. # # Invenio-Requests 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,6 +16,7 @@ from sqlalchemy.dialects import mysql from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.declarative import declared_attr +from sqlalchemy.sql import text from sqlalchemy.types import String from sqlalchemy_utils import UUIDType @@ -109,9 +111,9 @@ def _set_sequence(cls, val): """ if db.engine.dialect.name == "postgresql": # pragma: no cover db.session.execute( - "SELECT setval(pg_get_serial_sequence(" - "'{0}', 'value'), :newval)".format(cls.__tablename__), - dict(newval=val), + text( + "SELECT setval(pg_get_serial_sequence(:table, 'value'), :newval)" + ).bindparams(newval=val, table=cls.__tablename__), ) @classmethod From 82040aa46811190f2d4e99d5eac9fb235c82e13c Mon Sep 17 00:00:00 2001 From: Christoph Ladurner Date: Thu, 12 Dec 2024 14:34:36 +0100 Subject: [PATCH 4/4] release: v6.0.0.dev1 --- CHANGES.rst | 7 +++++++ invenio_requests/__init__.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 935e1f29..36a6965b 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,5 +1,6 @@ .. Copyright (C) 2021-2024 CERN. + Copyright (C) 2024 Graz University of Technology. Invenio-Requests is free software; you can redistribute it and/or modify it under the terms of the MIT License; see LICENSE file for more @@ -8,6 +9,12 @@ Changes ======= +Version 6.0.0.dev1 (released 2024-12-12) + +- fix: sqlalchemy.exc.ArgumentError +- comp: make compatible to flask-sqlalchemy>=3.1 +- setup: bump major dependencies + Version v5.5.0 (released 2024-12-09) - config: allow comment notification builder to be custom diff --git a/invenio_requests/__init__.py b/invenio_requests/__init__.py index 626123d3..92b87d01 100644 --- a/invenio_requests/__init__.py +++ b/invenio_requests/__init__.py @@ -20,7 +20,7 @@ current_requests_service, ) -__version__ = "5.5.0" +__version__ = "6.0.0.dev1" __all__ = ( "__version__",