Skip to content

Commit e0526a8

Browse files
Pierre-Sassoulasirtazaakramstdedos
committed
Add python 3.12 and pylint 3.0 compatibility
Co-authored-by: Irtaza Akram <[email protected]> Co-authored-by: Stavros Ntentos <[email protected]>
1 parent bdb3ff7 commit e0526a8

File tree

8 files changed

+14
-13
lines changed

8 files changed

+14
-13
lines changed

.github/workflows/run-tests.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- '3.9'
2525
- '3.10'
2626
- '3.11'
27-
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
27+
- '3.12'
2828

2929
defaults:
3030
run:
@@ -52,7 +52,10 @@ jobs:
5252
env:
5353
FORCE_COLOR: 1
5454
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
55-
run: tox --skip-missing-interpreters=true
55+
run: |
56+
TOX_ENV=$(echo "py${{ matrix.python-version }}" | tr -d .)
57+
tox -e $TOX_ENV
58+
shell: bash
5659

5760
- name: Upload coverage reports to Codecov
5861
uses: codecov/codecov-action@v3

CHANGELOG.md

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

33
## [Unreleased]
44

5+
### Added
6+
7+
- Support for Python 3.12 (#24)
8+
- Support for Pylint 3 (#24)
9+
510
### Removed
611

712
- Support for Python 3.6 & 3.7 (#23)

pylint_pytest/checkers/class_attr_loader.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
from typing import Optional, Set
22

33
from astroid import Assign, Attribute, ClassDef, Name
4-
from pylint.interfaces import IAstroidChecker
54

65
from ..utils import _can_use_fixture, _is_class_autouse_fixture
76
from . import BasePytestChecker
87

98

109
class ClassAttrLoader(BasePytestChecker):
11-
__implements__ = IAstroidChecker
1210
msgs = {"E6400": ("", "pytest-class-attr-loader", "")}
1311

1412
in_setup = False

pylint_pytest/checkers/fixture.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import pylint
99
import pytest
1010
from pylint.checkers.variables import VariablesChecker
11-
from pylint.interfaces import IAstroidChecker
1211

1312
from ..utils import (
1413
_can_use_fixture,
@@ -42,7 +41,6 @@ def pytest_collectreport(self, report):
4241

4342

4443
class FixtureChecker(BasePytestChecker):
45-
__implements__ = IAstroidChecker
4644
msgs = {
4745
"W6401": (
4846
"Using a deprecated @pytest.yield_fixture decorator",

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,11 @@ load-plugins= [
124124
"pylint.extensions.broad_try_clause",
125125
"pylint.extensions.check_elif",
126126
"pylint.extensions.code_style",
127-
"pylint.extensions.comparetozero",
128127
"pylint.extensions.comparison_placement",
129128
"pylint.extensions.confusing_elif",
130129
# "pylint.extensions.consider_ternary_expression", # Not a pretty refactoring
131130
"pylint.extensions.docparams",
132131
"pylint.extensions.docstyle",
133-
"pylint.extensions.emptystring",
134132
"pylint.extensions.eq_without_hash",
135133
"pylint.extensions.for_any_all",
136134
"pylint.extensions.mccabe",

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
long_description_content_type="text/markdown",
2929
packages=find_packages(exclude=["tests*", "sandbox"]),
3030
install_requires=[
31-
"pylint<3",
31+
"pylint<4",
3232
"pytest>=4.6",
3333
],
3434
python_requires=">=3.8",
@@ -43,6 +43,7 @@
4343
"Programming Language :: Python :: 3.9",
4444
"Programming Language :: Python :: 3.10",
4545
"Programming Language :: Python :: 3.11",
46+
"Programming Language :: Python :: 3.12",
4647
"Programming Language :: Python :: Implementation :: CPython",
4748
"Operating System :: OS Independent",
4849
"License :: OSI Approved :: MIT License",

tests/base_tester.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,11 @@ def setup_method(self):
7070
self.impacted_checkers = []
7171

7272
for key, value in self.CONFIG.items():
73-
setattr(self.checker.config, key, value)
73+
setattr(self.linter.config, key, value)
7474
self.checker.open()
7575

7676
for checker_class in self.IMPACTED_CHECKER_CLASSES:
7777
checker = checker_class(self.linter)
78-
for key, value in self.CONFIG.items():
79-
setattr(checker.config, key, value)
8078
checker.open()
8179
self.impacted_checkers.append(checker)
8280

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py38,py39,py310,py311
2+
envlist = py{38,39,310,311,312}
33
skipsdist = True
44
passenv =
55
FORCE_COLOR

0 commit comments

Comments
 (0)