New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to alter root directory #253

Closed
hetmankp opened this Issue Apr 15, 2011 · 6 comments

Comments

Projects
None yet
3 participants
@hetmankp

hetmankp commented Apr 15, 2011

Problem: Passing the --root option to the setup script via the --install-option option causes pip installation to break.

Reason: pip uses the --record setup script option to determine which files were installed, however this always returns paths relative to the root directory. When it then attempts to modify the egg-info directory it fails as it is unaware of the real system path it needs to be located under.

Significance: The reason why --root is important is because compiled modules would otherwise contain references to the full path name which is undesirable.

Solution: There's two fixes I can see:

  1. Make pip parse the --install-option parameters passed to it looking for --root so that it then knows how to build the egg-info. This solution sounds a bit magical so I'm not sure I like it very much.
  2. Make pip install recognise the --root option directly. I've included a patch listing to do this:
diff --git a/pip/commands/install.py b/pip/commands/install.py
index 861c332..184b5ed 100644
--- a/pip/commands/install.py
+++ b/pip/commands/install.py
@@ -150,6 +150,13 @@ class InstallCommand(Command):
             action='store_true',
             help='Install to user-site')

+        self.parser.add_option(
+            '--root',
+            dest='root_path',
+            metavar='DIR',
+            default=None,
+            help='Install everything relative to this alternate root directory')
+
     def _build_package_finder(self, options, index_urls):
         """
         Create a package finder appropriate to this install command.
@@ -225,7 +232,7 @@ class InstallCommand(Command):
             requirement_set.locate_files()

         if not options.no_install and not self.bundle:
-            requirement_set.install(install_options, global_options)
+            requirement_set.install(install_options, global_options, root=options.root_path)
             installed = ' '.join([req.name for req in
                                   requirement_set.successfully_installed])
             if installed:
diff --git a/pip/req.py b/pip/req.py
index 6e520c5..6149909 100644
--- a/pip/req.py
+++ b/pip/req.py
@@ -537,7 +537,7 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
         name = name.replace(os.path.sep, '/')
         return name

-    def install(self, install_options, global_options=()):
+    def install(self, install_options, global_options=(), root=None):
         if self.editable:
             self.install_editable(install_options, global_options)
             return
@@ -553,6 +553,9 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
                 '--single-version-externally-managed',
                 '--record', record_filename]

+            if root is not None:
+                install_args.extend(['--root', root])
+
             if running_under_virtualenv():
                 ## FIXME: I'm not sure if this is a reasonable location; probably not
                 ## but we can't put it in the default location, as that is a virtualenv symlink that isn't writable
@@ -570,11 +573,15 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
                 logger.notify('Record file %s not found' % record_filename)
                 return
             self.install_succeeded = True
+
+            def prepend_root(path):
+                return ('' if root is None else root) + path
+
             f = open(record_filename)
             for line in f:
                 line = line.strip()
                 if line.endswith('.egg-info'):
-                    egg_info_dir = line
+                    egg_info_dir = prepend_root(line)
                     break
             else:
                 logger.warn('Could not find .egg-info directory in install record for %s' % self)
@@ -585,7 +592,7 @@ exec(compile(open(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
             new_lines = []
             f = open(record_filename)
             for line in f:
-                filename = line.strip()
+                filename = prepend_root(line.strip())
                 if os.path.isdir(filename):
                     filename += os.path.sep
                 new_lines.append(make_path_relative(filename, egg_info_dir))
@@ -1071,7 +1078,7 @@ class RequirementSet(object):
                 self.download_cache = os.path.expanduser(self.download_cache)
             return unpack_http_url(link, location, self.download_cache, only_download)

-    def install(self, install_options, global_options=()):
+    def install(self, install_options, global_options=(), **kwargs):
         """Install everything in this set (after having downloaded and unpacked the packages)"""
         to_install = [r for r in self.requirements.values()
                       if self.upgrade or not r.satisfied_by]
@@ -1090,7 +1097,7 @@ class RequirementSet(object):
                     finally:
                         logger.indent -= 2
                 try:
-                    requirement.install(install_options, global_options)
+                    requirement.install(install_options, global_options, **kwargs)
                 except:
                     # if install did not succeed, rollback previous uninstall
                     if requirement.conflicts_with and not requirement.install_succeeded:
@s0undt3ch

This comment has been minimized.

Show comment
Hide comment
@s0undt3ch

s0undt3ch Sep 22, 2012

I've hit this bug. It's been over a year since it was opened, what's the status of this?

s0undt3ch commented Sep 22, 2012

I've hit this bug. It's been over a year since it was opened, what's the status of this?

@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm Sep 22, 2012

Contributor

It needs a test, and it would be a lot easier to comment on and consider if it was submitted as a pull request rather than an inline patch. If you're interested in seeing it get in, submitting it as a pull request and adding a test would be the next steps.

Contributor

carljm commented Sep 22, 2012

It needs a test, and it would be a lot easier to comment on and consider if it was submitted as a pull request rather than an inline patch. If you're interested in seeing it get in, submitting it as a pull request and adding a test would be the next steps.

@s0undt3ch

This comment has been minimized.

Show comment
Hide comment
@s0undt3ch

s0undt3ch Sep 23, 2012

@carljm Ok, point taken, though, it is a bug, and, a year is a year.

While trying to add @hetmankp changes and running the test suite I'm getting a bunch of errors from the tests.

PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ nosetests -v
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
tests.test_hashes.test_get_hash_from_file_md5 ... ok
tests.test_hashes.test_get_hash_from_file_sha1 ... ok
tests.test_hashes.test_get_hash_from_file_sha224 ... ok
tests.test_hashes.test_get_hash_from_file_sha384 ... ok
tests.test_hashes.test_get_hash_from_file_sha256 ... ok
tests.test_hashes.test_get_hash_from_file_sha512 ... ok
tests.test_hashes.test_get_hash_from_file_unknown ... ok
tests.test_hashes.test_check_hash_md5_valid ... ok
tests.test_hashes.test_check_hash_md5_invalid ... ok
tests.test_hashes.test_check_hash_sha1_valid ... ok
tests.test_hashes.test_check_hash_sha1_invalid ... ok
tests.test_hashes.test_check_hash_sha224_valid ... ok
tests.test_hashes.test_check_hash_sha224_invalid ... ok
tests.test_hashes.test_check_hash_sha384_valid ... ok
tests.test_hashes.test_check_hash_sha384_invalid ... ok
tests.test_hashes.test_check_hash_sha256_valid ... ok
tests.test_hashes.test_check_hash_sha256_invalid ... ok
tests.test_hashes.test_check_hash_sha512_valid ... ok
tests.test_hashes.test_check_hash_sha512_invalid ... ok
tests.test_hashes.test_check_hasher_mismsatch ... ok
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
InstallRequirement should strip the fragment, but not the query. ... ok
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_noglobal ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_basic.py", line 14, in <module>
    from tests.test_pip import (here, reset_env, run_pip, pyversion, mkdir,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_bundle.py", line 5, in <module>
    from tests.test_pip import here, reset_env, run_pip, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_cleanup.py", line 4, in <module>
    from tests.test_pip import (here, reset_env, run_pip, write_file, mkdir)
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_compat.py", line 6, in <module>
    from tests.test_pip import (here, reset_env, run_pip, pyversion,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_completion.py", line 2, in <module>
    from tests.test_pip import reset_env, run_pip, get_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_config.py", line 4, in <module>
    from tests.test_pip import reset_env, run_pip, clear_environ, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_download.py", line 2, in <module>
    from tests.test_pip import reset_env, run_pip, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_extras.py", line 3, in <module>
    from tests.test_pip import reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_find_links.py", line 3, in <module>
    from tests.test_pip import reset_env, run_pip, pyversion, here, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_finder.py", line 7, in <module>
    from tests.test_pip import here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_freeze.py", line 5, in <module>
    from tests.test_pip import reset_env, run_pip, write_file, get_env, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_help.py", line 7, in <module>
    from tests.test_pip import run_pip, reset_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_index.py", line 6, in <module>
    from tests.test_pip import reset_env, run_pip, pyversion, here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_proxy.py", line 16, in <module>
    from tests.test_pip import here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_requirements.py", line 7, in <module>
    from tests.test_pip import reset_env, run_pip, write_file, pyversion, here, path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_search.py", line 9, in <module>
    from tests.test_pip import run_pip, reset_env, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_show.py", line 4, in <module>
    from tests.test_pip import reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_test.py", line 7, in <module>
    from tests.local_repos import local_checkout
  File "/home/vampas/projects/pip/tests/local_repos.py", line 5, in <module>
    from tests.test_pip import path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_unicode.py", line 2, in <module>
    from tests.test_pip import here, reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_uninstall.py", line 8, in <module>
    from tests.test_pip import here, reset_env, run_pip, assert_all_changes, write_file, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_upgrade.py", line 4, in <module>
    from tests.test_pip import (here, reset_env, run_pip, assert_all_changes,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_user_site.py", line 8, in <module>
    from tests.local_repos import local_checkout
  File "/home/vampas/projects/pip/tests/local_repos.py", line 5, in <module>
    from tests.test_pip import path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_backends.py", line 1, in <module>
    from tests.test_pip import (reset_env, run_pip,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_bazaar.py", line 1, in <module>
    from tests.test_pip import pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_git.py", line 5, in <module>
    from tests.test_pip import (reset_env, run_pip,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_subversion.py", line 3, in <module>
    from tests.test_pip import reset_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

----------------------------------------------------------------------
Ran 60 tests in 0.037s

FAILED (errors=39)

So what version of Mock are you using to test pip, and also, is there any sys path magic whlie running the tests? Because, although on a virtualenv, I do have scripttest installed.

PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scripttest
>>> 
PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ 

s0undt3ch commented Sep 23, 2012

@carljm Ok, point taken, though, it is a bug, and, a year is a year.

While trying to add @hetmankp changes and running the test suite I'm getting a bunch of errors from the tests.

PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ nosetests -v
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
tests.test_hashes.test_get_hash_from_file_md5 ... ok
tests.test_hashes.test_get_hash_from_file_sha1 ... ok
tests.test_hashes.test_get_hash_from_file_sha224 ... ok
tests.test_hashes.test_get_hash_from_file_sha384 ... ok
tests.test_hashes.test_get_hash_from_file_sha256 ... ok
tests.test_hashes.test_get_hash_from_file_sha512 ... ok
tests.test_hashes.test_get_hash_from_file_unknown ... ok
tests.test_hashes.test_check_hash_md5_valid ... ok
tests.test_hashes.test_check_hash_md5_invalid ... ok
tests.test_hashes.test_check_hash_sha1_valid ... ok
tests.test_hashes.test_check_hash_sha1_invalid ... ok
tests.test_hashes.test_check_hash_sha224_valid ... ok
tests.test_hashes.test_check_hash_sha224_invalid ... ok
tests.test_hashes.test_check_hash_sha384_valid ... ok
tests.test_hashes.test_check_hash_sha384_invalid ... ok
tests.test_hashes.test_check_hash_sha256_valid ... ok
tests.test_hashes.test_check_hash_sha256_invalid ... ok
tests.test_hashes.test_check_hash_sha512_valid ... ok
tests.test_hashes.test_check_hash_sha512_invalid ... ok
tests.test_hashes.test_check_hasher_mismsatch ... ok
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
InstallRequirement should strip the fragment, but not the query. ... ok
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_noglobal ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_notvenv ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_global ... ERROR
tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_noglobal ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR
Failure: ImportError (No module named scripttest) ... ERROR

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_basic.py", line 14, in <module>
    from tests.test_pip import (here, reset_env, run_pip, pyversion, mkdir,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_bundle.py", line 5, in <module>
    from tests.test_pip import here, reset_env, run_pip, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_cleanup.py", line 4, in <module>
    from tests.test_pip import (here, reset_env, run_pip, write_file, mkdir)
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_compat.py", line 6, in <module>
    from tests.test_pip import (here, reset_env, run_pip, pyversion,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_completion.py", line 2, in <module>
    from tests.test_pip import reset_env, run_pip, get_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_config.py", line 4, in <module>
    from tests.test_pip import reset_env, run_pip, clear_environ, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_download.py", line 2, in <module>
    from tests.test_pip import reset_env, run_pip, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_extras.py", line 3, in <module>
    from tests.test_pip import reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_find_links.py", line 3, in <module>
    from tests.test_pip import reset_env, run_pip, pyversion, here, write_file
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_finder.py", line 7, in <module>
    from tests.test_pip import here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_freeze.py", line 5, in <module>
    from tests.test_pip import reset_env, run_pip, write_file, get_env, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_help.py", line 7, in <module>
    from tests.test_pip import run_pip, reset_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_index.py", line 6, in <module>
    from tests.test_pip import reset_env, run_pip, pyversion, here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_proxy.py", line 16, in <module>
    from tests.test_pip import here
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_requirements.py", line 7, in <module>
    from tests.test_pip import reset_env, run_pip, write_file, pyversion, here, path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_search.py", line 9, in <module>
    from tests.test_pip import run_pip, reset_env, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_show.py", line 4, in <module>
    from tests.test_pip import reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_test.py", line 7, in <module>
    from tests.local_repos import local_checkout
  File "/home/vampas/projects/pip/tests/local_repos.py", line 5, in <module>
    from tests.test_pip import path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_unicode.py", line 2, in <module>
    from tests.test_pip import here, reset_env, run_pip
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_uninstall.py", line 8, in <module>
    from tests.test_pip import here, reset_env, run_pip, assert_all_changes, write_file, pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_upgrade.py", line 4, in <module>
    from tests.test_pip import (here, reset_env, run_pip, assert_all_changes,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_user_site.py", line 8, in <module>
    from tests.local_repos import local_checkout
  File "/home/vampas/projects/pip/tests/local_repos.py", line 5, in <module>
    from tests.test_pip import path_to_url
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_both_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_sitepkgs_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_egglink_in_usersite_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_notvenv
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_global
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: tests.test_util.Tests_EgglinkPath.test_noegglink_in_sitepkgs_venv_noglobal
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 381, in setUp
    try_run(self.inst, ('setup', 'setUp'))
  File "/usr/lib/python2.7/dist-packages/nose/util.py", line 478, in try_run
    return func()
  File "/home/vampas/projects/pip/tests/test_util.py", line 20, in setup
    self.mock_dist = Mock(project_name=project)
TypeError: __init__() got an unexpected keyword argument 'project_name'

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_backends.py", line 1, in <module>
    from tests.test_pip import (reset_env, run_pip,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_bazaar.py", line 1, in <module>
    from tests.test_pip import pyversion
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_git.py", line 5, in <module>
    from tests.test_pip import (reset_env, run_pip,
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

======================================================================
ERROR: Failure: ImportError (No module named scripttest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/loader.py", line 390, in loadTestsFromName
    addr.filename, addr.module)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 39, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/usr/lib/python2.7/dist-packages/nose/importer.py", line 86, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/vampas/projects/pip/tests/test_vcs_subversion.py", line 3, in <module>
    from tests.test_pip import reset_env
  File "/home/vampas/projects/pip/tests/test_pip.py", line 11, in <module>
    from scripttest import TestFileEnvironment, FoundDir
ImportError: No module named scripttest

----------------------------------------------------------------------
Ran 60 tests in 0.037s

FAILED (errors=39)

So what version of Mock are you using to test pip, and also, is there any sys path magic whlie running the tests? Because, although on a virtualenv, I do have scripttest installed.

PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ python
Python 2.7.3 (default, Apr 20 2012, 22:44:07) 
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import scripttest
>>> 
PY2.7:vampas@lgl: ~/projects/pip (issues/253)$ 
@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm Sep 23, 2012

Contributor

Pip has lots of bugs (given the "foundation" of distutils and setuptools, and all the weird edge cases in packaging, it's not likely to ever be otherwise), and nobody's paid to work on it. Priority goes to pull requests with passing tests. Thanks for helping out!

Might be good to first try running the tests without the patch and make sure you can get a clean run. I've never seen a scripttest import error, and there's no sys.path magic (besides whatever nose might do). You sure scripttest, mock, and nose are all installed in the virtualenv you're running the tests in? Any recent version of mock should be fine, we don't do anything unusual with it.

Contributor

carljm commented Sep 23, 2012

Pip has lots of bugs (given the "foundation" of distutils and setuptools, and all the weird edge cases in packaging, it's not likely to ever be otherwise), and nobody's paid to work on it. Priority goes to pull requests with passing tests. Thanks for helping out!

Might be good to first try running the tests without the patch and make sure you can get a clean run. I've never seen a scripttest import error, and there's no sys.path magic (besides whatever nose might do). You sure scripttest, mock, and nose are all installed in the virtualenv you're running the tests in? Any recent version of mock should be fine, we don't do anything unusual with it.

@hetmankp

This comment has been minimized.

Show comment
Hide comment
@hetmankp

hetmankp Oct 2, 2012

Hi. I have cleaned up the patch and added a simple test, both available in pull request #693. I can confirm I didn't get any of the test failures observed by s0undt3ch.

hetmankp commented Oct 2, 2012

Hi. I have cleaned up the patch and added a simple test, both available in pull request #693. I can confirm I didn't get any of the test failures observed by s0undt3ch.

@carljm

This comment has been minimized.

Show comment
Hide comment
@carljm

carljm May 28, 2013

Contributor

It seems this should have been closed with the merge of #693.

Contributor

carljm commented May 28, 2013

It seems this should have been closed with the merge of #693.

@carljm carljm closed this May 28, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment