summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/tests.yaml6
-rw-r--r--ChangeLog4
-rw-r--r--README.rst2
-rw-r--r--doc/development_guide/testing.rst2
-rw-r--r--doc/faq.rst2
-rw-r--r--doc/whatsnew/2.14.rst4
-rw-r--r--pylint/checkers/non_ascii_names.py15
-rw-r--r--pylint/constants.py1
-rw-r--r--pylint/extensions/typing.py4
-rw-r--r--requirements_test.txt2
-rw-r--r--setup.cfg3
-rw-r--r--tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py4
-rw-r--r--tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc2
-rw-r--r--tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt1
-rw-r--r--tests/functional/d/deprecated/deprecated_module_py3.rc4
-rw-r--r--tests/functional/i/inconsistent/inconsistent_returns_noreturn.rc3
-rw-r--r--tests/functional/i/inherit_non_class.py1
-rw-r--r--tests/functional/i/inherit_non_class.txt4
-rw-r--r--tox.ini2
19 files changed, 23 insertions, 43 deletions
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index 49bb2f370..05832e02d 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -21,7 +21,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
+ python-version: [3.7, 3.8, 3.9, "3.10"]
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
steps:
@@ -172,7 +172,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
+ python-version: [3.7, 3.8, 3.9, "3.10"]
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
steps:
@@ -224,7 +224,7 @@ jobs:
strategy:
fail-fast: false
matrix:
- python-version: ["pypy-3.6", "pypy-3.7"]
+ python-version: ["pypy-3.7"]
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
steps:
diff --git a/ChangeLog b/ChangeLog
index b9f497c89..b87af0217 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,10 @@ Release date: TBA
..
Put new features here and also in 'doc/whatsnew/2.14.rst'
+* ``Pylint`` now requires Python 3.7.2 or newer to run.
+
+ Closes #4301
+
* ``BaseChecker`` classes now require the ``linter`` argument to be passed.
* Update ``invalid-slots-object`` message to show bad object rather than its inferred value.
diff --git a/README.rst b/README.rst
index 9e4da34d8..aef1e34f1 100644
--- a/README.rst
+++ b/README.rst
@@ -74,7 +74,7 @@ Pylint can be simply installed by running::
pip install pylint
-If you are using Python 3.6.2+, upgrade to get full support for your version::
+If you are using Python 3.7.2+, upgrade to get full support for your version::
pip install pylint --upgrade
diff --git a/doc/development_guide/testing.rst b/doc/development_guide/testing.rst
index af14ad4ab..fa0a988d5 100644
--- a/doc/development_guide/testing.rst
+++ b/doc/development_guide/testing.rst
@@ -32,7 +32,7 @@ Before writing a new test it is often a good idea to ensure that your change isn
breaking a current test. You can run our tests using the tox_ package, as in::
python -m tox
- python -m tox -epy36 # for Python 3.6 suite only
+ python -m tox -epy38 # for Python 3.8 suite only
python -m tox -epylint # for running Pylint over Pylint's codebase
python -m tox -eformatting # for running formatting checks over Pylint's codebase
diff --git a/doc/faq.rst b/doc/faq.rst
index de7288ae5..8d5dbccdc 100644
--- a/doc/faq.rst
+++ b/doc/faq.rst
@@ -48,7 +48,7 @@ supported.
2.4 What versions of Python is Pylint supporting?
--------------------------------------------------
-The supported running environment since Pylint 2.12.1 is Python 3.6.2+.
+The supported running environment since Pylint 2.14.0 is Python 3.7.2+.
3. Running Pylint
diff --git a/doc/whatsnew/2.14.rst b/doc/whatsnew/2.14.rst
index 4d4a0ff54..6f9e312fd 100644
--- a/doc/whatsnew/2.14.rst
+++ b/doc/whatsnew/2.14.rst
@@ -60,6 +60,10 @@ Extensions
Other Changes
=============
+* ``Pylint`` now requires Python 3.7.2 or newer to run.
+
+ Closes #4301
+
* Update ``invalid-slots-object`` message to show bad object rather than its inferred value.
Closes #6101
diff --git a/pylint/checkers/non_ascii_names.py b/pylint/checkers/non_ascii_names.py
index 29de8449e..78dc12ac0 100644
--- a/pylint/checkers/non_ascii_names.py
+++ b/pylint/checkers/non_ascii_names.py
@@ -10,7 +10,6 @@ See: https://www.python.org/dev/peps/pep-0672/#confusable-characters-in-identifi
The following checkers are intended to make users are aware of these issues.
"""
-import sys
from typing import Optional, Union
from astroid import nodes
@@ -18,18 +17,6 @@ from astroid import nodes
from pylint import constants, interfaces, lint
from pylint.checkers import base_checker, utils
-if sys.version_info[:2] >= (3, 7):
- # pylint: disable-next=fixme
- # TODO: Remove after 3.6 has been deprecated
- Py37Str = str
-else:
-
- class Py37Str(str):
- # Allow Python 3.6 compatibility
- def isascii(self: str) -> bool:
- return all("\u0000" <= x <= "\u007F" for x in self)
-
-
NON_ASCII_HELP = (
"Used when the name contains at least one non-ASCII unicode character. "
"See https://www.python.org/dev/peps/pep-0672/#confusable-characters-in-identifiers"
@@ -95,7 +82,7 @@ class NonAsciiNameChecker(base_checker.BaseChecker):
# For some nodes i.e. *kwargs from a dict, the name will be empty
return
- if not (Py37Str(name).isascii()):
+ if not str(name).isascii():
type_label = constants.HUMAN_READABLE_TYPES[node_type]
args = (type_label.capitalize(), name)
diff --git a/pylint/constants.py b/pylint/constants.py
index 84cb6dc22..5428afe0c 100644
--- a/pylint/constants.py
+++ b/pylint/constants.py
@@ -13,7 +13,6 @@ import platformdirs
from pylint.__pkginfo__ import __version__
from pylint.typing import MessageTypesFullName
-PY37_PLUS = sys.version_info[:2] >= (3, 7)
PY38_PLUS = sys.version_info[:2] >= (3, 8)
PY39_PLUS = sys.version_info[:2] >= (3, 9)
diff --git a/pylint/extensions/typing.py b/pylint/extensions/typing.py
index 12ccfdffc..b29b58cf6 100644
--- a/pylint/extensions/typing.py
+++ b/pylint/extensions/typing.py
@@ -367,12 +367,10 @@ class TypingChecker(BaseChecker):
if (
isinstance(inferred, (nodes.FunctionDef, nodes.ClassDef))
and inferred.qname() in TYPING_NORETURN
- # In Python 3.6, NoReturn is alias of '_NoReturn'
# In Python 3.7 - 3.8, NoReturn is alias of '_SpecialForm'
or isinstance(inferred, astroid.bases.BaseInstance)
and isinstance(inferred._proxied, nodes.ClassDef)
- and inferred._proxied.qname()
- in {"typing._NoReturn", "typing._SpecialForm"}
+ and inferred._proxied.qname() == "typing._SpecialForm"
):
self.add_message("broken-noreturn", node=node, confidence=INFERENCE)
break
diff --git a/requirements_test.txt b/requirements_test.txt
index 2e35f584d..c1588ba40 100644
--- a/requirements_test.txt
+++ b/requirements_test.txt
@@ -2,7 +2,7 @@
-r requirements_test_min.txt
coveralls~=3.3
coverage~=6.2
-pre-commit~=2.17;python_full_version>="3.6.2"
+pre-commit~=2.17
tbump~=6.6.0
contributors-txt>=0.7.3
pyenchant~=3.2
diff --git a/setup.cfg b/setup.cfg
index 0b2e74352..5714bfd3c 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -19,7 +19,6 @@ classifiers =
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
- Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
@@ -54,7 +53,7 @@ install_requires =
tomli>=1.1.0;python_version<"3.11"
colorama;sys_platform=="win32"
typing-extensions>=3.10.0;python_version<"3.10"
-python_requires = >=3.6.2
+python_requires = >=3.7.2
[options.extras_require]
testutil=gitpython>3
diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py b/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py
deleted file mode 100644
index 3338c2456..000000000
--- a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.py
+++ /dev/null
@@ -1,4 +0,0 @@
-"""Test that getmoduleinfo is deprecated."""
-import inspect
-
-inspect.getmoduleinfo(inspect) # [deprecated-method]
diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc b/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc
deleted file mode 100644
index 83cd04143..000000000
--- a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.rc
+++ /dev/null
@@ -1,2 +0,0 @@
-[testoptions]
-max_pyver=3.6
diff --git a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt b/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt
deleted file mode 100644
index 77632a157..000000000
--- a/tests/functional/d/deprecated/deprecated_method_getmoduleinfo.txt
+++ /dev/null
@@ -1 +0,0 @@
-deprecated-method:4:::Using deprecated method getmoduleinfo()
diff --git a/tests/functional/d/deprecated/deprecated_module_py3.rc b/tests/functional/d/deprecated/deprecated_module_py3.rc
index 83cd04143..375b36140 100644
--- a/tests/functional/d/deprecated/deprecated_module_py3.rc
+++ b/tests/functional/d/deprecated/deprecated_module_py3.rc
@@ -1,2 +1,2 @@
-[testoptions]
-max_pyver=3.6
+[typing]
+py-version=3.6
diff --git a/tests/functional/i/inconsistent/inconsistent_returns_noreturn.rc b/tests/functional/i/inconsistent/inconsistent_returns_noreturn.rc
index bf9569ba2..dd6cbb598 100644
--- a/tests/functional/i/inconsistent/inconsistent_returns_noreturn.rc
+++ b/tests/functional/i/inconsistent/inconsistent_returns_noreturn.rc
@@ -1,5 +1,2 @@
-[testoptions]
-min_pyver=3.6.2
-
[REFACTORING]
never-returning-functions=sys.exit,sys.getdefaultencoding
diff --git a/tests/functional/i/inherit_non_class.py b/tests/functional/i/inherit_non_class.py
index 7454744d9..e741c7353 100644
--- a/tests/functional/i/inherit_non_class.py
+++ b/tests/functional/i/inherit_non_class.py
@@ -92,7 +92,6 @@ class ParentBad:
return 42
# pylint: disable-next=fixme
-# TODO This should emit 'unsubscriptable-object' for Python 3.6
class Child1(ParentGood[int]):
pass
diff --git a/tests/functional/i/inherit_non_class.txt b/tests/functional/i/inherit_non_class.txt
index 4f9083832..2e94b4001 100644
--- a/tests/functional/i/inherit_non_class.txt
+++ b/tests/functional/i/inherit_non_class.txt
@@ -7,5 +7,5 @@ inherit-non-class:68:0:68:24:NotInheritableBool:Inheriting 'bool', which is not
inherit-non-class:72:0:72:25:NotInheritableRange:Inheriting 'range', which is not a class.:UNDEFINED
inherit-non-class:76:0:76:25:NotInheritableSlice:Inheriting 'slice', which is not a class.:UNDEFINED
inherit-non-class:80:0:80:30:NotInheritableMemoryView:Inheriting 'memoryview', which is not a class.:UNDEFINED
-inherit-non-class:99:0:99:12:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED
-unsubscriptable-object:103:13:103:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED
+inherit-non-class:98:0:98:12:Child2:Inheriting 'ParentBad[int]', which is not a class.:UNDEFINED
+unsubscriptable-object:102:13:102:18:Child3:Value 'Empty' is unsubscriptable:UNDEFINED
diff --git a/tox.ini b/tox.ini
index 550bbf166..0f3192e27 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,6 @@
[tox]
minversion = 2.4
-envlist = formatting, py36, py37, py38, py39, py310, pypy, benchmark
+envlist = formatting, py37, py38, py39, py310, pypy, benchmark
skip_missing_interpreters = true
requires = pip >=21.3.1