Skip to content

Commit 98ea2cd

Browse files
authored
Merge pull request #129 from webknjaz/patch-1
Allow installing the plugin with pylint v4 See details in: #129, and in the commit series
2 parents 1bf53a3 + ddd4b4a commit 98ea2cd

13 files changed

Lines changed: 602 additions & 416 deletions

File tree

.github/workflows/checks.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
hashFiles('pyproject.toml', 'requirements/**.txt') }}" >> $GITHUB_OUTPUT
4343
- name: Restore Python virtual environment
4444
id: cache-venv
45-
uses: actions/cache@v4.0.2
45+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
4646
with:
4747
path: .venv
4848
key: >-
@@ -55,7 +55,7 @@ jobs:
5555
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
5656
- name: Restore pre-commit environment
5757
id: cache-precommit
58-
uses: actions/cache@v4.0.2
58+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
5959
with:
6060
path: ${{ env.PRE_COMMIT_CACHE }}
6161
key: >-
@@ -80,14 +80,14 @@ jobs:
8080
check-latest: true
8181
- name: Restore Python virtual environment
8282
id: cache-venv
83-
uses: actions/cache@v4.0.2
83+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
8484
with:
8585
path: .venv
8686
fail-on-cache-miss: true
8787
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{ needs.prepare-base.outputs.python-key }}
8888
- name: Restore pre-commit environment
8989
id: cache-precommit
90-
uses: actions/cache@v4.0.2
90+
uses: actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1
9191
with:
9292
path: ${{ env.PRE_COMMIT_CACHE }}
9393
fail-on-cache-miss: true

.github/workflows/tests.yaml

Lines changed: 5 additions & 5 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:
@@ -62,11 +62,11 @@ jobs:
6262
run: tox --skip-missing-interpreters=true
6363

6464
- name: Upload coverage reports to Codecov
65-
uses: codecov/codecov-action@v3
65+
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
66+
if: ${{ !cancelled() }}
6667
with:
67-
token: ${{ secrets.CODECOV_TOKEN }}
6868
flags: ${{ matrix.os }},${{ matrix.python-version }}
69-
fail_ci_if_error: ${{ github.repository_owner == 'pylint-dev' && 'true' || 'false' }}
69+
fail_ci_if_error: true
7070
files: test_artifacts/cobertura.xml
7171

7272
- name: Create artifacts

.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/

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,19 @@
22

33
## [Unreleased]
44

5+
## [2.0.0a1] - _tbd; started 2025-10-17_
6+
7+
A small pylint update lead into a full-blown dependency updates.
8+
9+
That, additionally, lead to deprecating Python 3.8 and 3.9 support.
10+
_Technically_, as of writing this, https://devguide.python.org/versions/ does NOT show 3.9 as deprecated.
11+
However, many dependencies have already dropped support for them - and, according to the page, 3.9's deprecation date 2025-10.
12+
13+
### Development details / information
14+
15+
The project will _soon_ ™️ migrate to `uv` for anything related to packaging, testing, and building:
16+
https://github.com/pylint-dev/pylint-pytest/issues/132
17+
518
## [2.0.0a0] - 2024-02-02
619

720
### Added

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ Requirements:
2828
To install:
2929

3030
```bash
31-
$ pip install pylint-pytest
31+
pip install pylint-pytest
3232
```
3333

3434
## Usage
3535

3636
Enable via command line option `--load-plugins`
3737

3838
```bash
39-
$ pylint --load-plugins pylint_pytest <path_to_your_sources>
39+
pylint --load-plugins pylint_pytest <path_to_your_sources>
4040
```
4141

4242
Or in `.pylintrc`:
@@ -67,8 +67,7 @@ from fixture_collections import (
6767
) # <- Unused imported_fixture imported from fixture_collections
6868

6969

70-
def test_something(imported_fixture):
71-
...
70+
def test_something(imported_fixture): ...
7271
```
7372

7473
### `redefined-outer-name`
@@ -130,16 +129,14 @@ import pytest
130129

131130

132131
@pytest.fixture
133-
def awesome_fixture():
134-
...
132+
def awesome_fixture(): ...
135133

136134

137135
@pytest.fixture
138136
@pytest.mark.usefixtures(
139137
"awesome_fixture"
140138
) # <- Using useless `@pytest.mark.*` decorator for fixtures
141-
def another_awesome_fixture():
142-
...
139+
def another_awesome_fixture(): ...
143140
```
144141

145142
### W6403 `deprecated-positional-argument-for-pytest-fixture`
@@ -151,8 +148,7 @@ import pytest
151148

152149

153150
@pytest.fixture("module") # <- Using a deprecated positional arguments for fixture
154-
def awesome_fixture():
155-
...
151+
def awesome_fixture(): ...
156152
```
157153

158154
### F6401 `cannot-enumerate-pytest-fixtures`

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: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pylint-pytest"
7-
version = "2.0.0a0"
7+
version = "2.0.0a1"
88
license = {file = "LICENSE"}
99
description = "A Pylint plugin to suppress pytest-related false positives."
1010

@@ -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,9 +39,9 @@ keywords = [
3939
"plugin",
4040
]
4141

42-
requires-python = ">=3.8"
42+
requires-python = ">= 3.10"
4343
dependencies = [
44-
"pylint>=2,<4",
44+
"pylint >=2, <5",
4545
"pytest>=4.6",
4646
]
4747

@@ -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,8 +148,6 @@ fix = true
148148
# (for docstrings, strings and comments in particular).
149149
line-length = 100
150150

151-
target-version = "py38"
152-
153151
[tool.ruff.lint]
154152
select = [
155153
"E", # pycodestyle

0 commit comments

Comments
 (0)