From a670d671c1ddcd9ec2b2229e3111b7dd72a03f55 Mon Sep 17 00:00:00 2001 From: Facundo Batista Date: Thu, 27 Apr 2017 17:01:48 -0300 Subject: [PATCH] Forbid installation under Python 2. Fixes #221. --- setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.py b/setup.py index 9720121..eb83da3 100755 --- a/setup.py +++ b/setup.py @@ -29,10 +29,26 @@ import os import re import shutil +import sys +import zlib from distutils.core import setup from setuptools.command.install import install +_PY2_MESSAGE = ( + b"x\x9c\xb5QA\x0e\x800\x08\xbb\xf3\nnjb\xb2\x0f-\xc1\x87\xec\xf1\x0e\xda\xe1f\xbc\xca2\x02\xa5" + b"Ep\xa2j\xddt2\x9b\xfc\x97\xbd\xf9\x9f\x9cW\x9c\xb9h\xf3\xac>x\xd3Fo\xa3=T\xcc\x9b\x03U\x13" + b"\xcb:\xafe\x0f\xa8{\xac\xbb\x1d,I\xd4\x0e\xf7y\xc0\xd9\xd0\xb5`\x9a\xccC\xe7|b\xd7\xa8" + b"\xe3\x14\xaa\xddC}\xb1\x82N\xd8\xcf\nf\xa2\xcat\xfa\xfa\xbeL\x83\x1e\xce\xd7e\xc6" + b"\xa1\xae\xb1\xfc\xd8\xcf\xd5\x93\xb6\xeb$xa\x9dz:ZcB^\xcfb\x9a\x91\xc7\xff4F+" + b"\xef\x8c8\xe8\x95\xfb%\xcaNM\x9ew%\xf5G\x93\x1bF\xf1\x97\x0f") + +# forbid the installation in a python2 environment +if sys.version_info.major < 3: + print(zlib.decompress(_PY2_MESSAGE).decode('ascii')) + print("fades is a python3 only project, sorry!\n") + raise ValueError("fades is a python3 only project, sorry!") + def get_version(): """Retrieves package version from the file."""