Skip to content

Commit 417081d

Browse files
authored
Merge pull request #41 from effigies/fix/deps
chore: Drop Python 3.9, test through 3.14, lock test environments
2 parents ba49f4a + 932e320 commit 417081d

File tree

9 files changed

+1258
-53
lines changed

9 files changed

+1258
-53
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,11 @@ updates:
1010
actions-infrastructure:
1111
patterns:
1212
- "actions/*"
13+
- package-ecosystem: uv
14+
directory: "/"
15+
schedule:
16+
interval: monthly
17+
groups:
18+
uv:
19+
patterns:
20+
- "*"

.github/workflows/build-test-deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,18 @@ jobs:
4848
fail-fast: false
4949
matrix:
5050
os: [ubuntu-latest, macos-latest, windows-latest]
51-
python-version: ['3.9', '3.10', '3.11', '3.12']
51+
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
5252
dependencies: ['full', 'pre']
5353
include:
5454
- os: ubuntu-latest
55-
python-version: '3.9'
55+
python-version: '3.10'
5656
dependencies: 'min'
5757
exclude:
5858
# Skip pre-release tests for Pythons out of SPEC0
59-
- python-version: '3.9'
60-
dependencies: pre
6159
- python-version: '3.10'
6260
dependencies: pre
61+
- python-version: '3.11'
62+
dependencies: pre
6363

