Skip to content

Commit 08da95b

Browse files
authored
Drop Python 3.8 support
* Upgrade pre-commit dependencies * Drop Python 3.8 support * Allow manual triggering of test workflow
1 parent b00282e commit 08da95b

File tree

7 files changed

+44
-49
lines changed

7 files changed

+44
-49
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
name: "Test"
33
on:
4+
workflow_dispatch:
45
pull_request:
56
push:
67
branches:
@@ -12,7 +13,6 @@ jobs:
1213
strategy:
1314
matrix:
1415
python-version: [
15-
"3.8",
1616
"3.9",
1717
"3.10",
1818
"3.11",

.pre-commit-config.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.5.1
3+
rev: v0.8.5
44
hooks:
55
- id: ruff
66
args: [--fix, --exit-non-zero-on-fix]
77
- id: ruff-format
88
- repo: https://github.com/igorshubovych/markdownlint-cli
9-
rev: v0.41.0
9+
rev: v0.43.0
1010
hooks:
1111
- id: markdownlint
1212
exclude: |
@@ -22,7 +22,7 @@ repos:
2222
(README)\.md
2323
)
2424
- repo: https://github.com/pre-commit/mirrors-mypy
25-
rev: v1.11.2
25+
rev: v1.14.1
2626
hooks:
2727
- id: mypy
2828
additional_dependencies:

fixity/fixity.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@
88
from datetime import datetime
99
from datetime import timezone
1010
from time import sleep
11-
from typing import List
1211
from typing import Optional
1312
from typing import TextIO
14-
from typing import Type
1513
from typing import Union
1614
from uuid import uuid4
1715

@@ -311,10 +309,10 @@ def get_handler(stream, timestamps, log_level=None):
311309

312310

313311
def main(
314-
argv: Optional[List[str]] = None,
312+
argv: Optional[list[str]] = None,
315313
logger: Optional[logging.Logger] = None,
316314
stream: Optional[TextIO] = None,
317-
) -> Optional[Union[int, bool, Type[Exception]]]:
315+
) -> Optional[Union[int, bool, type[Exception]]]:
318316
if logger is None:
319317
logger = get_logger()
320318
if stream is None:

