From: W. Trevor King Date: Mon, 28 Jan 2013 15:31:18 +0000 (-0500) Subject: swc-installation-test-2.py: Add TornadoPythonPackage for version extraction X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a6b5a14638d4857f34b67e9bf0040c1212e1782d;p=swc-boot-camp.git swc-installation-test-2.py: Add TornadoPythonPackage for version extraction Tornado follows Python's example with tornado.version and tornado.version_info instead of using tornado.__version__. While we could parse tornado.version with our usual machinery, take advantage of the pre-parsed version_info by defining a new class. --- diff --git a/setup/swc-installation-test-2.py b/setup/swc-installation-test-2.py index 882e43c..6650e67 100755 --- a/setup/swc-installation-test-2.py +++ b/setup/swc-installation-test-2.py @@ -492,7 +492,6 @@ for package,name,long_name,minimum_version,and_dependencies in [ ('nose', None, 'Nose Python package', CHECKER['nosetests'].minimum_version, None), ('jinja2', 'jinja', 'Jinja', (2, 6), None), - ('tornado', None, 'Tornado', (2, 0), None), ('zmq', 'pyzmq', 'PyZMQ', (2, 1, 4), None), ('IPython', None, 'IPython Python package', CHECKER['ipython'].minimum_version, ['jinja', 'tornado', 'pyzmq']), @@ -537,6 +536,19 @@ CHECKER['mercurial'] = MercurialPythonPackage( minimum_version=CHECKER['hg'].minimum_version) +class TornadoPythonPackage (PythonPackageDependency): + def _get_version_from_package(self, package): + return package.version + + def _get_parsed_version(self): + package = self._get_package(self.package) + return package.version_info + + +CHECKER['tornado'] = TornadoPythonPackage( + package='tornado', name='tornado', long_name='Tornado', minimum_version=(2, 0)) + + class SQLitePythonPackage (PythonPackageDependency): def _get_version_from_package(self, package): return _sys.version