diff options
author | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2008-01-19 02:46:51 +0000 |
---|---|---|
committer | phillip.eby <phillip.eby@6015fed2-1504-0410-9fe1-9d1591cc4771> | 2008-01-19 02:46:51 +0000 |
commit | 0b13fcdb505e59cb4306efd9b8f9d107f70929a2 (patch) | |
tree | 5e2f3279b45325d0eee545e16f40f74ed136d164 /setuptools/command | |
parent | 1674a6edaa9238a5b38dcd7957d053215b304042 (diff) | |
download | python-setuptools-0b13fcdb505e59cb4306efd9b8f9d107f70929a2.tar.gz |
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.
git-svn-id: http://svn.python.org/projects/sandbox/trunk/setuptools@60065 6015fed2-1504-0410-9fe1-9d1591cc4771
Diffstat (limited to 'setuptools/command')
-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 |
4 files changed, 19 insertions, 19 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py index b5fadc8..429ad8e 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 4f88841..4467885 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 1de38ab..a150c43 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 f8a1169..db918da 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) |