diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c8e038e2e..bb2a8f2fc 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -5,13 +5,16 @@ on: [push, pull_request] jobs: lint: runs-on: ubuntu-24.04 + strategy: + matrix: + python-version: ['3.9', '3.12'] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v5 with: - python-version: 3.12 + python-version: ${{ matrix.python-version }} - name: Install dependencies run: | diff --git a/data_access_token.py b/data_access_token.py index 1425e6384..9372f7b06 100644 --- a/data_access_token.py +++ b/data_access_token.py @@ -9,7 +9,12 @@ from traceback import print_exc from typing import List -from pysqlcipher3 import dbapi2 as sqlite3 +import sys +if sys.version_info < (3, 10): + from sqlcipher3 import dbapi2 as sqlite3 +else: + from pysqlcipher3 import dbapi2 as sqlite3 + from util import * diff --git a/datarequest.py b/datarequest.py index 53e187958..be3cf9063 100644 --- a/datarequest.py +++ b/datarequest.py @@ -1,6 +1,7 @@ """Functions to handle data requests.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' __author__ = ('Lazlo Westerhof, Jelmer Zondergeld') diff --git a/deposit.py b/deposit.py index efbc0aadc..0362f1da2 100644 --- a/deposit.py +++ b/deposit.py @@ -1,6 +1,7 @@ """Functions for deposit module.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2021-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2021-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/folder.py b/folder.py index dfd3e5c64..baa855c45 100644 --- a/folder.py +++ b/folder.py @@ -1,6 +1,7 @@ """Functions to act on user-visible folders in the research or vault area.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import time diff --git a/groups.py b/groups.py index 9b7da412c..45c3563a6 100644 --- a/groups.py +++ b/groups.py @@ -1,6 +1,7 @@ """Functions for group management and group queries.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2018-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2018-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import time diff --git a/mail.py b/mail.py index 07b0c04fc..e01f3736e 100644 --- a/mail.py +++ b/mail.py @@ -1,6 +1,7 @@ """Rules for sending e-mails.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2020-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2020-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import email diff --git a/meta.py b/meta.py index bd1ab17db..937ff7c8f 100644 --- a/meta.py +++ b/meta.py @@ -1,6 +1,7 @@ """JSON metadata handling.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import json diff --git a/meta_form.py b/meta_form.py index b4573e9ca..a206b36a4 100644 --- a/meta_form.py +++ b/meta_form.py @@ -1,6 +1,7 @@ """JSON metadata form handling.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/notifications.py b/notifications.py index 5d0b27db0..11d91f187 100644 --- a/notifications.py +++ b/notifications.py @@ -1,9 +1,9 @@ """Functions for user notifications.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2021-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2021-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' - import json import random import string diff --git a/policies.py b/policies.py index 95340ed50..c309f71d1 100644 --- a/policies.py +++ b/policies.py @@ -1,6 +1,7 @@ """iRODS policy implementations.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2020-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2020-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/policies_datamanager.py b/policies_datamanager.py index 3800ba6ff..3ecfa9e26 100644 --- a/policies_datamanager.py +++ b/policies_datamanager.py @@ -1,6 +1,7 @@ """Policy check functions for datamanager actions.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from util import * diff --git a/policies_datapackage_status.py b/policies_datapackage_status.py index 16645217d..8fe5018c8 100644 --- a/policies_datapackage_status.py +++ b/policies_datapackage_status.py @@ -1,6 +1,7 @@ """Policy check functions for data package status transitions.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import folder diff --git a/policies_datarequest_status.py b/policies_datarequest_status.py index c7381b760..78c8cc0f5 100644 --- a/policies_datarequest_status.py +++ b/policies_datarequest_status.py @@ -1,6 +1,7 @@ """Policy check functions for datarequest status transitions.""" +from __future__ import annotations -__copyright__ = "Copyright (c) 2019-2024, Utrecht University" +__copyright__ = "Copyright (c) 2019-2025, Utrecht University" __license__ = "GPLv3, see LICENSE" import re diff --git a/policies_folder_status.py b/policies_folder_status.py index 1f8ec536b..ecd2cf832 100644 --- a/policies_folder_status.py +++ b/policies_folder_status.py @@ -1,6 +1,7 @@ """Policy check functions for folder status transitions.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import time diff --git a/requirements.txt b/requirements.txt index f783d16f9..8e3e3f698 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,10 +2,9 @@ setuptools==75.6.0 MarkupSafe==3.0.2 Jinja2==3.1.5 requests==2.32.3 -pyrsistent==0.15.7 configparser==4.0.2 contextlib2==0.6.0.post1 -importlib-metadata==2.1.1 +importlib-metadata==8.6.1 jsonschema==4.23.0 pathvalidate==0.29.1 requests_cache==0.5.2 @@ -16,5 +15,6 @@ deepdiff==8.0.1 persist-queue==0.8.1 redis==3.5.3 psutil==6.1.1 -iteration_utilities==0.8.0 +iteration_utilities==0.13.0 rotki-pysqlcipher3==2024.10.1 +sqlcipher3-binary==0.5.4 diff --git a/revisions.py b/revisions.py index 1d533ec07..8c62f1013 100644 --- a/revisions.py +++ b/revisions.py @@ -1,6 +1,7 @@ """Functions for revision management.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import datetime diff --git a/rules_uu.cfg.template b/rules_uu.cfg.template index 8524920ff..0a73acc4e 100644 --- a/rules_uu.cfg.template +++ b/rules_uu.cfg.template @@ -68,5 +68,3 @@ arb_enabled = arb_exempt_resources = arb_min_gb_free = arb_min_percent_free = - -python3_interpreter = diff --git a/schema.py b/schema.py index bfea19aa2..28ee5661e 100644 --- a/schema.py +++ b/schema.py @@ -1,6 +1,7 @@ """Functions for finding the active schema.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2018-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2018-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/schema_transformation.py b/schema_transformation.py index 0bcd322f5..67603ae76 100644 --- a/schema_transformation.py +++ b/schema_transformation.py @@ -1,6 +1,7 @@ """Functions for handling schema updates within any yoda-metadata file.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2018-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2018-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' __all__ = ['rule_batch_transform_vault_metadata', diff --git a/schema_transformations.py b/schema_transformations.py index 82437679d..be04475e6 100644 --- a/schema_transformations.py +++ b/schema_transformations.py @@ -1,6 +1,7 @@ """JSON schema transformation functions.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/schema_transformations_utils.py b/schema_transformations_utils.py index d01df318b..25860a945 100644 --- a/schema_transformations_utils.py +++ b/schema_transformations_utils.py @@ -1,6 +1,7 @@ """JSON schema transformation utility functions.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2024, Utrecht University' +__copyright__ = 'Copyright (c) 2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/settings.py b/settings.py index ba133eef3..f27a1931d 100644 --- a/settings.py +++ b/settings.py @@ -1,6 +1,7 @@ """Functions for user settings.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2021-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2021-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from typing import Dict, Sequence diff --git a/stats.py b/stats.py index dd37f3163..afbb7cc8c 100644 --- a/stats.py +++ b/stats.py @@ -1,6 +1,7 @@ """Functions for statistics module.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2018-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2018-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from datetime import datetime diff --git a/util/api.py b/util/api.py index 2161112b7..4d9b41e90 100644 --- a/util/api.py +++ b/util/api.py @@ -2,8 +2,9 @@ For example usage, see make(). """ +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import base64 diff --git a/util/avu.py b/util/avu.py index 47f3e71d3..49c9785b0 100644 --- a/util/avu.py +++ b/util/avu.py @@ -1,6 +1,7 @@ """Utility / convenience functions for dealing with AVUs.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import itertools diff --git a/util/bagit.py b/util/bagit.py index 7e65ab063..ace2ed802 100644 --- a/util/bagit.py +++ b/util/bagit.py @@ -1,6 +1,7 @@ """Functions to copy packages to the vault and manage permissions of vault packages.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2023-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2023-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import itertools diff --git a/util/collection.py b/util/collection.py index 2ea58e9b1..d0c928a1c 100644 --- a/util/collection.py +++ b/util/collection.py @@ -1,6 +1,7 @@ """Utility / convenience functions for dealing with collections.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import itertools diff --git a/util/config.py b/util/config.py index 002ba0f2f..2cb08feb8 100644 --- a/util/config.py +++ b/util/config.py @@ -1,6 +1,7 @@ """Yoda ruleset configuration.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from typing import List @@ -146,8 +147,7 @@ def __repr__(self) -> str: vault_copy_max_retries=5, vault_copy_multithread_enabled=True, user_max_connections_enabled=False, - user_max_connections_number=4, - python3_interpreter='/usr/local/bin/python3') + user_max_connections_number=4) # }}} diff --git a/util/data_object.py b/util/data_object.py index d41225685..fc8b14bf6 100644 --- a/util/data_object.py +++ b/util/data_object.py @@ -1,6 +1,7 @@ """Utility / convenience functions for data object IO.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import binascii diff --git a/util/group.py b/util/group.py index 372549051..3922653fc 100644 --- a/util/group.py +++ b/util/group.py @@ -1,6 +1,7 @@ """Utility / convenience functions for querying group info.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from typing import List, TYPE_CHECKING diff --git a/util/pathutil.py b/util/pathutil.py index 0e76bf0d5..a9c40eb80 100644 --- a/util/pathutil.py +++ b/util/pathutil.py @@ -1,8 +1,9 @@ """Utility / convenience functions for dealing with paths.""" +from __future__ import annotations # (ideally this module would be named 'path', but name conflicts cause too much pain) -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import re diff --git a/util/policy.py b/util/policy.py index 149b6b863..a12aab69f 100644 --- a/util/policy.py +++ b/util/policy.py @@ -1,6 +1,7 @@ """Utilities for creating PEP rules.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from typing import Callable, Tuple diff --git a/util/resources.py b/util/resources.py index 982c59d0a..71ebeb092 100644 --- a/util/resources.py +++ b/util/resources.py @@ -1,6 +1,7 @@ """Utility / convenience functions for dealing with resources.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' from typing import List, TYPE_CHECKING diff --git a/util/rule.py b/util/rule.py index 5e52cd9f8..432596ed0 100644 --- a/util/rule.py +++ b/util/rule.py @@ -1,6 +1,7 @@ """Python/Rule interface code.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import json diff --git a/util/spool.py b/util/spool.py index 59dd41a3c..5bf1eec5c 100644 --- a/util/spool.py +++ b/util/spool.py @@ -9,6 +9,10 @@ It is assumed that functions that use the spool subsystem take care of authorization and logging. """ +from __future__ import annotations + +__copyright__ = 'Copyright (c) 2023-2025, Utrecht University' +__license__ = 'GPLv3, see LICENSE' import os from typing import Iterable diff --git a/util/user.py b/util/user.py index a52d0838b..cd6fb9d46 100644 --- a/util/user.py +++ b/util/user.py @@ -1,6 +1,7 @@ """Utility / convenience functions for querying user info.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import subprocess diff --git a/vault.py b/vault.py index dde69c669..b3cf20746 100644 --- a/vault.py +++ b/vault.py @@ -1,6 +1,7 @@ """Functions to copy packages to the vault and manage permissions of vault packages.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2019-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2019-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import os diff --git a/vault_archive.py b/vault_archive.py index 3a0705520..c02816886 100644 --- a/vault_archive.py +++ b/vault_archive.py @@ -1,6 +1,7 @@ """Functions to archive vault data packages.""" +from __future__ import annotations -__copyright__ = 'Copyright (c) 2023-2024, Utrecht University' +__copyright__ = 'Copyright (c) 2023-2025, Utrecht University' __license__ = 'GPLv3, see LICENSE' import json