Skip to content

Commit 78e5368

Browse files
committed
Upgrade project to >=3.10: Deprecate 3.8 / 3.9; test against 3.13 / 3.14; pre-commit autoupdate + pyupgrade
Due to the https://results.pre-commit.ci/run/github/602434841/1767562414.bHoKHEk8SOKSdCCfiG_vow: * We need to upgrade to at least 3.9 python (mypy) * `pylint/checkers/variables.py:112: error: Pattern matching is only supported in Python 3.10 and greater [syntax]` ... and because 3.9 is soon-to-be EOL _as of writing this_, let us deprecate this one too. Additionally, adding `https://github.com/asottile/pyupgrade` will help with the transition Signed-off-by: Stavros Ntentos <[email protected]>
1 parent e6405e3 commit 78e5368

7 files changed

Lines changed: 26 additions & 21 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ jobs:
2020
- windows-latest
2121
- macos-latest
2222
python-version:
23-
- '3.8'
24-
- '3.9'
2523
- '3.10'
2624
- '3.11'
2725
- '3.12'
26+
- '3.13'
27+
- '3.14'
2828

2929
defaults:
3030
run:

.pre-commit-config.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ci:
44

55
repos:
66
- repo: https://github.com/pre-commit/pre-commit-hooks
7-
rev: v4.6.0
7+
rev: v6.0.0
88
hooks:
99
- id: end-of-file-fixer
1010
exclude: ^.idea/
@@ -34,23 +34,28 @@ repos:
3434
- '4'
3535
- --offset
3636
- '2'
37+
- repo: https://github.com/asottile/pyupgrade
38+
rev: v3.21.2
39+
hooks:
40+
- id: pyupgrade
3741
- repo: https://github.com/astral-sh/ruff-pre-commit
38-
rev: v0.6.8
42+
rev: v0.14.10
3943
hooks:
40-
- id: ruff
44+
- id: ruff-format
45+
- id: ruff-check
4146
args:
4247
- --fix
4348
exclude: tests/input/
4449
- repo: https://github.com/psf/black
45-
rev: 24.8.0
50+
rev: 25.12.0
4651
hooks:
4752
- id: black
4853
- repo: https://github.com/asottile/blacken-docs
49-
rev: 1.18.0
54+
rev: 1.20.0
5055
hooks:
5156
- id: blacken-docs
5257
additional_dependencies:
53-
- black==24.8.0
58+
- black==25.12.0
5459
- repo: https://github.com/pre-commit/pygrep-hooks
5560
rev: v1.10.0
5661
hooks:
@@ -74,7 +79,7 @@ repos:
7479
language: pygrep
7580
types: [python]
7681
- repo: https://github.com/pre-commit/mirrors-mypy
77-
rev: v1.11.2
82+
rev: v1.19.1
7883
hooks:
7984
- id: mypy
8085
exclude: tests/input/

pylint_pytest/checkers/class_attr_loader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
22

3-
from astroid import Assign, Attribute, ClassDef, Name
3+
from astroid.nodes import Assign, Attribute, ClassDef, Name
44

55
from ..utils import _can_use_fixture, _is_class_autouse_fixture
66
from . import BasePytestChecker
@@ -33,7 +33,7 @@ def visit_assign(self, node: Assign):
3333
and node.value.expr.name == "request"
3434
):
3535
# storing the aliases for cls from request.cls
36-
self.request_cls = set(t.name for t in node.targets)
36+
self.request_cls = {t.name for t in node.targets}
3737

3838
def visit_assignattr(self, node):
3939
if (

pylint_pytest/checkers/fixture.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def visit_module(self, node):
130130

131131
FixtureChecker._pytest_fixtures = fixture_collector.fixtures
132132

133-
legitimate_failure_paths = set(
133+
legitimate_failure_paths = {
134134
collection_report.nodeid
135135
for collection_report in fixture_collector.errors
136136
if any(
@@ -140,7 +140,7 @@ def visit_module(self, node):
140140
)
141141
for pattern in FILE_NAME_PATTERNS
142142
)
143-
)
143+
}
144144
if (ret != pytest.ExitCode.OK or legitimate_failure_paths) and is_test_module:
145145
files_to_report = {
146146
str(Path(x).absolute().relative_to(Path.cwd()))

pylint_pytest/checkers/types.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import annotations
22

3-
from typing import Any, Dict, List
3+
from typing import Any
44

55
from _pytest.fixtures import FixtureDef
66

7-
FixtureDict = Dict[str, List[FixtureDef[Any]]]
7+
FixtureDict = dict[str, list[FixtureDef[Any]]]

pylint_pytest/checkers/variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import Any
44

5-
from astroid import Arguments, Module, NodeNG
5+
from astroid.nodes import Arguments, Module, NodeNG
66
from pylint.checkers.variables import VariablesChecker
77
from pylint.interfaces import Confidence
88

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ classifiers = [
2424
"Topic :: Software Development :: Quality Assurance",
2525
"Programming Language :: Python",
2626
"Programming Language :: Python :: 3",
27-
"Programming Language :: Python :: 3.8",
28-
"Programming Language :: Python :: 3.9",
2927
"Programming Language :: Python :: 3.10",
3028
"Programming Language :: Python :: 3.11",
3129
"Programming Language :: Python :: 3.12",
30+
"Programming Language :: Python :: 3.13",
31+
"Programming Language :: Python :: 3.14",
3232
"Programming Language :: Python :: Implementation :: CPython",
3333
"Operating System :: OS Independent",
3434
"License :: OSI Approved :: MIT License",
@@ -39,7 +39,7 @@ keywords = [
3939
"plugin",
4040
]
4141

42-
requires-python = ">=3.8"
42+
requires-python = ">=3.10"
4343
dependencies = [
4444
"pylint >=2, <5",
4545
"pytest>=4.6",
@@ -106,7 +106,7 @@ paths.source = [
106106
profile = "black"
107107

108108
[tool.mypy]
109-
python_version = "3.8"
109+
python_version = "3.10"
110110
check_untyped_defs = true
111111
explicit_package_bases = true
112112
namespace_packages = true
@@ -148,7 +148,7 @@ fix = true
148148
# (for docstrings, strings and comments in particular).
149149
line-length = 100
150150

151-
target-version = "py38"
151+
target-version = "py310"
152152

153153
[tool.ruff.lint]
154154
select = [

0 commit comments

Comments
 (0)