summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorpab <devnull@localhost>2009-05-23 00:50:35 +0000
committerpab <devnull@localhost>2009-05-23 00:50:35 +0000
commit4fd9358b534afcaf04b9a1fe63d7c0fe510499a0 (patch)
tree12c9c3a381b299f40e6efe1ee532e4615a8328b9 /setup.py
parentdcf354f5fe5fce726caa3a480db34c8259e27e2d (diff)
Require 2.4 or higher
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/setup.py b/setup.py
index a0a1fcc..c0a13ee 100644
--- a/setup.py
+++ b/setup.py
@@ -1,14 +1,22 @@
#!/usr/bin/env pythong
-from distutils.core import setup, Command
+import distutils.sysconfig
+
+# Require Python 2.4 or higher, but not 3.x
+py_ver = distutils.sysconfig.get_python_version()
+if (py_ver < '2.4') or (py_ver >= '3.0'):
+ raise ValueError('PyXB requires Python version 2.x where x >= 4 (you have %s)' % (py_ver,))
+
import os
import stat
import re
+from distutils.core import setup, Command
+
class test (Command):
# Brief (40-50 characters) description of the command
- description = "Run all unit tests found "
+ description = "Run all unit tests found in testdirs"
# List of option tuples: long name, short name (None if no short
# name), and help string.
@@ -17,11 +25,12 @@ class test (Command):
def initialize_options (self):
self.testdirs = 'tests'
-
- __TestFile_re = re.compile('^test.*\.py$')
def finalize_options (self):
pass
+ # Regular expression that matches unittest sources
+ __TestFile_re = re.compile('^test.*\.py$')
+
def run (self):
# Walk the tests hierarchy looking for tests
dirs = self.testdirs.split(':')
@@ -92,8 +101,6 @@ class test (Command):
runner = unittest.TextTestRunner()
runner.run(suite)
-# Require Python 2.4
-
setup(name='PyXB',
description = 'Python W3C XML Schema Bindings',
author='Peter A. Bigot',