swc-installation-test-2.py: Fix version extraction for sqlite3-python
authorW. Trevor King <wking@tremily.us>
Sun, 30 Dec 2012 18:24:51 +0000 (13:24 -0500)
committerW. Trevor King <wking@tremily.us>
Tue, 1 Jan 2013 14:49:47 +0000 (09:49 -0500)
The 'sqlite3' package has the same version as the standard library.
We only check for it because sometimes (e.g. on Gentoo) Python may be
compiled without this package.

swc-installation-test-2.py

index 7e1f731044efcfcfae8ad64b0297875635b5fc24..f1101eda47aa0a604d6b9f7fce7471090ed9de9d 100755 (executable)
@@ -355,8 +355,6 @@ class PythonPackageDependency (Dependency):
 for package,name,long_name,minimum_version in [
         ('nose', None, 'Nose Python package',
          CHECKER['nosetests'].minimum_version),
-        ('sqlite3', 'sqlite3-python', 'SQLite Python package',
-         CHECKER['sqlite3'].minimum_version),
         ('IPython', None, None, None),
         ('numpy', None, 'NumPy', None),
         ('scipy', None, 'SciPy', None),
@@ -394,6 +392,20 @@ CHECKER['mercurial'] = MercurialPythonPackage(
     minimum_version=CHECKER['hg'].minimum_version)
 
 
+class SQLitePythonPackage (PythonPackageDependency):
+    def _get_version_from_package(self, package):
+        return _sys.version
+
+    def _get_parsed_version(self):
+        return _sys.version_info
+
+
+CHECKER['sqlite3-python'] = SQLitePythonPackage(
+    package='sqlite3', name='sqlite3-python',
+    long_name='SQLite Python package',
+    minimum_version=CHECKER['sqlite3'].minimum_version)
+
+
 class VirtualDependency (Dependency):
     def _check(self):
         return '{0} {1}'.format(