Skip to content

Commit

Permalink
Merge pull request #4 from nipreps/mnt/py312
Browse files Browse the repository at this point in the history
MNT: Drop Python 3.7 support, test on 3.12
  • Loading branch information
effigies authored Nov 5, 2023
2 parents af4f97a + 0a99485 commit 19f2509
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy3.9']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy3.9']
shell: ['bash']
include:
- os: 'windows-latest'
Expand Down
60 changes: 51 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Version Control",
"Topic :: System :: Software Distribution",
Expand All @@ -30,7 +30,7 @@ dependencies = [
"setuptools_scm >=7",
"packaging",
]
requires-python = ">=3.7"
requires-python = ">=3.8"

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

[tool.black]
extend-exclude = "_version.py"

[tool.isort]
profile = "black"

[tool.mypy]
python_version = "3.7"
python_version = "3.8"

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

[tool.coverage.report]
fail_under = 100

[tool.ruff]
extend-exclude = ["_version.py"]

[tool.ruff.lint]
extend-select = [
"W",
"C90",
"I",
"N",
# "D", # pydocstyle
"UP",
"YTT",
"ANN", # annotations
# "S", # bandit
"BLE",
"FBT",
"B",
"A",
"C4",
"DTZ",
"T10",
"EM",
"EXE",
"ISC",
"ICN",
"PIE",
"T20",
"PYI",
"PT", # pytest-style
"Q",
"RSE",
"RET",
"SLF",
"SLOT",
# "SIM", # simplify
"TID",
"TCH",
"ARG",
"ERA",
"PL",
"FLY",
"PERF",
"RUF",
]

[tool.ruff.lint.isort]
known-first-party = ["nipreps_versions"]
2 changes: 1 addition & 1 deletion src/nipreps_versions/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
try:
from ._version import __version__
from ._version import __version__ # noqa: F401
except ImportError: # pragma: no cover
pass
4 changes: 1 addition & 3 deletions src/nipreps_versions/schemes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import re
import warnings
from datetime import date, datetime, timezone
from typing import Match, Optional
from typing import Optional

import packaging.version
from setuptools_scm.version import (
Expand Down
8 changes: 4 additions & 4 deletions tests/test_schemes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

import pytest
from setuptools_scm import Configuration # type: ignore
from setuptools_scm.version import meta # type: ignore
from setuptools_scm.version import ScmVersion, meta

from nipreps_versions.schemes import next_calver, nipreps_calver

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


@pytest.mark.parametrize(
"version, expected_next",
("version", "expected_next"),
[
pytest.param(m("22.1.0"), "22.1.0", id="exact"),
pytest.param(
Expand Down Expand Up @@ -76,11 +76,11 @@
),
],
)
def test_nipreps_calver(version, expected_next):
def test_nipreps_calver(version: ScmVersion, expected_next: str) -> None:
assert nipreps_calver(version) == expected_next


def test_next_calver():
def test_next_calver() -> None:
# Omit optional arguments always passed by nipreps_calver
assert (
next_calver(
Expand Down
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
[tox]
envlist = py{37,38,39,310,311,py3}
envlist = py{38,39,310,311,312,py3}
skip_missing_interpreters = True
isolated_build = true

[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
pypy-3.9: pypy3

[testenv]
deps =
pytest
pytest-cov
black
isort[colors]
ruff
tomli; python_version < "3.11"
!pypy3: mypy

commands =
black --check --diff --color .
isort --check --diff --color .
ruff .
ruff format --diff .
pytest -sv tests/ --cov=nipreps_versions
!pypy3: mypy src tests

0 comments on commit 19f2509

Please sign in to comment.