Skip to content

Commit 972a4eb

Browse files
authored
Add support for Python 3.13
* Remove versions from README * Upgrade pre-commit dependencies * Upgrade Python requirements
1 parent 2109080 commit 972a4eb

File tree

10 files changed

+25
-36
lines changed

10 files changed

+25
-36
lines changed

.github/workflows/test.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
test:
1111
name: "Test Python ${{ matrix.python-version }}"
12-
runs-on: "ubuntu-22.04"
12+
runs-on: "ubuntu-24.04"
1313
strategy:
1414
fail-fast: false
1515
matrix:
@@ -18,6 +18,7 @@ jobs:
1818
"3.10",
1919
"3.11",
2020
"3.12",
21+
"3.13",
2122
]
2223
steps:
2324
- name: "Check out repository"
@@ -33,10 +34,10 @@ jobs:
3334
- name: "Install tox"
3435
run: |
3536
python -m pip install --upgrade pip
36-
pip install tox tox-gh-actions
37+
pip install tox
3738
- name: "Run tox"
3839
run: |
39-
tox -- --cov metsrw --cov-report xml:coverage.xml
40+
tox -e py -- --cov metsrw --cov-report xml:coverage.xml
4041
- name: "Upload coverage report"
4142
if: github.repository == 'artefactual-labs/mets-reader-writer'
4243
uses: "codecov/codecov-action@v4"
@@ -48,14 +49,14 @@ jobs:
4849
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
4950
lint:
5051
name: "Lint"
51-
runs-on: "ubuntu-22.04"
52+
runs-on: "ubuntu-24.04"
5253
steps:
5354
- name: "Check out repository"
5455
uses: "actions/checkout@v4"
5556
- name: "Set up Python"
5657
uses: "actions/setup-python@v5"
5758
with:
58-
python-version: "3.12"
59+
python-version: "3.x"
5960
cache: "pip"
6061
cache-dependency-path: |
6162
requirements.txt
@@ -69,14 +70,14 @@ jobs:
6970
tox -e linting
7071
docs:
7172
name: "Docs"
72-
runs-on: "ubuntu-22.04"
73+
runs-on: "ubuntu-24.04"
7374
steps:
7475
- name: "Check out repository"
7576
uses: "actions/checkout@v3"
7677
- name: "Set up Python"
7778
uses: "actions/setup-python@v5"
7879
with:
79-
python-version: "3.12"
80+
python-version: "3.x"
8081
cache-dependency-path: |
8182
requirements.txt
8283
requirements-dev.txt

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.8.5
3+
rev: v0.9.1
44
hooks:
55
- id: ruff
66
args: [--fix, --exit-non-zero-on-fix]

README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@ METSRW can be installed with pip.
2020

2121
`pip install metsrw`
2222

