Ver Fonte

If setuptools is installed, "python setup.py test" will now run the testsuite.

Jelmer Vernooij há 13 anos atrás
pai
commit
50fe8b9bad
2 ficheiros alterados com 13 adições e 0 exclusões
  1. 5 0
      NEWS
  2. 8 0
      setup.py

+ 5 - 0
NEWS

@@ -22,6 +22,11 @@
   * write_pack_data has been renamed to write_pack_objects and no longer takes a
     num_objects argument. (Jelmer Vernooij)
 
+ TEST CHANGES
+
+  * If setuptools is installed, "python setup.py test" will now run the testsuite.
+    (Jelmer Vernooij)
+
 0.7.1	2011-04-12
 
  BUG FIXES

+ 8 - 0
setup.py

@@ -4,8 +4,10 @@
 
 try:
     from setuptools import setup, Extension
+    has_setuptools = True
 except ImportError:
     from distutils.core import setup, Extension
+    has_setuptools = False
 from distutils.core import Distribution
 
 dulwich_version_string = '0.8.0'
@@ -55,6 +57,11 @@ if sys.platform == 'darwin' and os.path.exists('/usr/bin/xcodebuild'):
         int(version.split()[1].split('.')[0]) >= 4):
         os.environ['ARCHFLAGS'] = ''
 
+setup_kwargs = {}
+
+if has_setuptools:
+    setup_kwargs['test_suite'] = 'dulwich.tests'
+
 setup(name='dulwich',
       description='Python Git Library',
       keywords='git',
@@ -83,4 +90,5 @@ setup(name='dulwich',
               include_dirs=include_dirs),
           ],
       distclass=DulwichDistribution,
+      **setup_kwargs
       )