diff options
author | PJ Eby <distutils-sig@python.org> | 2008-01-19 02:55:03 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2008-01-19 02:55:03 +0000 |
commit | 60cf2d31c8edb39b418f522ad935320c6da9c927 (patch) | |
tree | 0b107df453c60f90e6159d58aa56cc2bfcf28225 | |
parent | 7c4938d53774c51b441970e177ce72cc3bdf68ce (diff) | |
download | external_python_setuptools-60cf2d31c8edb39b418f522ad935320c6da9c927.tar.gz external_python_setuptools-60cf2d31c8edb39b418f522ad935320c6da9c927.tar.bz2 external_python_setuptools-60cf2d31c8edb39b418f522ad935320c6da9c927.zip |
Fix interactions between the various "require" options,
so that downloads aren't repeated and needed eggs are
always installed, even if they were downloaded to the
setup directory already. (backport from trunk)
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4060066
-rwxr-xr-x | setuptools.txt | 5 | ||||
-rwxr-xr-x | setuptools/command/develop.py | 10 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 14 | ||||
-rw-r--r-- | setuptools/command/install.py | 10 | ||||
-rw-r--r-- | setuptools/command/test.py | 4 |
5 files changed, 24 insertions, 19 deletions
diff --git a/setuptools.txt b/setuptools.txt index 65986637..57e32b35 100755 --- a/setuptools.txt +++ b/setuptools.txt @@ -2620,6 +2620,11 @@ Release Notes/Change History * Minor changes for Jython compatibility + * Fixed not installing eggs in ``install_requires`` if they were also used for + ``setup_requires`` or ``tests_require``. + + * Fixed not fetching eggs in ``install_requires`` when running tests. + 0.6c7 * Fixed ``distutils.filelist.findall()`` crashing on broken symlinks, and ``egg_info`` command failing on new, uncommitted SVN directories. diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index dfc41764..f128b803 100755 --- a/setuptools/command/develop.py +++ b/setuptools/command/develop.py @@ -3,7 +3,7 @@ from distutils.util import convert_path from pkg_resources import Distribution, PathMetadata, normalize_path from distutils import log from distutils.errors import * -import sys, os, setuptools +import sys, os, setuptools, glob class develop(easy_install): """Set up package for development""" @@ -32,7 +32,7 @@ class develop(easy_install): self.egg_path = None easy_install.initialize_options(self) self.setup_path = None - + self.always_copy_from = '.' # always copy eggs installed in curdir @@ -48,9 +48,11 @@ class develop(easy_install): ) self.args = [ei.egg_name] easy_install.finalize_options(self) + # pick up setup-dir .egg files only: no .egg-info + self.package_index.scan(glob.glob('*.egg')) + self.egg_link = os.path.join(self.install_dir, ei.egg_name+'.egg-link') self.egg_base = ei.egg_base - if self.egg_path is None: self.egg_path = os.path.abspath(ei.egg_base) @@ -60,7 +62,6 @@ class develop(easy_install): "--egg-path must be a relative path from the install" " directory to "+target ) - # Make a distribution for the package's source self.dist = Distribution( @@ -79,7 +80,6 @@ class develop(easy_install): "Can't get a consistent path to setup script from" " installation directory", p, normalize_path(os.curdir)) - def install_for_development(self): # Ensure metadata is up-to-date self.run_command('egg_info') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index da8434c2..acf4fda7 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -94,7 +94,7 @@ class easy_install(Command): # Options not specifiable via command line self.package_index = None - self.pth_file = None + self.pth_file = self.always_copy_from = None self.delete_conflicting = None self.ignore_conflicts_at_my_risk = None self.site_dirs = None @@ -455,6 +455,11 @@ Please make the appropriate changes for your system and try again. install_needed = install_needed or self.always_copy install_needed = install_needed or os.path.dirname(download) == tmpdir install_needed = install_needed or not download.endswith('.egg') + install_needed = install_needed or ( + self.always_copy_from is not None and + os.path.dirname(normalize_path(download)) == + normalize_path(self.always_copy_from) + ) if spec and not install_needed: # at this point, we know it's a local .egg, we just don't know if @@ -485,11 +490,6 @@ Please make the appropriate changes for your system and try again. - - - - - def process_distribution(self, requirement, dist, deps=True, *info): self.update_pth(dist) self.package_index.add(dist) @@ -527,7 +527,7 @@ Please make the appropriate changes for your system and try again. "Installed distribution %s conflicts with requirement %s" % e.args ) - if self.always_copy: + if self.always_copy or self.always_copy_from: # Force all the relevant distros to be copied or activated for dist in distros: if dist.key not in self.installed_projects: diff --git a/setuptools/command/install.py b/setuptools/command/install.py index 1de38aba..a150c435 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -1,4 +1,4 @@ -import setuptools, sys +import setuptools, sys, glob from distutils.command.install import install as _install from distutils.errors import DistutilsArgError @@ -88,6 +88,10 @@ class install(_install): self.distribution, args="x", root=self.root, record=self.record, ) cmd.ensure_finalized() # finalize before bdist_egg munges install cmd + cmd.always_copy_from = '.' # make sure local-dir eggs get installed + + # pick up setup-dir .egg files only: no .egg-info + cmd.package_index.scan(glob.glob('*.egg')) self.run_command('bdist_egg') args = [self.distribution.get_command_obj('bdist_egg').egg_output] @@ -116,8 +120,4 @@ class install(_install): - - - - # diff --git a/setuptools/command/test.py b/setuptools/command/test.py index f8a1169f..db918dae 100644 --- a/setuptools/command/test.py +++ b/setuptools/command/test.py @@ -107,6 +107,8 @@ class test(Command): def run(self): + if self.distribution.install_requires: + self.distribution.fetch_build_eggs(self.distribution.install_requires) if self.distribution.tests_require: self.distribution.fetch_build_eggs(self.distribution.tests_require) @@ -119,8 +121,6 @@ class test(Command): self.with_project_on_sys_path(self.run_tests) - - def run_tests(self): import unittest loader_ep = EntryPoint.parse("x="+self.test_loader) |