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 4, 2023
1 parent bdb3ff7 commit e0526a8
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- '3.9'
- '3.10'
- '3.11'
# - '3.12' # FixMe: https://github.com/pylint-dev/pylint-pytest/issues/3
- '3.12'

defaults:
run:
Expand Down Expand Up @@ -52,7 +52,10 @@ jobs:
env:
FORCE_COLOR: 1
PYTEST_CI_ARGS: --cov-report=xml --cov-report=html --junitxml=test_artifacts/test_report.xml --color=yes
run: tox --skip-missing-interpreters=true
run: |
TOX_ENV=$(echo "py${{ matrix.python-version }}" | tr -d .)
tox -e $TOX_ENV
shell: bash

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## [Unreleased]

### Added

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

### Removed

- Support for Python 3.6 & 3.7 (#23)
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 @@ -124,13 +124,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.8",
Expand All @@ -43,6 +43,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 @@ -70,13 +70,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 73 in tests/base_tester.py

View check run for this annotation

Codecov / codecov/patch

tests/base_tester.py#L73

Added line #L73 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 = py38,py39,py310,py311
envlist = py{38,39,310,311,312}
skipsdist = True
passenv =
FORCE_COLOR
Expand Down

0 comments on commit e0526a8

Please sign in to comment.