Skip to content

Commit 19f2509

Browse files
authored
Merge pull request #4 from nipreps/mnt/py312
MNT: Drop Python 3.7 support, test on 3.12
2 parents af4f97a + 0a99485 commit 19f2509

File tree

6 files changed

+63
-24
lines changed

6 files changed

+63
-24
lines changed

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
strategy:
2828
matrix:
2929
os: ['ubuntu-latest']
30-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9']
30+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9']
3131
shell: ['bash']
3232
include:
3333
- os: 'windows-latest'

pyproject.toml

Lines changed: 51 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ classifiers = [
1515
"Programming Language :: Python",
1616
"Programming Language :: Python :: 3",
1717
"Programming Language :: Python :: 3 :: Only",
18-
"Programming Language :: Python :: 3.7",
1918
"Programming Language :: Python :: 3.8",
2019
"Programming Language :: Python :: 3.9",
2120
"Programming Language :: Python :: 3.10",
2221
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
2323
"Topic :: Software Development :: Libraries",
2424
"Topic :: Software Development :: Version Control",
2525
"Topic :: System :: Software Distribution",
@@ -30,7 +30,7 @@ dependencies = [
3030
"setuptools_scm >=7",
3131
"packaging",
3232
]
33-
requires-python = ">=3.7"
33+
requires-python = ">=3.8"
3434

3535
[project.urls]
3636
Home = "https://github.com/nipreps/version-schemes"
@@ -45,14 +45,8 @@ include = ["tox.ini", "tests/*.py"]
4545
[tool.setuptools_scm]
4646
write_to = "src/nipreps_versions/_version.py"
4747

48-
[tool.black]
49-
extend-exclude = "_version.py"
50-
51-
[tool.isort]
52-
profile = "black"
53-
5448
[tool.mypy]
55-
python_version = "3.7"
49+
python_version = "3.8"
5650

5751
[[tool.mypy.overrides]]
5852
module = ["setuptools_scm.version", "setuptools_scm.config"]
@@ -63,3 +57,51 @@ omit = ["_version.py"]
6357

6458
[tool.coverage.report]
6559
fail_under = 100
60+
61+
[tool.ruff]
62+
extend-exclude = ["_version.py"]
63+
64+
[tool.ruff.lint]
65+
extend-select = [
66+
"W",
67+
"C90",
68+
"I",
69+
"N",
70+
# "D", # pydocstyle
71+
"UP",
72+
"YTT",
73+
"ANN", # annotations
74+
# "S", # bandit
75+
"BLE",
76+
"FBT",
77+
"B",
78+
"A",
79+
"C4",
80+
"DTZ",
81+
"T10",
82+
"EM",
83+
"EXE",
84+
"ISC",
85+
"ICN",
86+
"PIE",
87+
"T20",
88+
"PYI",
89+
"PT", # pytest-style
90+
"Q",
91+
"RSE",
92+
"RET",
93+
"SLF",
94+
"SLOT",
95+
# "SIM", # simplify
96+
"TID",
97+
"TCH",
98+
"ARG",
99+
"ERA",
100+
"PL",
101+
"FLY",
102+
"PERF",
103+
"RUF",
104+
]
105+
106+
[tool.ruff.lint.isort]
107+
known-first-party = ["nipreps_versions"]

src/nipreps_versions/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
try:
2-
from ._version import __version__
2+
from ._version import __version__ # noqa: F401
33
except ImportError: # pragma: no cover
44
pass

src/nipreps_versions/schemes.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import re
2-
import warnings
31
from datetime import date, datetime, timezone
4-
from typing import Match, Optional
2+
from typing import Optional
53

64
import packaging.version
75
from setuptools_scm.version import (

tests/test_schemes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33

44
import pytest
55
from setuptools_scm import Configuration # type: ignore
6-
from setuptools_scm.version import meta # type: ignore
6+
from setuptools_scm.version import ScmVersion, meta
77

88
from nipreps_versions.schemes import next_calver, nipreps_calver
99

1010
m = partial(meta, config=Configuration())
1111

1212

1313
@pytest.mark.parametrize(
14-
"version, expected_next",
14+
("version", "expected_next"),
1515
[
1616
pytest.param(m("22.1.0"), "22.1.0", id="exact"),
1717
pytest.param(
@@ -76,11 +76,11 @@
7676
),
7777
],
7878
)
79-
def test_nipreps_calver(version, expected_next):
79+
def test_nipreps_calver(version: ScmVersion, expected_next: str) -> None:
8080
assert nipreps_calver(version) == expected_next
8181

8282

83-
def test_next_calver():
83+
def test_next_calver() -> None:
8484
# Omit optional arguments always passed by nipreps_calver
8585
assert (
8686
next_calver(

tox.ini

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
[tox]
2-
envlist = py{37,38,39,310,311,py3}
2+
envlist = py{38,39,310,311,312,py3}
33
skip_missing_interpreters = True
44
isolated_build = true
55

66
[gh-actions]
77
python =
8-
3.7: py37
98
3.8: py38
109
3.9: py39
1110
3.10: py310
1211
3.11: py311
12+
3.12: py312
1313
pypy-3.9: pypy3
1414

1515
[testenv]
1616
deps =
1717
pytest
1818
pytest-cov
19-
black
20-
isort[colors]
19+
ruff
2120
tomli; python_version < "3.11"
2221
!pypy3: mypy
2322

2423
commands =
25-
black --check --diff --color .
26-
isort --check --diff --color .
24+
ruff .
25+
ruff format --diff .
2726
pytest -sv tests/ --cov=nipreps_versions
2827
!pypy3: mypy src tests

0 commit comments

Comments
 (0)