Skip to content

Commit dfd23f6

Browse files
authored
Require python 3.7.2+ (#5921)
* Remove env from tox * Add changelog
1 parent 06f67b7 commit dfd23f6

19 files changed

+23
-43
lines changed

.github/workflows/tests.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
strategy:
2222
fail-fast: false
2323
matrix:
24-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
24+
python-version: [3.7, 3.8, 3.9, "3.10"]
2525
outputs:
2626
python-key: ${{ steps.generate-python-key.outputs.key }}
2727
steps:
@@ -172,7 +172,7 @@ jobs:
172172
strategy:
173173
fail-fast: false
174174
matrix:
175-
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
175+
python-version: [3.7, 3.8, 3.9, "3.10"]
176176
outputs:
177177
python-key: ${{ steps.generate-python-key.outputs.key }}
178178
steps:
@@ -224,7 +224,7 @@ jobs:
224224
strategy:
225225
fail-fast: false
226226
matrix:
227-
python-version: ["pypy-3.6", "pypy-3.7"]
227+
python-version: ["pypy-3.7"]
228228
outputs:
229229
python-key: ${{ steps.generate-python-key.outputs.key }}
230230
steps:

ChangeLog

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Release date: TBA
99
..
1010
Put new features here and also in 'doc/whatsnew/2.14.rst'
1111

12+
* ``Pylint`` now requires Python 3.7.2 or newer to run.
13+
14+
Closes #4301
15+
1216
* ``BaseChecker`` classes now require the ``linter`` argument to be passed.
1317

1418
* Update ``invalid-slots-object`` message to show bad object rather than its inferred value.

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Pylint can be simply installed by running::
7474

7575
pip install pylint
7676

77-
If you are using Python 3.6.2+, upgrade to get full support for your version::
77+
If you are using Python 3.7.2+, upgrade to get full support for your version::
7878

7979
pip install pylint --upgrade
8080

doc/development_guide/testing.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Before writing a new test it is often a good idea to ensure that your change isn
3232
breaking a current test. You can run our tests using the tox_ package, as in::
3333

3434
python -m tox
35-
python -m tox -epy36 # for Python 3.6 suite only
35+
python -m tox -epy38 # for Python 3.8 suite only
3636
python -m tox -epylint # for running Pylint over Pylint's codebase
3737
python -m tox -eformatting # for running formatting checks over Pylint's codebase
3838

doc/faq.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ supported.
4848
2.4 What versions of Python is Pylint supporting?
4949
--------------------------------------------------
5050

51-
The supported running environment since Pylint 2.12.1 is Python 3.6.2+.
51+
The supported running environment since Pylint 2.14.0 is Python 3.7.2+.
5252

5353

5454
3. Running Pylint

doc/whatsnew/2.14.rst

+4
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ Extensions
6060
Other Changes
6161
=============
6262

63+
* ``Pylint`` now requires Python 3.7.2 or newer to run.
64+
65+
Closes #4301
66+
6367
* Update ``invalid-slots-object`` message to show bad object rather than its inferred value.
6468

6569
Closes #6101

pylint/checkers/non_ascii_names.py

+1-14
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,13 @@
1010
The following checkers are intended to make users are aware of these issues.
1111
"""
1212

13-
import sys
1413
from typing import Optional, Union
1514

1615
from astroid import nodes
1716

1817
from pylint import constants, interfaces, lint
1918
from pylint.checkers import base_checker, utils
2019

21-
if sys.version_info[:2] >= (3, 7):
22-
# pylint: disable-next=fixme
23-
# TODO: Remove after 3.6 has been deprecated
24-
Py37Str = str
25-
else:
26-
27-
class Py37Str(str):
28-
# Allow Python 3.6 compatibility
29-
def isascii(self: str) -> bool:
30-
return all("\u0000" <= x <= "\u007F" for x in self)
31-
32-
3320
NON_ASCII_HELP = (
3421
"Used when the name contains at least one non-ASCII unicode character. "
3522
"See https://www.python.org/dev/peps/pep-0672/#confusable-characters-in-identifiers"
@@ -95,7 +82,7 @@ def _check_name(
9582
# For some nodes i.e. *kwargs from a dict, the name will be empty
9683
return
9784

98-
if not (Py37Str(name).isascii()):
85+
if not str(name).isascii():
9986
type_label = constants.HUMAN_READABLE_TYPES[node_type]
10087
args = (type_label.capitalize(), name)
10188

pylint/constants.py

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from pylint.__pkginfo__ import __version__
1414
from pylint.typing import MessageTypesFullName
1515

16-
PY37_PLUS = sys.version_info[:2] >= (3, 7)
1716
PY38_PLUS = sys.version_info[:2] >= (3, 8)
1817
PY39_PLUS = sys.version_info[:2] >= (3, 9)
1918

pylint/extensions/typing.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -367,12 +367,10 @@ def _check_broken_noreturn(self, node: Union[nodes.Name, nodes.Attribute]) -> No
367367
if (
368368
isinstance(inferred, (nodes.FunctionDef, nodes.ClassDef))
369369
and inferred.qname() in TYPING_NORETURN
370-
# In Python 3.6, NoReturn is alias of '_NoReturn'
371370
# In Python 3.7 - 3.8, NoReturn is alias of '_SpecialForm'
372371
or isinstance(inferred, astroid.bases.BaseInstance)
373372
and isinstance(inferred._proxied, nodes.ClassDef)
374-
and inferred._proxied.qname()
375-
in {"typing._NoReturn", "typing._SpecialForm"}
373+
and inferred._proxied.qname() == "typing._SpecialForm"
376374
):
377375
self.add_message("broken-noreturn", node=node, confidence=INFERENCE)
378376
break

requirements_test.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-r requirements_test_min.txt
33
coveralls~=3.3
44
coverage~=6.2
5-
pre-commit~=2.17;python_full_version>="3.6.2"
5+
pre-commit~=2.17
66
tbump~=6.6.0
77
contributors-txt>=0.7.3
88
pyenchant~=3.2

setup.cfg

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ classifiers =
1919
Programming Language :: Python
2020
Programming Language :: Python :: 3
2121
Programming Language :: Python :: 3 :: Only
22-
Programming Language :: Python :: 3.6
2322
Programming Language :: Python :: 3.7
2423
Programming Language :: Python :: 3.8
2524
Programming Language :: Python :: 3.9
@@ -54,7 +53,7 @@ install_requires =
5453
tomli>=1.1.0;python_version<"3.11"
5554
colorama;sys_platform=="win32"
5655
typing-extensions>=3.10.0;python_version<"3.10"
57-
python_requires = >=3.6.2
56+
python_requires = >=3.7.2
5857
5958
[options.extras_require]
6059
testutil=gitpython>3

tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py

-4
This file was deleted.

tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc

-2
This file was deleted.

tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
[testoptions]
2-
max_pyver=3.6
1+
[typing]
2+
py-version=3.6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
[testoptions]
2-
min_pyver=3.6.2
3-
41
[REFACTORING]
52
never-returning-functions=sys.exit,sys.getdefaultencoding

tests/functional/i/inherit_non_class.py

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ def __class_getitem__(cls, item): # pylint: disable=unused-argument
9292
return 42
9393

9494
# pylint: disable-next=fixme
95-
# TODO This should emit 'unsubscriptable-object' for Python 3.6
9695
class Child1(ParentGood[int]):
9796
pass
9897

tests/functional/i/inherit_non_class.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ inherit-non-class:68:0:68:24:NotInheritableBool:Inheriting 'bool', which is not
77
inherit-non-class:72:0:72:25:NotInheritableRange:Inheriting 'range', which is not a class.:UNDEFINED
88
inherit-non-class:76:0:76:25:NotInheritableSlice:Inheriting 'slice', which is not a class.:UNDEFINED
99
inherit-non-class:80:0:80:30:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:UNDEFINED
10-
inherit-non-class:99:0:99:12:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED
11-
unsubscriptable-object:103:13:103:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED
10+
inherit-non-class:98:0:98:12:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED
11+
unsubscriptable-object:102:13:102:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED

tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
minversion = 2.4
3-
envlist = formatting, py36, py37, py38, py39, py310, pypy, benchmark
3+
envlist = formatting, py37, py38, py39, py310, pypy, benchmark
44
skip_missing_interpreters = true
55
requires = pip >=21.3.1
66

0 commit comments

Comments
 (0)