5 py_vers_tag = '-%s.%s' % sys.version_info[:2]
7 test_dirs = ['functional_tests', 'unit_tests', os.path.join('doc','doc_tests'), 'nose']
9 if sys.version_info >= (3,):
13 from distribute_setup import use_setuptools
16 extra = {'use_2to3': True,
17 'test_dirs': test_dirs,
18 'test_build_dir': 'build/tests',
19 'pyversion_patching': True,
25 from setup3lib import setup
26 from setuptools import find_packages
29 packages = find_packages(),
32 'nosetests = nose:run_exit',
33 'nosetests%s = nose:run_exit' % py_vers_tag,
35 'distutils.commands': [
36 ' nosetests = nose.commands:nosetests',
39 test_suite = 'nose.collector',
41 addl_args.update(extra)
43 # This is required by multiprocess plugin; on Windows, if
44 # the launch script is not import-safe, spawned processes
45 # will re-run it, resulting in an infinite loop.
46 if sys.platform == 'win32':
48 from setuptools.command.easy_install import easy_install
50 def wrap_write_script(self, script_name, contents, *arg, **kwarg):
51 bad_text = re.compile(
54 " load_entry_point\(([^\)]+)\)\(\)\n"
58 "if __name__ == '__main__':\n"
60 r" load_entry_point(\1)()\n"
63 contents = bad_text.sub(good_text, contents)
64 return self._write_script(script_name, contents, *arg, **kwarg)
65 easy_install._write_script = easy_install.write_script
66 easy_install.write_script = wrap_write_script
69 from distutils.core import setup
71 packages = ['nose', 'nose.ext', 'nose.plugins', 'nose.sphinx'],
72 scripts = ['bin/nosetests'],
78 author = 'Jason Pellerin',
79 author_email = 'jpellerin+nose@gmail.com',
80 description = ('nose extends unittest to make testing easier'),
82 """nose extends the test loading and running features of unittest, making
83 it easier to write, find and run tests.
85 By default, nose will run tests in files or directories under the current
86 working directory whose names include "test" or "Test" at a word boundary
87 (like "test_this" or "functional_test" or "TestClass" but not
88 "libtest"). Test output is similar to that of unittest, but also includes
89 captured stdout output from failing tests, for easy print-style debugging.
91 These features, and many more, are customizable through the use of
92 plugins. Plugins included with nose provide support for doctest, code
93 coverage and profiling, flexible attribute-based test selection,
94 output capture and more. More information about writing plugins may be
95 found on in the nose API documentation, here:
96 http://readthedocs.org/docs/nose/
98 If you have recently reported a bug marked as fixed, or have a craving for
99 the very latest, you may want the development version instead:
100 https://github.com/nose-devs/nose/tarball/master#egg=nose-dev
102 license = 'GNU LGPL',
103 keywords = 'test unittest doctest automatic discovery',
104 url = 'http://readthedocs.org/docs/nose/',
105 data_files = [('man/man1', ['nosetests.1'])],
106 package_data = {'': ['*.txt',
110 'Development Status :: 5 - Production/Stable',
111 'Intended Audience :: Developers',
112 'License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)',
113 'Natural Language :: English',
114 'Operating System :: OS Independent',
115 'Programming Language :: Python',
116 'Programming Language :: Python :: 3',
117 'Topic :: Software Development :: Testing'