From 1da5e8fc0b7616ad0f9a5b691c4d4d28e6e168f0 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Wed, 17 Nov 2021 13:21:37 -0700 Subject: [PATCH] MNT: Add error message to setup.py for old Python --- setup.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/setup.py b/setup.py index ca1e72111..891f448a9 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,19 @@ import versioneer +if sys.version_info[0] < 3: + error = """ + Siphon greater than 0.9 requires Python 3.7 or above. + If you're using Python 2.7, please install Siphon v0.9.0, + which is the last release that supports Python 2.7, + though it is no longer maintained. + + Python {py} detected. + """.format(py='.'.join([str(v) for v in sys.version_info[:3]])) + + print(error) # noqa: T001 + sys.exit(1) + ver = versioneer.get_version() # Need to conditionally add enum support for older Python