[Checkins] SVN: zc.buildout/branches/reinout-scripts/ Further documentation update and cleanup of comments
Reinout van Rees
reinout at vanrees.org
Fri Sep 4 11:29:36 EDT 2009
Log message for revision 103549:
Further documentation update and cleanup of comments
Changed:
U zc.buildout/branches/reinout-scripts/doc/tutorial.txt
U zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.py
U zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.txt
-=-
Modified: zc.buildout/branches/reinout-scripts/doc/tutorial.txt
===================================================================
--- zc.buildout/branches/reinout-scripts/doc/tutorial.txt 2009-09-04 14:54:27 UTC (rev 103548)
+++ zc.buildout/branches/reinout-scripts/doc/tutorial.txt 2009-09-04 15:29:36 UTC (rev 103549)
@@ -863,8 +863,8 @@
If a distribution doesn't use setuptools, it may not declare it's entry
points. In that case, you can specify entry points in the recipe data.
- Buildout *does attempt* to detect distutils-style scripts without an entry
- point and will generate a script for them when found.
+ Buildout *does* detect distutils-style scripts without an entry point in
+ case the egg is unzipped and will generate a script for them when found.
Script initialization
=====================
Modified: zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.py
===================================================================
--- zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.py 2009-09-04 14:54:27 UTC (rev 103548)
+++ zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.py 2009-09-04 15:29:36 UTC (rev 103549)
@@ -932,16 +932,20 @@
if isinstance(req, str):
req = pkg_resources.Requirement.parse(req)
dist = working_set.find(req)
- # entry points
+ # regular console_scripts entry points
for name in pkg_resources.get_entry_map(dist, 'console_scripts'):
entry_point = dist.get_entry_info('console_scripts', name)
entry_points.append(
(name, entry_point.module_name,
'.'.join(entry_point.attrs))
)
- # distutils scripts
+ # "old-style" distutils scripts
if os.path.isdir(dist.location):
- # TODO: what about zipped eggs?
+ # The metadata on scripts is not retained by
+ # distutils/setuptools, except by placing the original scripts
+ # in /EGG-INFO/scripts/. os.listdir() is used to detect them.
+ # Zipped eggs would need unpacking for this to work, which is
+ # too resource intensive, so zipped eggs are not supported.
scripts_dir = os.path.join(dist.location, 'EGG-INFO', 'scripts')
if os.path.exists(scripts_dir):
for name in os.listdir(scripts_dir):
@@ -1075,7 +1079,6 @@
# The script doesn't follow distutil's rules. Ignore it.
return []
original_content = ''.join(lines[1:])
- # TODO: does this work OK with non-ascii characters?
contents = distutils_script_template % dict(
python = _safe_arg(executable),
path = path,
Modified: zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.txt
===================================================================
--- zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.txt 2009-09-04 14:54:27 UTC (rev 103548)
+++ zc.buildout/branches/reinout-scripts/src/zc/buildout/easy_install.txt 2009-09-04 15:29:36 UTC (rev 103549)
@@ -929,10 +929,10 @@
>>> ls(distbin)
- distutilsscript
-Distutils copies the specified script files verbatim, apart from a line at the
-top that looks like ``#!/usr/bin/python``, which gets replaced by the actual
-python interpreter. Buildout does the same, but additionally also adds the
-sys.path like for the console_scripts:
+Distutils copies the script files verbatim, apart from a line at the top that
+looks like ``#!/usr/bin/python``, which gets replaced by the actual python
+interpreter. Buildout does the same, but additionally also adds the sys.path
+like for the console_scripts:
>>> cat(distbin, 'distutilsscript')
#!/usr/local/bin/python2.4
@@ -948,6 +948,9 @@
Due to the nature of distutils scripts, buildout cannot pass arguments as
there's no specific method to pass them to.
+A second restriction is that scripts are only detected if the eggs are
+unzipped. Unzipping all zipped eggs for detecting old-style distutils scripts
+is a bit wasteful.
Handling custom build options for extensions provided in source distributions
-----------------------------------------------------------------------------
More information about the checkins
mailing list