Skip to content

Commit

Permalink
Add python 3.12 and pylint 3.0 compatibility
Browse files Browse the repository at this point in the history
Co-authored-by: Irtaza Akram <irtaza.akram@arbisoft.com>
Co-authored-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
  • Loading branch information
3 people committed Nov 27, 2023
1 parent 7599c01 commit 845dd66
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
- '3.12'
# Python 3.6 is not available in `ubuntu-latest`.
exclude:
- python-version: '3.6'
Expand All @@ -35,6 +35,7 @@ jobs:
- python-version: '3.6'
os: ubuntu-20.04


defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'pwsh' || '/bin/bash --noprofile --norc -Eeuxo pipefail {0}' }}
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## [Unreleased]

### Added

- Support for Python 3.12 (#24)
- Support for Pylint 3 (#24)


## [1.1.6] - 2023-11-20

This is a small bugfix release.
Expand Down
2 changes: 0 additions & 2 deletions pylint_pytest/checkers/class_attr_loader.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
from typing import Optional, Set

from astroid import Assign, Attribute, ClassDef, Name
from pylint.interfaces import IAstroidChecker

from ..utils import _can_use_fixture, _is_class_autouse_fixture
from . import BasePytestChecker


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

in_setup = False
Expand Down
2 changes: 0 additions & 2 deletions pylint_pytest/checkers/fixture.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pylint
import pytest
from pylint.checkers.variables import VariablesChecker
from pylint.interfaces import IAstroidChecker

from ..utils import (
_can_use_fixture,
Expand Down Expand Up @@ -42,7 +41,6 @@ def pytest_collectreport(self, report):


class FixtureChecker(BasePytestChecker):
__implements__ = IAstroidChecker
msgs = {
"W6401": (
"Using a deprecated @pytest.yield_fixture decorator",
Expand Down
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,11 @@ load-plugins= [
"pylint.extensions.broad_try_clause",
"pylint.extensions.check_elif",
"pylint.extensions.code_style",
"pylint.extensions.comparetozero",
"pylint.extensions.comparison_placement",
"pylint.extensions.confusing_elif",
# "pylint.extensions.consider_ternary_expression", # Not a pretty refactoring
"pylint.extensions.docparams",
"pylint.extensions.docstyle",
"pylint.extensions.emptystring",
"pylint.extensions.eq_without_hash",
"pylint.extensions.for_any_all",
"pylint.extensions.mccabe",
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
long_description_content_type="text/markdown",
packages=find_packages(exclude=["tests*", "sandbox"]),
install_requires=[
"pylint<3",
"pylint<4",
"pytest>=4.6",
],
python_requires=">=3.6",
Expand All @@ -45,6 +45,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
Expand Down
4 changes: 1 addition & 3 deletions tests/base_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ def setup_method(self):
self.impacted_checkers = []

for key, value in self.CONFIG.items():
setattr(self.checker.config, key, value)
setattr(self.linter.config, key, value)

Check warning on line 82 in tests/base_tester.py

View check run for this annotation

Codecov / codecov/patch

tests/base_tester.py#L82

Added line #L82 was not covered by tests
self.checker.open()

for checker_class in self.IMPACTED_CHECKER_CLASSES:
checker = checker_class(self.linter)
for key, value in self.CONFIG.items():
setattr(checker.config, key, value)
checker.open()
self.impacted_checkers.append(checker)

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py37,py38,py39,py310,py311
envlist = py{36,37,38,39,310,311,312}
skipsdist = True
passenv =
FORCE_COLOR
Expand Down

0 comments on commit 845dd66

Please sign in to comment.