pyproject.toml

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ dynamic = [
1717
"readme",
1818
]
1919
description = "Command line tool to check fixity for AIPs stored in the Archivematica Storage Service."
20-
requires-python = ">=3.8"
20+
requires-python = ">=3.9"
2121
license = {file = "LICENSE"}
2222
dependencies = [
2323
"requests",
@@ -34,7 +34,6 @@ classifiers = [
3434
"License :: OSI Approved :: GNU Affero General Public License v3",
3535
"Operating System :: POSIX :: Linux",
3636
"Programming Language :: Python :: 3 :: Only",
37-
"Programming Language :: Python :: 3.8",
3837
"Programming Language :: Python :: 3.9",
3938
"Programming Language :: Python :: 3.10",
4039
"Programming Language :: Python :: 3.11",
@@ -107,11 +106,10 @@ omit = [
107106
[tool.tox]
108107
legacy_tox_ini = """
109108
[tox]
110-
envlist = py{38,39,310,311,312}, linting
109+
envlist = py{39,310,311,312}, linting
111110
112111
[gh-actions]
113112
python =
114-
3.8: py38
115113
3.9: py39
116114
3.10: py310
117115
3.11: py311

requirements-dev.txt

+21-21
Original file line numberDiff line numberDiff line change
@@ -4,69 +4,69 @@
44
#
55
# pip-compile --allow-unsafe --extra=dev --output-file=requirements-dev.txt pyproject.toml
66
#
7-
build==1.2.1
7+
build==1.2.2.post1
88
# via pip-tools
9-
certifi==2024.7.4
9+
certifi==2024.12.14
1010
# via requests
11-
charset-normalizer==3.3.2
11+
charset-normalizer==3.4.1
1212
# via requests
13-
click==8.1.7
13+
click==8.1.8
1414
# via pip-tools
15-
coverage[toml]==7.5.4
15+
coverage[toml]==7.6.10
1616
# via
1717
# fixity (pyproject.toml)
1818
# pytest-cov
19-
exceptiongroup==1.2.1
19+
exceptiongroup==1.2.2
2020
# via pytest
21-
greenlet==3.0.3
21+
greenlet==3.1.1
2222
# via sqlalchemy
23-
idna==3.7
23+
idna==3.10
2424
# via requests
25-
importlib-metadata==8.0.0
25+
importlib-metadata==8.5.0
2626
# via build
2727
iniconfig==2.0.0
2828
# via pytest
29-
packaging==24.1
29+
packaging==24.2
3030
# via
3131
# build
3232
# pytest
3333
pip-tools==7.4.1
3434
# via fixity (pyproject.toml)
3535
pluggy==1.5.0
3636
# via pytest
37-
pyproject-hooks==1.1.0
37+
pyproject-hooks==1.2.0
3838
# via
3939
# build
4040
# pip-tools
41-
pytest==8.2.2
41+
pytest==8.3.4
4242
# via
4343
# fixity (pyproject.toml)
4444
# pytest-cov
45-
pytest-cov==5.0.0
45+
pytest-cov==6.0.0
4646
# via fixity (pyproject.toml)
4747
requests==2.32.3
4848
# via fixity (pyproject.toml)
49-
ruff==0.5.1
49+
ruff==0.8.5
5050
# via fixity (pyproject.toml)
51-
sqlalchemy==2.0.31
51+
sqlalchemy==2.0.36
5252
# via fixity (pyproject.toml)
53-
tomli==2.0.1
53+
tomli==2.2.1
5454
# via
5555
# build
5656
# coverage
5757
# pip-tools
5858
# pytest
5959
typing-extensions==4.12.2
6060
# via sqlalchemy
61-
urllib3==2.2.2
61+
urllib3==2.3.0
6262
# via requests
63-
wheel==0.43.0
63+
wheel==0.45.1
6464
# via pip-tools
65-
zipp==3.19.2
65+
zipp==3.21.0
6666
# via importlib-metadata
6767

6868
# The following packages are considered to be unsafe in a requirements file:
69-
pip==24.1.2
69+
pip==24.3.1
7070
# via pip-tools
71-
setuptools==70.2.0
71+
setuptools==75.6.0
7272
# via pip-tools

requirements.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44
#
55
# pip-compile --allow-unsafe --output-file=requirements.txt pyproject.toml
66
#
7-
certifi==2024.7.4
7+
certifi==2024.12.14
88
# via requests
9-
charset-normalizer==3.3.2
9+
charset-normalizer==3.4.1
1010
# via requests
11-
greenlet==3.0.3
11+
greenlet==3.1.1
1212
# via sqlalchemy
13-
idna==3.7
13+
idna==3.10
1414
# via requests
1515
requests==2.32.3
1616
# via fixity (pyproject.toml)
17-
sqlalchemy==2.0.31
17+
sqlalchemy==2.0.36
1818
# via fixity (pyproject.toml)
1919
typing-extensions==4.12.2
2020
# via sqlalchemy
21-
urllib3==2.2.2
21+
urllib3==2.3.0
2222
# via requests

tests/test_fixity.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import uuid
44
from datetime import datetime
55
from datetime import timezone
6-
from typing import List
76
from typing import TextIO
87
from unittest import mock
98

@@ -45,7 +44,7 @@ def environment(monkeypatch: pytest.MonkeyPatch) -> None:
4544

4645

4746
@pytest.fixture
48-
def mock_check_fixity() -> List[mock.Mock]:
47+
def mock_check_fixity() -> list[mock.Mock]:
4948
return [
5049
mock.Mock(
5150
**{
@@ -58,14 +57,14 @@ def mock_check_fixity() -> List[mock.Mock]:
5857
]
5958

6059

61-
def _assert_stream_content_matches(stream: TextIO, expected: List[str]) -> None:
60+
def _assert_stream_content_matches(stream: TextIO, expected: list[str]) -> None:
6261
stream.seek(0)
6362
assert [line.strip() for line in stream.readlines()] == expected
6463

6564

6665
@mock.patch("requests.get")
6766
def test_scan(
68-
_get: mock.Mock, environment: None, mock_check_fixity: List[mock.Mock]
67+
_get: mock.Mock, environment: None, mock_check_fixity: list[mock.Mock]
6968
) -> None:
7069
_get.side_effect = mock_check_fixity
7170
aip_id = uuid.uuid4()
@@ -95,7 +94,7 @@ def test_scan_if_timestamps_argument_is_passed(
9594
_get: mock.Mock,
9695
time: mock.Mock,
9796
environment: None,
98-
mock_check_fixity: List[mock.Mock],
97+
mock_check_fixity: list[mock.Mock],
9998
) -> None:
10099
_get.side_effect = mock_check_fixity
101100
aip_id = uuid.uuid4()
@@ -140,7 +139,7 @@ def test_scan_if_report_url_exists(
140139
utcnow: mock.Mock,
141140
uuid4: mock.Mock,
142141
environment: None,
143-
mock_check_fixity: List[mock.Mock],
142+
mock_check_fixity: list[mock.Mock],
144143
monkeypatch: pytest.MonkeyPatch,
145144
) -> None:
146145
uuid4.return_value = expected_uuid = uuid.uuid4()
@@ -215,7 +214,7 @@ def test_scan_handles_exceptions_if_report_url_exists(
215214
_post: mock.Mock,
216215
_get: mock.Mock,
217216
environment: None,
218-
mock_check_fixity: List[mock.Mock],
217+
mock_check_fixity: list[mock.Mock],
219218
monkeypatch: pytest.MonkeyPatch,
220219
) -> None:
221220
_get.side_effect = mock_check_fixity
@@ -328,7 +327,7 @@ def test_scan_message(status: bool, error_message: str) -> None:
328327
"requests.get",
329328
)
330329
def test_scanall(
331-
_get: mock.Mock, environment: None, mock_check_fixity: List[mock.Mock]
330+
_get: mock.Mock, environment: None, mock_check_fixity: list[mock.Mock]
332331
) -> None:
333332
aip1_uuid = str(uuid.uuid4())
334333
aip2_uuid = str(uuid.uuid4())
@@ -499,7 +498,7 @@ def test_main_handles_exceptions_if_scanall_fails(
499498

500499
@mock.patch("requests.get")
501500
def test_scanall_if_sort_argument_is_passed(
502-
_get: mock.Mock, environment: None, mock_check_fixity: List[mock.Mock]
501+
_get: mock.Mock, environment: None, mock_check_fixity: list[mock.Mock]
503502
) -> None:
504503
aip1_uuid = str(uuid.uuid4())
505504
aip2_uuid = str(uuid.uuid4())
@@ -640,7 +639,7 @@ def test_scanall_if_sort_argument_is_passed(
640639

641640
@mock.patch("requests.get")
642641
def test_main_handles_exception_if_environment_key_is_missing(
643-
_get: mock.Mock, mock_check_fixity: List[mock.Mock]
642+
_get: mock.Mock, mock_check_fixity: list[mock.Mock]
644643
) -> None:
645644
_get.side_effect = mock_check_fixity
646645

0 commit comments

Comments
 (0)