Skip to content

Commit 59d0b8e

Browse files
authored
Remove pylint constraint (#318)
* fix: remove pylint constraint * fix: update tests for new pylint version * build: remove tests for old pylint versions * docs: bump version and add changelog * refactor: fix use-dict-literal warnings
1 parent 50943e5 commit 59d0b8e

File tree

12 files changed

+29
-47
lines changed

12 files changed

+29
-47
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: [ubuntu-20.04]
1818
python-version: ['3.8']
19-
toxenv: [py38, pylint, pylint212]
19+
toxenv: [py38, pylint]
2020

2121
steps:
2222
- uses: actions/checkout@v2

CHANGELOG.rst

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ Change Log
1313
Unreleased
1414
~~~~~~~~~~
1515

16+
5.3.2 - 2023-02-15
17+
~~~~~~~~~~~~~~~~~~
18+
19+
* Removed pylint<2.15 constraint and updated tests for new version
20+
* Removed CI tests for old pylint versions
21+
1622
5.3.1 - 2023-02-14
1723
~~~~~~~~~~~~~~~~~~
1824

edx_lint/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
edx_lint standardizes lint configuration and additional plugins for use in
33
Open edX code.
44
"""
5-
__version__ = "5.3.1"
5+
__version__ = "5.3.2"

edx_lint/pylint/super_check.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from pylint.checkers import BaseChecker, utils
55
try:
66
from pylint.checkers.classes import _ancestors_to_call
7-
except ImportError:
7+
except ImportError: # Backward compatibility with pylint<2.13
88
from pylint.checkers.classes.class_checker import _ancestors_to_call
99
from pylint.interfaces import IAstroidChecker
1010

requirements/base.txt

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# make upgrade
66
#
7-
astroid==2.11.7
7+
astroid==2.14.2
88
# via
99
# pylint
1010
# pylint-celery
@@ -35,9 +35,8 @@ pbr==5.11.1
3535
# via stevedore
3636
platformdirs==3.0.0
3737
# via pylint
38-
pylint==2.14.5
38+
pylint==2.16.2
3939
# via
40-
# -c requirements/constraints.txt
4140
# -r requirements/base.in
4241
# pylint-celery
4342
# pylint-django
@@ -64,12 +63,9 @@ tomli==2.0.1
6463
# via pylint
6564
tomlkit==0.11.6
6665
# via pylint
67-
typing-extensions==4.4.0
66+
typing-extensions==4.5.0
6867
# via
6968
# astroid
7069
# pylint
7170
wrapt==1.14.1
7271
# via astroid
73-
74-
# The following packages are considered to be unsafe in a requirements file:
75-
# setuptools

requirements/constraints.txt

-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
-c ../edx_lint/files/common_constraints.txt
33

44
code-annotations>=1.1.0
5-
6-
# pylint>=2.15.0 contains breaking changes
7-
# Failing python tests will be fixed in a later PR
8-
pylint<2.15.0

requirements/dev.txt

+3-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# make upgrade
66
#
7-
astroid==2.11.7
7+
astroid==2.14.2
88
# via
99
# -r requirements/base.txt
1010
# pylint
@@ -65,9 +65,8 @@ pluggy==1.0.0
6565
# via tox
6666
py==1.11.0
6767
# via tox
68-
pylint==2.14.5
68+
pylint==2.16.2
6969
# via
70-
# -c requirements/constraints.txt
7170
# -r requirements/base.txt
7271
# pylint-celery
7372
# pylint-django
@@ -117,7 +116,7 @@ tox==3.28.0
117116
# tox-battery
118117
tox-battery==0.6.1
119118
# via -r requirements/dev.in
120-
typing-extensions==4.4.0
119+
typing-extensions==4.5.0
121120
# via
122121
# -r requirements/base.txt
123122
# astroid
@@ -128,6 +127,3 @@ wrapt==1.14.1
128127
# via
129128
# -r requirements/base.txt
130129
# astroid
131-
132-
# The following packages are considered to be unsafe in a requirements file:
133-
# setuptools

requirements/pip.txt

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
#
55
# make upgrade
66
#
7+
wheel==0.37.1
8+
# via -r requirements/pip.in
9+
10+
# The following packages are considered to be unsafe in a requirements file:
711
pip==22.1.2
812
# via -r requirements/pip.in
913
setuptools==59.8.0
1014
# via -r requirements/pip.in
11-
wheel==0.37.1
12-
# via -r requirements/pip.in

requirements/test.txt

+4-8
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
asgiref==3.6.0
88
# via django
9-
astroid==2.11.7
9+
astroid==2.14.2
1010
# via
1111
# -r requirements/dev.txt
1212
# pylint
@@ -34,7 +34,7 @@ distlib==0.3.6
3434
# via
3535
# -r requirements/dev.txt
3636
# virtualenv
37-
django==3.2.17
37+
django==3.2.18
3838
# via
3939
# -c requirements/../edx_lint/files/common_constraints.txt
4040
# -r requirements/test.in
@@ -90,9 +90,8 @@ py==1.11.0
9090
# via
9191
# -r requirements/dev.txt
9292
# tox
93-
pylint==2.14.5
93+
pylint==2.16.2
9494
# via
95-
# -c requirements/constraints.txt
9695
# -r requirements/dev.txt
9796
# pylint-celery
9897
# pylint-django
@@ -149,7 +148,7 @@ tox==3.28.0
149148
# tox-battery
150149
tox-battery==0.6.1
151150
# via -r requirements/dev.txt
152-
typing-extensions==4.4.0
151+
typing-extensions==4.5.0
153152
# via
154153
# -r requirements/dev.txt
155154
# astroid
@@ -162,6 +161,3 @@ wrapt==1.14.1
162161
# via
163162
# -r requirements/dev.txt
164163
# astroid
165-
166-
# The following packages are considered to be unsafe in a requirements file:
167-
# setuptools

test/plugins/pylint_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ def run_pylint(source, msg_ids, *cmd_args):
6868

6969
pylint_args = ["source.py", "--disable=all", f"--enable={msg_ids}", "--load-plugins=edx_lint.pylint", *cmd_args]
7070
if pylint_numversion >= (2, 0):
71-
kwargs = dict(do_exit=False)
71+
kwargs = {"do_exit": False}
7272
else:
73-
kwargs = dict(exit=False)
73+
kwargs = {"exit": False}
7474

7575
Run(pylint_args, reporter=reporter, **kwargs)
7676

@@ -122,7 +122,7 @@ def test_invalid_python():
122122
message = messages.pop()
123123
# Pylint 1.x says the source is <string>, Pylint 2.x says <unknown>
124124
message = message.replace("<string>", "XXX").replace("<unknown>", "XXX")
125-
assert message == "1:syntax-error:invalid syntax (XXX, line 1)"
125+
assert message == "1:syntax-error:Parsing failed: 'invalid syntax (XXX, line 1)'"
126126

127127

128128
# I would have tested that the msgids must be valid, but pylint doesn't seem

test/plugins/test_super_check.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def {method}(xyzzy):
3333
).format(method=method)
3434
messages = run_pylint(source, MSG_IDS)
3535
expected = {
36-
"A:super-method-not-called:super(...).{}() not called (unittest.case.TestCase)".format(
36+
"14:non-parent-method-called:{}() was called from a non-parent class (unittest.case.TestCase)".format(
3737
method
3838
)
3939
}
@@ -56,9 +56,7 @@ def {method}(self): #=A
5656
"""
5757
).format(method=method)
5858
messages = run_pylint(source, MSG_IDS)
59-
expected = {
60-
"A:super-method-not-called:super(...).setUpTestData() not called (django.test.testcases.TestCase)"
61-
}
59+
expected = set()
6260
assert expected == messages
6361

6462

tox.ini

+1-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py38, coverage, pylint, pylint212
2+
envlist = py38, coverage, pylint
33

44
[testenv]
55
deps =
@@ -21,14 +21,6 @@ deps =
2121
commands =
2222
pylint edx_lint test setup.py
2323

24-
[testenv:pylint212]
25-
deps =
26-
-r{toxinidir}/requirements/test.txt
27-
commands =
28-
pip install -q pylint<2.13.0
29-
pylint --version
30-
pylint edx_lint test setup.py
31-
3224
[pytest]
3325
addopts = -rfe
3426

0 commit comments

Comments
 (0)