From 438db3b9b29e997a6fc2674c95a2c76192b5a567 Mon Sep 17 00:00:00 2001 From: Anthon van der Neut Date: Mon, 15 Aug 2016 22:46:12 +0200 Subject: initial type info, drop 2.6 --- setup.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e844a81..1807402 100644 --- a/setup.py +++ b/setup.py @@ -233,6 +233,7 @@ class NameSpacePackager(object): self._split = None self.depth = self.full_package_name.count('.') self.command = None + self.python_version() self._pkg = [None, None] # required and pre-installable packages if sys.argv[0] == 'setup.py' and sys.argv[1] == 'install' and \ '--single-version-externally-managed' not in sys.argv: @@ -328,6 +329,23 @@ class NameSpacePackager(object): fp.write('import pkg_resources\n' 'pkg_resources.declare_namespace(__name__)\n') + def python_version(self): + supported = self._pkg_data.get('supported') + if supported is None: + return + if len(supported) == 1: + minimum = supported[0] + else: + for x in supported: + if x[0] == sys.version_info[0]: + minimum = x + break + else: + return + if sys.version_info < minimum: + print('minimum python version(s): ' + str(supported)) + sys.exit(1) + def check(self): try: from pip.exceptions import InstallationError -- cgit v1.2.1