diff options
author | PJ Eby <distutils-sig@python.org> | 2005-11-19 20:38:40 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-11-19 20:38:40 +0000 |
commit | 016ae6c42a868bc36c950cd3dc04e75b6ecce7dc (patch) | |
tree | 72fb86d76ad349a9a7bff41e2a5caddbccf9df33 /setuptools | |
parent | 1c5aaf1332c6c00139883eeffe44c563737176ae (diff) | |
download | external_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.tar.gz external_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.tar.bz2 external_python_setuptools-016ae6c42a868bc36c950cd3dc04e75b6ecce7dc.zip |
Added ``tests_require`` keyword to ``setup()``, so that e.g. packages
requiring ``nose`` to run unit tests can make this dependency optional
unless the ``test`` command is run.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041483
Diffstat (limited to 'setuptools')
-rw-r--r-- | setuptools/command/test.py | 8 | ||||
-rw-r--r-- | setuptools/dist.py | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/command/test.py b/setuptools/command/test.py index 200d255d..31f1ae40 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -47,6 +47,9 @@ class test(Command): self.reinitialize_command('build_ext', inplace=1) self.run_command('build_ext') + if self.distribution.tests_require: + self.distribution.fetch_build_eggs(self.distribution.tests_require) + if self.test_suite: cmd = ' '.join(self.test_args) if self.dry_run: @@ -55,6 +58,7 @@ class test(Command): self.announce('running "unittest %s"' % cmd) self.run_tests() + def run_tests(self): import unittest old_path = sys.path[:] @@ -76,7 +80,3 @@ class test(Command): - - - - diff --git a/setuptools/dist.py b/setuptools/dist.py index f0ad6f8b..17c9f149 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -80,14 +80,14 @@ def assert_bool(dist, attr, value): -def check_install_requires(dist, attr, value): +def check_requirements(dist, attr, value): """Verify that install_requires is a valid requirements list""" try: list(pkg_resources.parse_requirements(value)) except (TypeError,ValueError): raise DistutilsSetupError( - "'install_requires' must be a string or list of strings " - "containing valid project/version requirement specifiers" + "%r must be a string or list of strings " + "containing valid project/version requirement specifiers" % (attr,) ) def check_entry_points(dist, attr, value): |