-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Can we extend the test command (deriving from easy_install, I guess,
instead of Command), to take the same options it does?
I tried hacking at it a bit, but without much success so far: I've
gotten it to accept the '--find-links' option, but not actually to *use* it:
$ cd ~/projects/eggz/src/zope.tales
$ ../../bin/python setup.py test \
--find-links="http://download.zope.org/distribution"
running test
running egg_info
writing requirements to src/zope.tales.egg-info/requires.txt
writing src/zope.tales.egg-info/PKG-INFO
writing top-level names to src/zope.tales.egg-info/top_level.txt
writing namespace_packages to src/zope.tales.egg-info/namespace_packages.txt
warning: manifest_maker: standard file not found: should have one of
README, README.txt
writing manifest file 'src/zope.tales.egg-info/SOURCES.txt'
running build_ext
Checking .pth file support in .
/home/tseaver/projects/PyCon2006/eggification/sandbox/src/zope.tales/../../bin/python
- -E -c pass
Searching for zope.testing
Reading http://www.python.org/pypi/zope.testing/
Couldn't find index page for 'zope.testing' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://www.python.org/pypi/
No local packages or download links found for zope.testing
error: Could not find suitable distribution for
Requirement.parse('zope.testing')
I'm attaching the patch against the current SVN head,
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 [EMAIL PROTECTED]
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFEFt/z+gerLs4ltQ4RAvdFAKCRSHP44tnDHIKdnHP7dEtZxvyqBgCdFWBE
dULlC535P+qeO8m5MZLogig=
=lM5x
-----END PGP SIGNATURE-----
Index: setuptools/command/test.py
===================================================================
--- setuptools/command/test.py (revision 43025)
+++ setuptools/command/test.py (working copy)
@@ -1,15 +1,16 @@
-from setuptools import Command
+from setuptools.command.easy_install import easy_install
from distutils.errors import DistutilsOptionError
+import os
import sys
from pkg_resources import *
-class test(Command):
+class test(easy_install):
"""Command to run unit tests after in-place build"""
description = "run unit tests after in-place build"
- user_options = [
+ user_options = easy_install.user_options + [
('test-module=','m', "Run 'test_suite' in specified module"),
('test-suite=','s',
"Test suite to run (e.g. 'some_module.test_suite')"),
@@ -18,12 +19,32 @@
test_suite = None
test_module = None
+ command_consumes_arguments = False # override base
+
def initialize_options(self):
- pass
+ easy_install.initialize_options(self)
def finalize_options(self):
+ ei = self.get_finalized_command("egg_info")
+ if ei.broken_egg_info:
+ raise DistutilsError(
+ "Please rename %r to %r before using 'develop'"
+ % (ei.egg_info, ei.broken_egg_info)
+ )
+ self.args = [ei.egg_name]
+ easy_install.finalize_options(self)
+ self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link')
+ self.egg_base = ei.egg_base
+ self.egg_path = os.path.abspath(ei.egg_base)
+ # Make a distribution for the package's source
+ self.dist = Distribution(
+ normalize_path(self.egg_path),
+ PathMetadata(self.egg_path, os.path.abspath(ei.egg_info)),
+ project_name = ei.egg_name
+ )
+
if self.test_suite is None:
if self.test_module is None:
self.test_suite = self.distribution.test_suite
_______________________________________________
Distutils-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig