From a6b5a14638d4857f34b67e9bf0040c1212e1782d Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 28 Jan 2013 10:31:18 -0500 Subject: [PATCH] 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. --- setup/swc-installation-test-2.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 -- 2.26.2