From 331a4bde1cfbbbbea22f0bda231d9a0b859c5dc2 Mon Sep 17 00:00:00 2001 From: Saksham Date: Mon, 29 Jun 2026 09:55:39 +0200 Subject: [PATCH] feat(setup): Update pythong version to 3.12 for RDM --- .github/workflows/tests.yml | 2 +- cds_migrator_kit/__init__.py | 13 +++++++++++-- setup.cfg | 1 + tests/cds-rdm/conftest.py | 1 + tests/cds-rdm/test_bulletin_issue.py | 1 + tests/cds-rdm/test_hr_migration.py | 1 + tests/cds-rdm/test_thesis_migration.py | 1 + 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 363e0f8b..80f72409 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -27,7 +27,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - python-version: [3.9] + python-version: [3.12, 3.14] requirements-level: [pypi] db-service: [postgresql14] include: diff --git a/cds_migrator_kit/__init__.py b/cds_migrator_kit/__init__.py index d0a8de1b..1039fc97 100644 --- a/cds_migrator_kit/__init__.py +++ b/cds_migrator_kit/__init__.py @@ -8,9 +8,18 @@ """Migration tool kit from old Invenio to new Invenio.""" - from .ext import CdsMigratorKit __all__ = ("__version__", "CdsMigratorKit") -__version__ = "0.1.0.dev20180000" +# Fix for Python3.10 breaking changes +# The underlying module `invenio-query-parser` uses MutableMapping and Sequence from collections +# But they are moved to collections.abc starting from Python3.10 + +import collections +import collections.abc + +collections.MutableMapping = collections.abc.MutableMapping +collections.Sequence = collections.abc.Sequence + +__version__ = "0.1.0.dev20260000" diff --git a/setup.cfg b/setup.cfg index 54169023..9cc7b608 100644 --- a/setup.cfg +++ b/setup.cfg @@ -18,6 +18,7 @@ install_requires = sentry-sdk>=1.45,<2.0.0 cds-dojson @ git+https://github.com/CERNDocumentServer/cds-dojson@master#egg=cds-dojson invenio-rdm-migrator>=5.0.0 + setuptools<82.0.0 # `invenio-rdm-migrator` has a dependency on `pypeln` which depends on `pkg_resources` lxml>=4.6.5 ipython!=8.1.0 uwsgi>=2.0 diff --git a/tests/cds-rdm/conftest.py b/tests/cds-rdm/conftest.py index 60b38905..b389b83f 100644 --- a/tests/cds-rdm/conftest.py +++ b/tests/cds-rdm/conftest.py @@ -6,6 +6,7 @@ # the terms of the MIT License; see LICENSE file for more details. """Pytest fixtures.""" + import os from collections import namedtuple from os.path import dirname, join diff --git a/tests/cds-rdm/test_bulletin_issue.py b/tests/cds-rdm/test_bulletin_issue.py index abd99390..88cd0bdf 100644 --- a/tests/cds-rdm/test_bulletin_issue.py +++ b/tests/cds-rdm/test_bulletin_issue.py @@ -6,6 +6,7 @@ # the terms of the MIT License; see LICENSE file for more details. """Tests suites.""" + import json from pathlib import Path diff --git a/tests/cds-rdm/test_hr_migration.py b/tests/cds-rdm/test_hr_migration.py index f39667ac..3ffd71f8 100644 --- a/tests/cds-rdm/test_hr_migration.py +++ b/tests/cds-rdm/test_hr_migration.py @@ -6,6 +6,7 @@ # the terms of the MIT License; see LICENSE file for more details. """Tests suites.""" + import json from pathlib import Path diff --git a/tests/cds-rdm/test_thesis_migration.py b/tests/cds-rdm/test_thesis_migration.py index 52fcee38..ec32e94d 100644 --- a/tests/cds-rdm/test_thesis_migration.py +++ b/tests/cds-rdm/test_thesis_migration.py @@ -6,6 +6,7 @@ # the terms of the MIT License; see LICENSE file for more details. """Tests suites.""" + import json from pathlib import Path