Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require python 3.7.2+ #5921

Merged
merged 6 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
timeout-minutes: 10
strategy:
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:
Expand Down Expand Up @@ -199,7 +199,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"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.0
Expand Down Expand Up @@ -335,7 +335,7 @@ jobs:
needs: pytest-linux
strategy:
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:
Expand Down Expand Up @@ -380,7 +380,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"]
steps:
- name: Set temp directory
run: echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV
Expand Down Expand Up @@ -417,7 +417,7 @@ jobs:
timeout-minutes: 10
strategy:
matrix:
python-version: ["pypy-3.6", "pypy-3.7"]
python-version: ["pypy-3.7"]
outputs:
python-key: ${{ steps.generate-python-key.outputs.key }}
steps:
Expand Down Expand Up @@ -462,7 +462,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy-3.6", "pypy-3.7"]
python-version: ["pypy-3.7"]
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.0.0
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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

Expand Down
2 changes: 1 addition & 1 deletion doc/development_guide/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion doc/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions pylint/checkers/non_ascii_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@
The following checkers are intended to make users are aware of these issues.
"""

import sys
from typing import Optional, Union

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"
Expand Down Expand Up @@ -96,7 +83,7 @@ def _check_name(
# 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)

Expand Down
1 change: 0 additions & 1 deletion pylint/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
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)

Expand Down
5 changes: 1 addition & 4 deletions pylint/extensions/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,12 +361,9 @@ def _check_broken_noreturn(self, node: Union[nodes.Name, nodes.Attribute]) -> No
if (
isinstance(inferred, (nodes.FunctionDef, nodes.ClassDef))
and inferred.qname() in TYPING_NORETURN
DanielNoord marked this conversation as resolved.
Show resolved Hide resolved
# In Python 3.6, NoReturn is alias of '_NoReturn'
# In Python 3.7 - 3.8, NoReturn is alias of '_SpecialForm'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would leave the second line.

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
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
pyenchant~=3.2
pytest-cov~=3.0
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 2 additions & 2 deletions tests/functional/d/deprecated/deprecated_module_py3.rc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[testoptions]
max_pyver=3.6
[typing]
py-version=3.6
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[testoptions]
min_pyver=3.6.2

[REFACTORING]
never-returning-functions=sys.exit,sys.getdefaultencoding
1 change: 0 additions & 1 deletion tests/functional/i/inherit_non_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def __class_getitem__(cls, item): # pylint: disable=unused-argument
return 42

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

Expand Down
4 changes: 2 additions & 2 deletions tests/functional/i/inherit_non_class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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

Expand Down