-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jim Fulton wrote:
> On Nov 15, 2007, at 10:52 AM, Tres Seaver wrote:
> ...
>>> Grrrrr. I find "setup.py test" to be really annoying as it requires
>>> meta data that is available only to that command.
>> Not after running 'egg_info', or any other setuptools-aware command;
>> the tests_require dependencies then become introspectable.  E.g.:
>>
>>  $ svn co $ZSVN/zope.tal/trunk zope.tal-trunk
>>  $ cd zope.tal-trunk
>>  $ /path/to/setuptools-aware/python setup.py egg_info
>>  $ cat src/zope.tal-egg-info/requires.txt
>>  setuptools
>>  zope.i18nmessageid
>>  zope.interface
>>
>>  [test]
>>  zope.testing
> 
> 
> None of these is tests_require.  The above lists the contents of  
> install_requires and the test extra.  zope.tal is odd because it  
> lists the same values in tests_require and install requires.  Try  
> putting something else in tests_require and see if you see it show up.
> 
> I know that the contents of tests_require isn't saved because I  
> *tried* to get buildout to use it and asked about it on the distutils  
> sig:
> 
>    http://mail.python.org/pipermail/distutils-sig/2007-January/007083.html
> 
> Of course, something could have changed since then, but I doubt it.

Nope.

>>> Ideally, buildout (really the testrunner recipe) should be able to
>>> honor tests_require, but setuptools doesn't make this information
>>> available to any other packages. :( (big frowny)  Also, I believe
>>> that more is required to get "setup.py test" to work.  I'm unsure
>>> what the details are.
>> See above.  If buildout can trigger creation of the egg-info  
>> directory,
>> all should be well.  In fact, that directory will already be  
>> present in
>> any source distribution built with setuptools.
> 
> Again, I believe you are mistaken.

You are correct:  I was misled by the presence of the section for the
'tests' extra.  Attached find a patch against the setuptools-0.6 branch
which addes a 'tests_require.txt' file entry point.  I will propose that
the patch be included over on the distutils list.



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

iD8DBQFHPHR++gerLs4ltQ4RAnVTAKC7KSP2UTNjQt8aCVwDeBW80Zu0UgCfT+/T
DBdr4PuHBOBmBHP4Gte2R8U=
=2M92
-----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
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )

Reply via email to