Add Python version check in setup.py

This commit is contained in:
desbma
2015-06-24 00:24:53 +02:00
parent 0cdc5cc46f
commit 9541f77f86
+5
View File
@@ -3,10 +3,15 @@
import os
import re
import sys
from setuptools import find_packages, setup
if sys.hexversion < 0x3030000:
print("Python version %s is unsupported, >= 3.3.0 is needed" % (".".join(map(str, sys.version_info[:3]))))
exit(1)
with open(os.path.join("hddfancontrol", "__init__.py"), "rt") as f:
version = re.search("__version__ = \"([^\"]+)\"", f.read()).group(1)