Skip to content

Commit ba68ba4

Browse files
committed
chore: drop Python 3.10/3.11, fix ruff UP017 and UP047
* Drop Python 3.10 and 3.11 from CI matrix and raise requires-python to >=3.12 to allow use of modern syntax * Replace timezone.utc with datetime.UTC alias (UP017) * Use PEP 695 type parameter syntax on chunk() (UP047) Co-Authored-by: Peter Weber <peter.weber@rero.ch>
1 parent b7f8c13 commit ba68ba4

6 files changed

Lines changed: 130 additions & 400 deletions

File tree

.github/workflows/continuous-integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: ["3.10","3.11","3.12","3.13","3.14"]
13+
python-version: ["3.12","3.13","3.14"]
1414
dependencies: ["dev", "deploy"]
1515
steps:
1616

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ readme = "README.md"
1616
authors = [{name = "RERO",email = "software@rero.ch"}]
1717
license = "AGPL-3.0-or-later"
1818
license-files = ["LICENSE"]
19-
requires-python = ">=3.10, <3.15"
19+
requires-python = ">=3.12, <3.15"
2020

2121
dependencies = [
2222
"PyYAML<=7.0.0",

rero_invenio_base/cli/es/snapshot/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"""Click elasticsearch snapshot command-line utilities."""
1717

1818
import json
19-
from datetime import datetime, timezone
19+
from datetime import UTC, datetime
2020

2121
import click
2222
from elasticsearch_dsl import Index
@@ -68,7 +68,7 @@ def list_snapshot(repository, name):
6868
"-n",
6969
"--name",
7070
help="default={YYYY.MM.DD_HH:MM:SS}",
71-
default=datetime.now(timezone.utc).strftime("%Y.%m.%d_%H:%M:%S"),
71+
default=datetime.now(UTC).strftime("%Y.%m.%d_%H:%M:%S"),
7272
)
7373
@click.option("-w", "--wait", help="wait=True", is_flag=True, default=False)
7474
def create_snapshot(repository, name, wait):

rero_invenio_base/modules/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515

1616
"""Generic utils functions."""
1717

18+
from collections.abc import Iterable, Iterator
1819
from itertools import islice
1920

2021

21-
def chunk(iterable, size):
22+
def chunk[T](iterable: Iterable[T], size: int) -> Iterator[tuple[T, ...]]:
2223
"""Split a list of value into a list of chunks.
2324
2425
:param iterable: an iterator or list to be splitted

scripts/test

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,17 @@ add_exceptions() {
7979
info_msg "Check vulnerabilities:"
8080
# urllib3 1.26.20 GHSA-pq67-6m6q-mj2v 2.5.0
8181
add_exceptions "GHSA-pq67-6m6q-mj2v"
82+
# urllib3 1.26.20 CVE-2025-50181 2.5.0
83+
add_exceptions "CVE-2025-50181"
8284
# urllib3 1.26.20 CVE-2025-66418 2.6.0
8385
add_exceptions "CVE-2025-66418"
8486
# urllib3 1.26.20 CVE-2025-66471 2.6.0
8587
add_exceptions "CVE-2025-66471"
86-
# urllib3 1.26.20 CVE-2026-21441 2.6.3
88+
# urllib3 1.26.20 CVE-2026-21441 2.6.3
8789
add_exceptions "CVE-2026-21441"
88-
# pytest 8.4.2 CVE-2025-71176 9.0.3
90+
# urllib3 1.26.20 CVE-2026-44431 2.7.0
91+
add_exceptions "CVE-2026-44431"
92+
# pytest 8.4.2 CVE-2025-71176 9.0.3
8993
add_exceptions "CVE-2025-71176"
9094
pip-audit ${pip_audit_exceptions}
9195

0 commit comments

Comments
 (0)