Skip to content

Commit 94d76ed

Browse files
authored
Merge pull request #2897 from jku/bump-minimum-python-version
Bump minimum python version
2 parents b21206d + 7ecb67d commit 94d76ed

File tree

8 files changed

+23
-23
lines changed

8 files changed

+23
-23
lines changed

.github/workflows/_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Python (oldest supported version)
1919
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
2020
with:
21-
python-version: "3.9"
21+
python-version: "3.10"
2222
cache: 'pip'
2323
cache-dependency-path: |
2424
requirements/*.txt
@@ -38,7 +38,7 @@ jobs:
3838
needs: lint-test
3939
strategy:
4040
matrix:
41-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
41+
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
4242
os: [ubuntu-latest]
4343
include:
4444
- python-version: "3.x"

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ description = "A secure updater framework for Python"
88
readme = "README.md"
99
license = "Apache-2.0 OR MIT"
1010
license-files = ["LICENSE", "LICENSE-MIT"]
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.10"
1212
authors = [
1313
{ email = "theupdateframework@googlegroups.com" },
1414
]
@@ -31,11 +31,11 @@ classifiers = [
3131
"Operating System :: POSIX :: Linux",
3232
"Programming Language :: Python",
3333
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.9",
3534
"Programming Language :: Python :: 3.10",
3635
"Programming Language :: Python :: 3.11",
3736
"Programming Language :: Python :: 3.12",
3837
"Programming Language :: Python :: 3.13",
38+
"Programming Language :: Python :: 3.14",
3939
"Programming Language :: Python :: Implementation :: CPython",
4040
"Topic :: Security",
4141
"Topic :: Software Development",

tests/test_fetcher_ng.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ def test_download_file_upper_length(self) -> None:
170170

171171
# Download a file bigger than expected
172172
def test_download_file_length_mismatch(self) -> None:
173-
with self.assertRaises(
174-
exceptions.DownloadLengthMismatchError
175-
), self.fetcher.download_file(self.url, self.file_length - 4):
173+
with (
174+
self.assertRaises(exceptions.DownloadLengthMismatchError),
175+
self.fetcher.download_file(self.url, self.file_length - 4),
176+
):
176177
pass # we never get here as download_file() raises
177178

178179

tests/test_trusted_metadata_set.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import sys
88
import unittest
99
from datetime import datetime, timezone
10-
from typing import Callable, ClassVar
10+
from typing import TYPE_CHECKING, ClassVar
1111

1212
from securesystemslib.signer import Signer
1313

@@ -30,6 +30,9 @@
3030
)
3131
from tuf.ngclient.config import EnvelopeType
3232

33+
if TYPE_CHECKING:
34+
from collections.abc import Callable
35+
3336
logger = logging.getLogger(__name__)
3437

3538

tests/test_updater_ng.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import tempfile
1313
import unittest
1414
from collections.abc import Iterable
15-
from typing import TYPE_CHECKING, Callable, ClassVar
15+
from typing import TYPE_CHECKING, ClassVar
1616
from unittest.mock import MagicMock, patch
1717

1818
from securesystemslib.signer import Signer
@@ -30,7 +30,7 @@
3030
from tuf.ngclient import Updater, UpdaterConfig
3131

3232
if TYPE_CHECKING:
33-
from collections.abc import Iterable
33+
from collections.abc import Callable, Iterable
3434

3535
logger = logging.getLogger(__name__)
3636

tests/utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
import time
3333
import warnings
3434
from contextlib import contextmanager
35-
from typing import IO, TYPE_CHECKING, Any, Callable
35+
from typing import IO, TYPE_CHECKING, Any
3636

3737
if TYPE_CHECKING:
3838
import unittest
39-
from collections.abc import Iterator
39+
from collections.abc import Callable, Iterator
4040

4141
logger = logging.getLogger(__name__)
4242

@@ -111,7 +111,7 @@ def wait_for_server(
111111
sock.settimeout(remaining_timeout)
112112
sock.connect((host, port))
113113
succeeded = True
114-
except socket.timeout:
114+
except TimeoutError:
115115
pass
116116
except OSError as e:
117117
# ECONNREFUSED is expected while the server is not started

tuf/api/_payload.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -396,19 +396,15 @@ def verified(self) -> bool:
396396
def signed(self) -> dict[str, Key]:
397397
"""Dictionary of all signing keys that have signed, from both
398398
VerificationResults.
399-
return a union of all signed (in python<3.9 this requires
400-
dict unpacking)
401399
"""
402-
return {**self.first.signed, **self.second.signed}
400+
return self.first.signed | self.second.signed
403401

404402
@property
405403
def unsigned(self) -> dict[str, Key]:
406404
"""Dictionary of all signing keys that have not signed, from both
407405
VerificationResults.
408-
return a union of all unsigned (in python<3.9 this requires
409-
dict unpacking)
410406
"""
411-
return {**self.first.unsigned, **self.second.unsigned}
407+
return self.first.unsigned | self.second.unsigned
412408

413409

414410
class _DelegatorMixin(metaclass=abc.ABCMeta):
@@ -1195,8 +1191,8 @@ def _is_target_in_pathpattern(targetpath: str, pathpattern: str) -> bool:
11951191

11961192
# Every part in the pathpattern could include a glob pattern, that's why
11971193
# each of the target and pathpattern parts should match.
1198-
for target_dir, pattern_dir in zip(target_parts, pattern_parts):
1199-
if not fnmatch.fnmatch(target_dir, pattern_dir):
1194+
for target, pattern in zip(target_parts, pattern_parts, strict=True):
1195+
if not fnmatch.fnmatch(target, pattern):
12001196
return False
12011197

12021198
return True

tuf/ngclient/_internal/trusted_metadata_set.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
import datetime
6767
import logging
6868
from collections import abc
69-
from typing import TYPE_CHECKING, Union, cast
69+
from typing import TYPE_CHECKING, cast
7070

7171
from tuf.api import exceptions
7272
from tuf.api.dsse import SimpleEnvelope
@@ -88,7 +88,7 @@
8888

8989
logger = logging.getLogger(__name__)
9090

91-
Delegator = Union[Root, Targets]
91+
Delegator = Root | Targets
9292

9393

9494
class TrustedMetadataSet(abc.Mapping):

0 commit comments

Comments
 (0)