-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Jim Fulton wrote:
> On Mar 11, 2007, at 11:08 AM, Nathan R. Yergler wrote:
> ...
>> I tried using zc.recipe.testbrowser, thinking that maybe it'd look at
>> the tests_require for the target eggs, but no such luck.
>
> The tests_require option is only visible to the setup script. It
> doesn't cause any data to be included in egg info. It is an
> attractive nuisance IMO.
I hope the attached patch (against the head of the setuptools 0.6
branch) makes it less of a nuisance. The patch adds an egg-info file
entry point which writes the 'tests_require' value to a fill in the
.egg-info directory.
It would be trivial to add another which dumped the 'test_suite' info as
well: perhaps a single ConfigParser-style file with two keys would have
more parsimony.
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 [EMAIL PROTECTED]
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHPHVJ+gerLs4ltQ4RAlGHAJ4o4tJrYInQkWB0Xv6KB3oNhAscHQCg0Kjl
9XLihjJaaU6coaBo/dpwkvE=
=zSQH
-----END PGP SIGNATURE-----
Index: setuptools/command/egg_info.py
===================================================================
--- setuptools/command/egg_info.py (revision 58984)
+++ setuptools/command/egg_info.py (working copy)
@@ -398,6 +398,11 @@
data.append('\n\n[%s]\n%s' % (extra, '\n'.join(yield_lines(reqs))))
cmd.write_or_delete_file("requirements", filename, ''.join(data))
+def write_test_requirements(cmd, basename, filename):
+ dist = cmd.distribution
+ data = ['\n'.join(yield_lines(dist.tests_require or ()))]
+ cmd.write_or_delete_file("test_requirements", filename, ''.join(data))
+
def write_toplevel_names(cmd, basename, filename):
pkgs = dict.fromkeys(
[k.split('.',1)[0]
Index: setup.py
===================================================================
--- setup.py (revision 58984)
+++ setup.py (working copy)
@@ -58,6 +58,8 @@
"egg_info.writers": [
"PKG-INFO = setuptools.command.egg_info:write_pkg_info",
"requires.txt = setuptools.command.egg_info:write_requirements",
+ "tests_require.txt = "
+ "setuptools.command.egg_info:write_test_requirements",
"entry_points.txt = setuptools.command.egg_info:write_entries",
"eager_resources.txt = setuptools.command.egg_info:overwrite_arg",
"namespace_packages.txt = setuptools.command.egg_info:overwrite_arg",
Index: setuptools.egg-info/entry_points.txt
===================================================================
--- setuptools.egg-info/entry_points.txt (revision 58984)
+++ setuptools.egg-info/entry_points.txt (working copy)
@@ -7,6 +7,7 @@
saveopts = setuptools.command.saveopts:saveopts
egg_info = setuptools.command.egg_info:egg_info
register = setuptools.command.register:register
+upload = setuptools.command.upload:upload
install_egg_info = setuptools.command.install_egg_info:install_egg_info
alias = setuptools.command.alias:alias
easy_install = setuptools.command.easy_install:easy_install
@@ -22,6 +23,7 @@
[egg_info.writers]
dependency_links.txt = setuptools.command.egg_info:overwrite_arg
requires.txt = setuptools.command.egg_info:write_requirements
+tests_require.txt = setuptools.command.egg_info:write_test_requirements
PKG-INFO = setuptools.command.egg_info:write_pkg_info
eager_resources.txt = setuptools.command.egg_info:overwrite_arg
top_level.txt = setuptools.command.egg_info:write_toplevel_names
@@ -31,7 +33,7 @@
[console_scripts]
easy_install = setuptools.command.easy_install:main
-easy_install-2.5 = setuptools.command.easy_install:main
+easy_install-2.4 = setuptools.command.easy_install:main
[setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl
_______________________________________________
Distutils-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig