[Python-checkins] r60065 - in sandbox/trunk/setuptools: setuptools.egg-info/entry_points.txt setuptools/command/develop.py setuptools/command/easy_install.py setuptools/command/install.py setuptools/command/test.py
phillip.eby
python-checkins at python.org
Sat Jan 19 03:46:51 CET 2008
Author: phillip.eby
Date: Sat Jan 19 03:46:51 2008
New Revision: 60065
Modified:
sandbox/trunk/setuptools/setuptools.egg-info/entry_points.txt
sandbox/trunk/setuptools/setuptools/command/develop.py
sandbox/trunk/setuptools/setuptools/command/easy_install.py
sandbox/trunk/setuptools/setuptools/command/install.py
sandbox/trunk/setuptools/setuptools/command/test.py
Log:
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.
Modified: sandbox/trunk/setuptools/setuptools.egg-info/entry_points.txt
==============================================================================
--- sandbox/trunk/setuptools/setuptools.egg-info/entry_points.txt (original)
+++ sandbox/trunk/setuptools/setuptools.egg-info/entry_points.txt Sat Jan 19 03:46:51 2008
@@ -7,7 +7,6 @@
saveopts = setuptools.command.saveopts:saveopts
egg_info = setuptools.command.egg_info:egg_info
register = setuptools.command.register:register
-upload = setuptools.command.upload:upload
install_egg_info = setuptools.command.install_egg_info:install_egg_info
alias = setuptools.command.alias:alias
easy_install = setuptools.command.easy_install:easy_install
@@ -32,7 +31,7 @@
[console_scripts]
easy_install = setuptools.command.easy_install:main
-easy_install-2.3 = setuptools.command.easy_install:main
+easy_install-2.5 = setuptools.command.easy_install:main
[setuptools.file_finders]
svn_cvs = setuptools.command.sdist:_default_revctrl
Modified: sandbox/trunk/setuptools/setuptools/command/develop.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/develop.py (original)
+++ sandbox/trunk/setuptools/setuptools/command/develop.py Sat Jan 19 03:46:51 2008
@@ -3,7 +3,7 @@
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 @@
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 @@
)
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 @@
"--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 @@
"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')
Modified: sandbox/trunk/setuptools/setuptools/command/easy_install.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/easy_install.py (original)
+++ sandbox/trunk/setuptools/setuptools/command/easy_install.py Sat Jan 19 03:46:51 2008
@@ -94,7 +94,7 @@
# 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 @@
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 @@
-
-
-
-
-
def process_distribution(self, requirement, dist, deps=True, *info):
self.update_pth(dist)
self.package_index.add(dist)
@@ -527,7 +527,7 @@
"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:
Modified: sandbox/trunk/setuptools/setuptools/command/install.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/install.py (original)
+++ sandbox/trunk/setuptools/setuptools/command/install.py Sat Jan 19 03:46:51 2008
@@ -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 @@
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 @@
-
-
-
-
#
Modified: sandbox/trunk/setuptools/setuptools/command/test.py
==============================================================================
--- sandbox/trunk/setuptools/setuptools/command/test.py (original)
+++ sandbox/trunk/setuptools/setuptools/command/test.py Sat Jan 19 03:46:51 2008
@@ -107,6 +107,8 @@
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 @@
self.with_project_on_sys_path(self.run_tests)
-
-
def run_tests(self):
import unittest
loader_ep = EntryPoint.parse("x="+self.test_loader)
More information about the Python-checkins
mailing list