6464
env:
6565
DEPENDS: ${{ matrix.dependencies }}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ classifiers = [
2020
"Programming Language :: Python",
2121
"Topic :: Scientific/Engineering",
2222
]
23-
requires-python = ">=3.9"
23+
requires-python = ">=3.10"
2424
dependencies = [
2525
"attrs >=24.1",
2626
"bidsschematools >=1.1",

src/bids_validator/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import sys
1111
from collections.abc import Iterator
12-
from typing import Annotated, Optional
12+
from typing import Annotated
1313

1414
from bidsschematools.schema import load_schema
1515
from bidsschematools.types import Namespace
@@ -100,7 +100,7 @@ def version_callback(value: bool):
100100
@app.command()
101101
def main(
102102
bids_path: str,
103-
schema_path: Optional[str] = None,
103+
schema_path: str | None = None,
104104
verbose: Annotated[bool, typer.Option('--verbose', '-v', help='Show verbose output')] = False,
105105
version: Annotated[
106106
bool,

src/bids_validator/bidsignore.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
import os
44
import re
55
from functools import lru_cache
6-
from typing import Protocol, Union
6+
from typing import Protocol
77

88
import attrs
99

1010
from .types.files import FileTree
1111

1212

1313
@lru_cache
14-
def compile_pat(pattern: str) -> Union[re.Pattern, None]:
14+
def compile_pat(pattern: str) -> re.Pattern | None:
1515
"""Compile .gitignore-style ignore lines to regular expressions."""
1616
orig = pattern
1717
# A line starting with # serves as a comment.

src/bids_validator/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def load_tsv(file: FileTree, *, max_rows=0) -> Namespace:
6767
fobj = itertools.islice(fobj, max_rows)
6868
contents = (line.rstrip('\r\n').split('\t') for line in fobj)
6969
# Extract headers then transpose rows to columns
70-
return Namespace(zip(next(contents), zip(*contents)))
70+
return Namespace(zip(next(contents), zip(*contents, strict=False), strict=False))
7171

7272

7373
@cache
@@ -78,7 +78,7 @@ def load_tsv_gz(file: FileTree, headers: tuple[str], *, max_rows=0) -> Namespace
7878
if max_rows > 0:
7979
gzobj = itertools.islice(gzobj, max_rows)
8080
contents = (line.decode().rstrip('\r\n').split('\t') for line in gzobj)
81-
return Namespace(zip(headers, zip(*contents)))
81+
return Namespace(zip(headers, zip(*contents, strict=False), strict=False))
8282

8383

8484
@cache

tests/test_context.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,24 +163,28 @@ def test_sessions(synthetic_dataset):
163163

164164

165165
def test_load_tsv(synthetic_dataset):
166-
167166
tsv_file_tree = synthetic_dataset / 'participants.tsv'
168167
tsv_file = context.load_tsv(tsv_file_tree)
169168

170169
data_set = {
171-
"participant_id": ("sub-01", "sub-02", "sub-03", "sub-04", "sub-05"),
172-
"age": (34, 38, 22, 21, 42),
173-
"sex": ("F", "M", "M", "F", "M")
170+
'participant_id': ('sub-01', 'sub-02', 'sub-03', 'sub-04', 'sub-05'),
171+
'age': (34, 38, 22, 21, 42),
172+
'sex': ('F', 'M', 'M', 'F', 'M'),
174173
}
175174

176175
assert tsv_file.keys() == data_set.keys()
177-
assert [tsv_file[key] == data_set[key] for key in tsv_file.keys()]
176+
assert [tsv_file[key] == data_set[key] for key in tsv_file.keys()]
178177

179178

180179
def test_load_tsv_gz(synthetic_dataset):
181-
182-
headers = ("respiratory", "cardiac")
183-
tsvgz_file_tree = synthetic_dataset / "sub-01" / "ses-01" / "func" /"sub-01_ses-01_task-nback_run-01_stim.tsv.gz"
180+
headers = ('respiratory', 'cardiac')
181+
tsvgz_file_tree = (
182+
synthetic_dataset
183+
/ 'sub-01'
184+
/ 'ses-01'
185+
/ 'func'
186+
/ 'sub-01_ses-01_task-nback_run-01_stim.tsv.gz'
187+
)
184188

185189
tsvgz_file = context.load_tsv_gz(tsvgz_file_tree, headers)
186190

tox.ini

Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,20 @@ requires =
33
tox>=4
44
tox-uv
55
envlist =
6-
py3{9,10,11,12}-{full,pre}
7-
py39-min
6+
py31{0,1,2,3,4}-{full,pre}
7+
py310-min
88
style
99
spellcheck
1010
skip_missing_interpreters = true
1111

1212
# Configuration that allows us to split tests across GitHub runners effectively
1313
[gh-actions]
1414
python =
15-
3.9: py39
1615
3.10: py310
1716
3.11: py311
1817
3.12: py312
18+
3.13: py313
19+
3.14: py314
1920

2021
[gh-actions:env]
2122
DEPENDS =
@@ -46,6 +47,9 @@ pass_env =
4647
CLICOLOR_FORCE
4748
extras =
4849
cli
50+
runner =
51+
full: uv-venv-lock-runner
52+
!full: uv-venv-runner
4953
dependency_groups =
5054
test
5155
uv_resolution =
@@ -60,20 +64,13 @@ commands =
6064
--junitxml=test-results.xml {posargs}
6165
coverage xml
6266

63-
[testenv:docs]
64-
description = Build documentation site
65-
labels = docs
66-
allowlist_externals = make
67-
extras = doc
68-
commands =
69-
make -C doc html
70-
7167
[testenv:style{,-fix}]
7268
description = Check and attempt to fix style
7369
labels = check
7470
deps =
7571
ruff
7672
skip_install = true
73+
runner = uv-venv-runner
7774
commands =
7875
fix: ruff check --fix src/
7976
fix: ruff format src/
@@ -86,29 +83,7 @@ labels = check
8683
deps =
8784
codespell[toml]
8885
skip_install = true
86+
runner = uv-venv-runner
8987
commands =
9088
fix: codespell -w {posargs}
9189
!fix: codespell {posargs}
92-
93-
[testenv:build{,-strict}]
94-
labels =
95-
check
96-
pre-release
97-
deps =
98-
build
99-
twine
100-
skip_install = true
101-
set_env =
102-
build-strict: PYTHONWARNINGS=error,once:Unimplemented abstract methods {'locate_file'}:DeprecationWarning:pip._internal.metadata.importlib._dists,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs
103-
commands =
104-
python -m build
105-
python -m twine check dist/*
106-
107-
[testenv:publish]
108-
depends = build
109-
labels = release
110-
deps =
111-
twine
112-
skip_install = true
113-
commands =
114-
python -m twine upload dist/*

0 commit comments

Comments
 (0)