From fc651fe167a705737cdbdf8ac683ab8f3caf342e Mon Sep 17 00:00:00 2001 From: Pierre Sassoulas Date: Sun, 21 Nov 2021 16:28:27 +0100 Subject: [PATCH] Add an exception at install for python < 3.6.2 --- ChangeLog | 5 +++++ setup.py | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index a8dd154ac4..81173b3ee4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ What's New in astroid 2.9.0? ============================ Release date: TBA +* The last version compatible with python '3.6.0' and '3.6.1' is astroid '2.6.6'. We did not + realize that when adding incompatible typing at the time, and versions might be broken + for this interpreter. 2.9.0 meta-information will permit to download pylint on those + interpreters but the installation will fail and tell you to install '2.6.6' instead. + astroid 2.9.1 will require python >= 3.6.2. What's New in astroid 2.8.6? diff --git a/setup.py b/setup.py index 606849326a..32765eefb7 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,19 @@ +import sys + from setuptools import setup + +class AstroidIncompatiblePythonError(Exception): + def __init__(self) -> None: + super().__init__( + "The last version compatible with python '3.6.0' and '3.6.1' is astroid '2.6.6'" + f"You're using {'.'.join([str(v) for v in sys.version_info[:3]])}. " + "Please install astroid 2.6.6 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." + ) + + +if sys.version_info < (3, 6, 2): + raise AstroidIncompatiblePythonError() setup()