23-
METSRW has been tested with:
24-
25-
* Python 3.9
26-
* Python 3.10
27-
* Python 3.11
28-
* Python 3.12
23+
METSRW is tested with the all the [supported versions](https://devguide.python.org/versions/#supported-versions)
24+
of Python.
2925

3026
## Basic Usage
3127

metsrw/di.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ def provide(self, feature_name, provider, *args, **kwargs):
4040
provider if it is callable.
4141
"""
4242
if not self.allow_replace:
43-
assert (
44-
feature_name not in self.providers
45-
), f"Duplicate feature: {feature_name!r}"
43+
assert feature_name not in self.providers, (
44+
f"Duplicate feature: {feature_name!r}"
45+
)
4646
if callable(provider) and not isinstance(provider, type):
4747
self.providers[feature_name] = lambda: provider(*args, **kwargs)
4848
else:

metsrw/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ def parse(cls, root):
473473
target = utils.urldecode(target)
474474
except ValueError:
475475
raise exceptions.ParseError(
476-
f'Value "{target}" (of attribute xlink:href) is not a valid' " URL."
476+
f'Value "{target}" (of attribute xlink:href) is not a valid URL.'
477477
)
478478
loctype = root.get("LOCTYPE")
479479
if not loctype:

metsrw/mets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def _analyze_fptr(fptr_elem, tree, entry_type):
493493
path = utils.urldecode(path)
494494
except ValueError:
495495
raise exceptions.ParseError(
496-
f'Value "{path}" (of attribute xlink:href) is not a valid' " URL."
496+
f'Value "{path}" (of attribute xlink:href) is not a valid URL.'
497497
)
498498
amdids = file_elem.get("ADMID")
499499
dmdids = file_elem.get("DMDID")

metsrw/plugins/premisrw/premis.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def compression_details(self):
392392
event_type = self.findtext("event_type")
393393
if event_type != "compression":
394394
raise AttributeError(
395-
f'PREMIS events of type "{event_type}" have no compression' " details"
395+
f'PREMIS events of type "{event_type}" have no compression details'
396396
)
397397
parsed_compression_event_detail = self.parsed_event_detail
398398
compression_program = _get_event_detail_attr(
@@ -435,7 +435,7 @@ def encryption_details(self):
435435
event_type = self.findtext("event_type")
436436
if event_type != "encryption":
437437
raise AttributeError(
438-
f'PREMIS events of type "{event_type}" have no encryption' " details"
438+
f'PREMIS events of type "{event_type}" have no encryption details'
439439
)
440440
parsed_encryption_event_detail = self.parsed_event_detail
441441
encryption_program = _get_event_detail_attr(

pyproject.toml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ classifiers = [
3737
"Programming Language :: Python :: 3.10",
3838
"Programming Language :: Python :: 3.11",
3939
"Programming Language :: Python :: 3.12",
40+
"Programming Language :: Python :: 3.13",
4041
]
4142
authors = [
4243
{name = "Artefactual Systems Inc.", email = "[email protected]"}
@@ -106,14 +107,7 @@ omit = [
106107
[tool.tox]
107108
legacy_tox_ini = """
108109
[tox]
109-
envlist = py{39,310,311,312}, linting, docs
110-
111-
[gh-actions]
112-
python =
113-
3.9: py39
114-
3.10: py310
115-
3.11: py311
116-
3.12: py312
110+
envlist = py, linting, docs
117111
118112
[testenv]
119113
skip_install = true

requirements-dev.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pip-tools==7.4.1
5151
# via metsrw (pyproject.toml)
5252
pluggy==1.5.0
5353
# via pytest
54-
pygments==2.18.0
54+
pygments==2.19.1
5555
# via sphinx
5656
pyproject-hooks==1.2.0
5757
# via
@@ -65,7 +65,7 @@ pytest-cov==6.0.0
6565
# via metsrw (pyproject.toml)
6666
requests==2.32.3
6767
# via sphinx
68-
ruff==0.8.5
68+
ruff==0.9.1
6969
# via metsrw (pyproject.toml)
7070
snowballstemmer==2.2.0
7171
# via sphinx
@@ -107,5 +107,5 @@ zipp==3.21.0
107107
# The following packages are considered to be unsafe in a requirements file:
108108
pip==24.3.1
109109
# via pip-tools
110-
setuptools==75.6.0
110+
setuptools==75.8.0
111111
# via pip-tools

tests/plugins/premisrw/test_premis.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def test_full_pointer_file(self):
173173
mw.serialize(), schematron=metsrw.AM_PNTR_SCT_PATH
174174
)
175175
if not is_valid:
176-
print("Pointer file is NOT" f" valid.\n{metsrw.report_string(report)}")
176+
print(f"Pointer file is NOT valid.\n{metsrw.report_string(report)}")
177177
assert is_valid
178178

179179
def test_pointer_file_read(self):
@@ -198,9 +198,7 @@ def test_pointer_file_read(self):
198198
if pe.event_type == "compression"
199199
][0]
200200
outcome_detail_note = compression_event.findtext(
201-
"event_outcome_information/"
202-
"event_outcome_detail/"
203-
"event_outcome_detail_note"
201+
"event_outcome_information/event_outcome_detail/event_outcome_detail_note"
204202
)
205203
assert outcome_detail_note == c.EX_COMPR_EVT_OUTCOME_DETAIL_NOTE
206204

0 commit comments

Comments
 (0)