diff options
author | pab <devnull@localhost> | 2009-05-23 00:50:35 +0000 |
---|---|---|
committer | pab <devnull@localhost> | 2009-05-23 00:50:35 +0000 |
commit | 4fd9358b534afcaf04b9a1fe63d7c0fe510499a0 (patch) | |
tree | 12c9c3a381b299f40e6efe1ee532e4615a8328b9 /setup.py | |
parent | dcf354f5fe5fce726caa3a480db34c8259e27e2d (diff) |
Require 2.4 or higher
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 19 |
1 files changed, 13 insertions, 6 deletions
@@ -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', |