From b2cb35bd584d5c866971afa366a65b1ce09a0319 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 17 Oct 2021 11:05:18 +0200 Subject: [PATCH 1/5] Add an exception for python < 3.6.2 See https://github.com/PyCQA/pylint/issues/5065 for reasoning --- setup.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/setup.py b/setup.py index 606849326a..20c0f86af8 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,21 @@ +import sys + from setuptools import setup + +class PylintIncompatiblePythonError(Exception): + def __init__(self, major, minor, patch): + super().__init__( + f"The last version compatible with python <= 3.6.2 is pylint '2.9.3'." + f"You're using {major}.{minor}.{patch}. " + "Please install pylint 2.9.3 explicitly or upgrade your python interpreter " + "to at least 3.6.2. Remember that python 3.6 end life is December 2021." + "See https://github.com/PyCQA/pylint/issues/5065 for more detail." + ) + + +version = sys.version_info[:3] +if version < (3, 6, 2): + raise PylintIncompatiblePythonError(*version) + setup() From 25272fd88f0884dce319559726b8daf15cda51fd Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 17 Oct 2021 11:28:03 +0200 Subject: [PATCH 2/5] Apply suggestions from code review Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- setup.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 20c0f86af8..1eeb9c82ca 100644 --- a/setup.py +++ b/setup.py @@ -4,18 +4,17 @@ class PylintIncompatiblePythonError(Exception): - def __init__(self, major, minor, patch): + def __init__(self, version_info: sys._version_info) -> None: super().__init__( - f"The last version compatible with python <= 3.6.2 is pylint '2.9.3'." - f"You're using {major}.{minor}.{patch}. " + "The last version compatible with Python <= 3.6.2 is pylint '2.9.3'. " + f"You're using {'.'.join(map(str, version_info[:3]))}. " "Please install pylint 2.9.3 explicitly or upgrade your python interpreter " - "to at least 3.6.2. Remember that python 3.6 end life is December 2021." + "to at least 3.6.2. Remember that Python 3.6 end life is December 2021. " "See https://github.com/PyCQA/pylint/issues/5065 for more detail." ) -version = sys.version_info[:3] -if version < (3, 6, 2): - raise PylintIncompatiblePythonError(*version) +if sys.version_info < (3, 6, 2): + raise PylintIncompatiblePythonError(sys.version_info) setup() From a1633b090a7388c8fb0d4ef258b3932aaa5721a7 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Sun, 17 Oct 2021 11:29:52 +0200 Subject: [PATCH 3/5] Fix typing --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1eeb9c82ca..5d69ccb471 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ class PylintIncompatiblePythonError(Exception): - def __init__(self, version_info: sys._version_info) -> None: + def __init__(self, version_info: "sys._version_info") -> None: super().__init__( "The last version compatible with Python <= 3.6.2 is pylint '2.9.3'. " f"You're using {'.'.join(map(str, version_info[:3]))}. " From c5ce8dc40738e7ce9f1dd2d7429429dfbbca8ad5 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 17 Oct 2021 11:30:59 +0200 Subject: [PATCH 4/5] fix --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 5d69ccb471..175aad601f 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,10 @@ class PylintIncompatiblePythonError(Exception): - def __init__(self, version_info: "sys._version_info") -> None: + def __init__(self, version_info: "sys._version_info" = sys.version_info) -> None: super().__init__( "The last version compatible with Python <= 3.6.2 is pylint '2.9.3'. " - f"You're using {'.'.join(map(str, version_info[:3]))}. " + f"You're using {'.'.join([str(v) for v in version_info[:3]])}. " "Please install pylint 2.9.3 explicitly or upgrade your python interpreter " "to at least 3.6.2. Remember that Python 3.6 end life is December 2021. " "See https://github.com/PyCQA/pylint/issues/5065 for more detail." @@ -15,6 +15,6 @@ def __init__(self, version_info: "sys._version_info") -> None: if sys.version_info < (3, 6, 2): - raise PylintIncompatiblePythonError(sys.version_info) + raise PylintIncompatiblePythonError() setup() From 384b93ad04934f09e1e36c2391ed2ced949692b4 Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 17 Oct 2021 11:38:07 +0200 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 175aad601f..a6ee6b4aaa 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,10 @@ class PylintIncompatiblePythonError(Exception): - def __init__(self, version_info: "sys._version_info" = sys.version_info) -> None: + def __init__(self) -> None: super().__init__( "The last version compatible with Python <= 3.6.2 is pylint '2.9.3'. " - f"You're using {'.'.join([str(v) for v in version_info[:3]])}. " + f"You're using {'.'.join([str(v) for v in sys.version_info[:3]])}. " "Please install pylint 2.9.3 explicitly or upgrade your python interpreter " "to at least 3.6.2. Remember that Python 3.6 end life is December 2021. " "See https://github.com/PyCQA/pylint/issues/5065 for more detail."