[Python-checkins] python/nondist/sandbox/setuptools/setuptools/command easy_install.py, 1.29, 1.30
pje@users.sourceforge.net
pje at users.sourceforge.net
Sat Sep 24 19:58:26 CEST 2005
Update of /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32232/setuptools/command
Modified Files:
easy_install.py
Log Message:
Implement smart version conflict resolution for scripts, so that
installed applications will not have their eggs overridden by packages
installed locally on sys.path. This should also make things work a bit
better for "traditional" non-root Python setups on Unixy operating
systems. See:
http://mail.python.org/pipermail/distutils-sig/2005-September/005164.html
for more details.
Index: easy_install.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/setuptools/setuptools/command/easy_install.py,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- easy_install.py 17 Sep 2005 01:13:02 -0000 1.29
+++ easy_install.py 24 Sep 2005 17:58:22 -0000 1.30
@@ -462,6 +462,7 @@
script_text = get_script_header("") + (
"# EASY-INSTALL-ENTRY-SCRIPT: %(spec)r,%(group)r,%(name)r\n"
+ "__requires__ = %(spec)r\n"
"import sys\n"
"from pkg_resources import load_entry_point\n"
"\n"
@@ -489,7 +490,6 @@
-
def install_script(self, dist, script_name, script_text, dev_path=None):
"""Generate a legacy script wrapper and install it"""
spec = str(dist.as_requirement())
@@ -497,6 +497,7 @@
if dev_path:
script_text = get_script_header(script_text) + (
"# EASY-INSTALL-DEV-SCRIPT: %(spec)r,%(script_name)r\n"
+ "__requires__ = %(spec)r\n"
"from pkg_resources import require; require(%(spec)r)\n"
"del require\n"
"__file__ = %(dev_path)r\n"
@@ -504,15 +505,14 @@
) % locals()
else:
script_text = get_script_header(script_text) + (
- "#!python\n"
"# EASY-INSTALL-SCRIPT: %(spec)r,%(script_name)r\n"
+ "__requires__ = %(spec)r\n"
"import pkg_resources\n"
"pkg_resources.run_script(%(spec)r, %(script_name)r)\n"
) % locals()
self.write_script(script_name, script_text)
-
def write_script(self, script_name, contents, mode="t"):
"""Write an executable file to the scripts directory"""
log.info("Installing %s script to %s", script_name, self.script_dir)
More information about the Python-checkins
mailing list