Commit 3122780d authored by Gary Poster's avatar Gary Poster

settle on "include-site-packages" and migrate all variations of...

settle on "include-site-packages" and migrate all variations of "add-site-packages" to that spelling.
parent b0e203be
......@@ -1170,7 +1170,7 @@ def scripts(reqs, working_set, executable, dest,
def sitepackage_safe_scripts(
dest, working_set, executable, site_py_dest,
reqs=(), scripts=None, interpreter=None, extra_paths=(),
initialization='', add_site_packages=False, exec_sitecustomize=False,
initialization='', include_site_packages=False, exec_sitecustomize=False,
relative_paths=False, script_arguments='', script_initialization=''):
"""Generate scripts and/or an interpreter from a system Python.
......@@ -1184,7 +1184,7 @@ def sitepackage_safe_scripts(
site_py_dest, executable, initialization, exec_sitecustomize))
generated.append(_generate_site(
site_py_dest, working_set, executable, extra_paths,
add_site_packages, relative_paths))
include_site_packages, relative_paths))
script_initialization = (
'\nimport site # imports custom buildout-generated site.py\n%s' % (
script_initialization,))
......@@ -1521,10 +1521,10 @@ def _generate_sitecustomize(dest, executable, initialization='',
return sitecustomize_path
def _generate_site(dest, working_set, executable, extra_paths=(),
add_site_packages=False, relative_paths=False):
include_site_packages=False, relative_paths=False):
"""Write a site.py file with eggs from working_set.
extra_paths will be added to the path. If add_site_packages is True,
extra_paths will be added to the path. If include_site_packages is True,
paths from the underlying Python will be added.
"""
path = _get_path(working_set, extra_paths)
......@@ -1536,7 +1536,7 @@ def _generate_site(dest, working_set, executable, extra_paths=(),
[(line and ' %s' % (line,) or line)
for line in preamble.split('\n')])
original_path_setup = ''
if add_site_packages:
if include_site_packages:
stdlib, site_paths = _get_system_paths(executable)
original_path_setup = original_path_snippet % (
_format_paths((repr(p) for p in site_paths), 2),)
......@@ -1551,7 +1551,7 @@ def _generate_site(dest, working_set, executable, extra_paths=(),
relative_paths)
else:
location = repr(distribution.location)
preamble += namespace_add_site_packages_setup % (location,)
preamble += namespace_include_site_packages_setup % (location,)
original_path_setup = (
addsitedir_namespace_originalpackages_snippet +
original_path_setup)
......@@ -1580,7 +1580,7 @@ def _generate_site(dest, working_set, executable, extra_paths=(),
raise RuntimeError('Buildout did not successfully rewrite site.py')
return site_path
namespace_add_site_packages_setup = '''
namespace_include_site_packages_setup = '''
setuptools_path = %s
sys.path.append(setuptools_path)
known_paths.add(os.path.normcase(setuptools_path))
......
......@@ -1267,7 +1267,7 @@ this is very straightforward.
>>> reset_interpreter()
>>> generated = zc.buildout.easy_install.sitepackage_safe_scripts(
... interpreter_bin_dir, ws, sys.executable, interpreter_parts_dir,
... interpreter='py', add_site_packages=True)
... interpreter='py', include_site_packages=True)
>>> sys.stdout.write('#\n'); cat(site_path)
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
#...
......@@ -1336,7 +1336,7 @@ call to another text fixture to create.
... links=[link_server, namespace_eggs], index=link_server+'index/')
>>> generated = zc.buildout.easy_install.sitepackage_safe_scripts(
... interpreter_bin_dir, ws, sys.executable, interpreter_parts_dir,
... interpreter='py', add_site_packages=True)
... interpreter='py', include_site_packages=True)
>>> sys.stdout.write('#\n'); cat(site_path)
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
#...
......@@ -1394,7 +1394,7 @@ at that result.
>>> reset_interpreter()
>>> generated = zc.buildout.easy_install.sitepackage_safe_scripts(
... interpreter_bin_dir, ws, sys.executable, interpreter_parts_dir,
... interpreter='py', add_site_packages=True,
... interpreter='py', include_site_packages=True,
... relative_paths=interpreter_dir)
>>> sys.stdout.write('#\n'); cat(site_path)
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
......
......@@ -1912,7 +1912,7 @@ tellmy.version and tellmy.fortune.
... recipe = z3c.recipe.scripts
... python = primed_python
... interpreter = py
... add-site-packages = true
... include-site-packages = true
... eggs = tellmy.version == 1.0
... tellmy.fortune == 1.0
... demo
......@@ -1937,7 +1937,7 @@ tellmy.version and tellmy.fortune.
Generated interpreter '/sample-buildout/bin/py'.
<BLANKLINE>
Finally, we are ready for the actual test. Prior to the bug fix that
Finally, we are ready to see if it worked. Prior to the bug fix that
this tests, the results of both calls below was the following::
1.1
......
......@@ -33,7 +33,7 @@ this, we'll list the new options and describe them.
In addition to these, the recipe offers these new options. They are
introduced here, and described more in depth below.
add-site-packages
include-site-packages
You can choose to have the site-packages of the underlying Python
available to your script or interpreter, in addition to the packages
from your eggs. See the section on this option for motivations and
......@@ -47,7 +47,7 @@ extends
exec-sitecustomize
Normally the Python's real sitecustomize module is not processed.
If you want it to be processed, set this value to 'true'. This will
be honored irrespective of the setting for add-site-packages.
be honored irrespective of the setting for include-site-packages.
script-initialization
The standard initialization code affects both an interpreter and scripts.
......@@ -202,7 +202,7 @@ instance, it is a system Python), you open yourself up to these
possibilities. Don't be unaware of the dangers.
To show off these features, we need to use buildout with a Python
executable with some extra paths to show ``add-site-packages``; and one
executable with some extra paths to show ``include-site-packages``; and one
guaranteed to have a sitecustomize module to show
``exec-sitecustomize``. We'll make one using a test fixture called
``make_py``. The os.environ change below will go into the sitecustomize,
......@@ -215,7 +215,7 @@ and the site_packages_path will be in the Python's path.
>>> print site_packages_path
/executable_buildout/site-packages
Now let's take a look at add-site-packages.
Now let's take a look at include-site-packages.
>>> write(sample_buildout, 'buildout.cfg',
... """
......@@ -225,7 +225,7 @@ Now let's take a look at add-site-packages.
...
... [py]
... recipe = z3c.recipe.scripts:interpreter
... add-site-packages = true
... include-site-packages = true
... eggs = demo<0.3
... find-links = %(server)s
... index = %(server)s/index
......
......@@ -31,13 +31,13 @@ class Base(ScriptBase):
b_options['parts-directory'], self.name)
value = options.setdefault(
'add-site-packages',
b_options.get('add-site-packages', 'false'))
'include-site-packages',
b_options.get('include-site-packages', 'false'))
if value not in ('true', 'false'):
raise zc.buildout.UserError(
"Invalid value for add-site-packages option: %s" %
"Invalid value for include-site-packages option: %s" %
(value,))
self.add_site_packages = (value == 'true')
self.include_site_packages = (value == 'true')
value = options.setdefault(
'exec-sitecustomize',
......@@ -69,7 +69,7 @@ class Interpreter(Base):
interpreter=options['name'],
extra_paths=self.extra_paths,
initialization=options.get('initialization', ''),
add_site_packages=self.add_site_packages,
include_site_packages=self.include_site_packages,
exec_sitecustomize=self.exec_sitecustomize,
relative_paths=self._relative_paths,
))
......@@ -92,7 +92,7 @@ class Scripts(Base):
interpreter=options.get('interpreter'),
extra_paths=self.extra_paths,
initialization=options.get('initialization', ''),
add_site_packages=self.add_site_packages,
include_site_packages=self.include_site_packages,
exec_sitecustomize=self.exec_sitecustomize,
relative_paths=self._relative_paths,
script_arguments=options.get('arguments', ''),
......
......@@ -25,7 +25,7 @@ from zope.testing import doctest, renormalizing
# all of the examples. The README tests ``extends``,
# ``include-site-customization`` and ``name``. That leaves ``python``,
# ``extra-paths``, ``initialization``, ``relative-paths``, and
# ``add-site-packages``.
# ``include-site-packages``.
def supports_python_option():
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment