Commit a0669e31 authored by Tres Seaver's avatar Tres Seaver

First stab at using setuptools >= 0.7 instead of distribute.

My doctest / renormalizer fu is not strong enough to deal with the
changes to output:

- setuptools now has dependencies, and emits output to add them as
  'find-links'.  I tried adding an 'adding_find_link' renormalizer,
  but it doesn't suppress the output.

- Other failures due to merge tweaking APIs, etc.  Again, I'm not
  competent to fix them in the doctest / renormalizer world:  they make
  my head hurt.
parent 11571375
......@@ -61,15 +61,12 @@ parser.add_option("-f", "--find-links",
options, args = parser.parse_args()
######################################################################
# load/install distribute
# load/install setuptools
to_reload = False
try:
import pkg_resources
import setuptools
if not hasattr(pkg_resources, '_distribute'):
to_reload = True
raise ImportError
except ImportError:
ez = {}
......@@ -78,7 +75,7 @@ except ImportError:
except ImportError:
from urllib2 import urlopen
exec(urlopen('http://python-distribute.org/distribute_setup.py').read(),
exec(urlopen('http://dist.repoze.org/ez_setup-0.7.py').read(),
ez)
setup_args = dict(to_dir=tmpeggs, download_delay=0, no_fake=True)
ez['use_setuptools'](**setup_args)
......@@ -110,8 +107,8 @@ find_links = os.environ.get(
if find_links:
cmd.extend(['-f', find_links])
distribute_path = ws.find(
pkg_resources.Requirement.parse('distribute')).location
setuptools_path = ws.find(
pkg_resources.Requirement.parse('setuptools')).location
requirement = 'zc.buildout'
version = options.version
......@@ -126,7 +123,7 @@ if version is None and not options.accept_buildout_test_releases:
return False
return True
index = setuptools.package_index.PackageIndex(
search_path=[distribute_path])
search_path=[setuptools_path])
if find_links:
index.add_find_links((find_links,))
req = pkg_resources.Requirement.parse(requirement)
......@@ -149,7 +146,7 @@ if version:
cmd.append(requirement)
import subprocess
if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=distribute_path)) != 0:
if subprocess.call(cmd, env=dict(os.environ, PYTHONPATH=setuptools_path)) != 0:
raise Exception(
"Failed to execute command:\n%s",
repr(cmd)[1:-1])
......
......@@ -46,7 +46,7 @@ try:
except ImportError:
from urllib2 import urlopen
exec(urlopen('http://python-distribute.org/distribute_setup.py').read(), ez)
exec(urlopen('http://dist.repoze.org/ez_setup-0.7.py').read(), ez)
ez['use_setuptools'](to_dir='eggs', download_delay=0)
import pkg_resources
......
......@@ -89,7 +89,9 @@ setup(
packages = ['zc', 'zc.buildout'],
package_dir = {'': 'src'},
namespace_packages = ['zc'],
install_requires = 'setuptools',
install_requires = [
'setuptools>=0.7',
],
include_package_data = True,
entry_points = entry_points,
extras_require = dict(test=['zope.testing', 'manuel']),
......@@ -98,9 +100,10 @@ setup(
'Intended Audience :: Developers',
'License :: OSI Approved :: Zope Public License',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.2',
'Programming Language :: Python :: 3.3',
'Topic :: Software Development :: Build Tools',
......
......@@ -55,7 +55,7 @@ By default it gets the latest version:
>>> print_(open(buildout_script).read()) # doctest: +ELLIPSIS
#...
sys.path[0:0] = [
'/sample/eggs/distribute-...egg',
'/sample/eggs/setuptools-...egg',
'/sample/eggs/zc.buildout-22.0.0...egg',
]...
......@@ -86,6 +86,6 @@ Let's make sure the generated `buildout` script uses it::
>>> print_(open(buildout_script).read()) # doctest: +ELLIPSIS
#...
sys.path[0:0] = [
'/sample/eggs/distribute-...egg',
'/sample/eggs/setuptools-...egg',
'/sample/eggs/zc.buildout-2.0.0...egg',
]...
......@@ -56,7 +56,7 @@ def print_(*args, **kw):
realpath = zc.buildout.easy_install.realpath
pkg_resources_loc = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('distribute')).location
pkg_resources.Requirement.parse('setuptools')).location
_isurl = re.compile('([a-zA-Z0-9+.-]+)://').match
......@@ -371,9 +371,9 @@ class Buildout(DictMixin):
self._setup_directories()
# Now copy buildout and distribute eggs, and record destination eggs:
# Now copy buildout and setuptools eggs, and record destination eggs:
entries = []
for name in 'distribute', 'zc.buildout':
for name in 'setuptools', 'zc.buildout':
r = pkg_resources.Requirement.parse(name)
dist = pkg_resources.working_set.find(r)
if dist.precedence == pkg_resources.DEVELOP_DIST:
......@@ -871,7 +871,7 @@ class Buildout(DictMixin):
self._log_level = level
def _maybe_upgrade(self):
# See if buildout or distribute need to be upgraded.
# See if buildout or setuptools need to be upgraded.
# If they do, do the upgrade and restart the buildout process.
__doing__ = 'Checking for upgrades.'
......@@ -879,7 +879,7 @@ class Buildout(DictMixin):
return
ws = zc.buildout.easy_install.install(
('zc.buildout', 'distribute'),
('zc.buildout', 'setuptools'),
self['buildout']['eggs-directory'],
links = self['buildout'].get('find-links', '').split(),
index = self['buildout'].get('index'),
......@@ -888,7 +888,7 @@ class Buildout(DictMixin):
)
upgraded = []
for project in 'zc.buildout', 'distribute':
for project in 'zc.buildout', 'setuptools':
req = pkg_resources.Requirement.parse(project)
project_location = pkg_resources.working_set.find(req).location
if ws.find(req).location != project_location:
......@@ -1041,7 +1041,7 @@ class Buildout(DictMixin):
fd, tsetup = tempfile.mkstemp()
try:
os.write(fd, (zc.buildout.easy_install.runsetup_template % dict(
distribute=pkg_resources_loc,
setuptools=pkg_resources_loc,
setupdir=os.path.dirname(setup),
setup=setup,
__file__ = setup,
......@@ -1789,7 +1789,7 @@ Commands:
bootstrap
Create a new buildout in the current working directory, copying
the buildout and distribute eggs and, creating a basic directory
the buildout and setuptools eggs and, creating a basic directory
structure and a buildout-local buildout script.
init
......@@ -1800,9 +1800,9 @@ Commands:
setup script [setup command and options]
Run a given setup script arranging that distribute is in the
Run a given setup script arranging that setuptools is in the
script's path and and that it has been imported so that
distribute-provided commands (like bdist_egg) can be used even if
setuptools-provided commands (like bdist_egg) can be used even if
the setup script doesn't import setuptools.
The script can be given either as a script path or a path to a
......
......@@ -18,7 +18,7 @@ buildout software and create a buildout instance:
script installed in a Python scripts area.
2. Use the buildout bootstrap script to create a buildout that
includes both the distribute and zc.buildout eggs. This allows you
includes both the setuptools and zc.buildout eggs. This allows you
to use the buildout software without modifying a Python install.
The buildout script is installed into your buildout local scripts
area.
......@@ -32,7 +32,7 @@ such as a subversion repository, that includes some software source
directories, buildout configuration files, and a copy of the buildout
bootstrap script. To work on the project, one would check out the
project from the repository and run the bootstrap script which
installs distribute and zc.buildout into the checkout as well as any
installs setuptools and zc.buildout into the checkout as well as any
parts defined.
We have a sample buildout that we created using the bootstrap command
......@@ -53,8 +53,8 @@ The bin directory contains scripts.
- buildout
>>> ls(sample_buildout, 'eggs')
- distribute-0.6-py2.4.egg
- zc.buildout-1.0-py2.4.egg
- setuptools-0.7-py3.3.egg
- zc.buildout.egg-link
The develop-eggs and parts directories are initially empty:
......@@ -228,7 +228,7 @@ classes must be exposed as entry points in the zc.buildout group. we
give entry points names within the group.
We also need a README.txt for our recipes to avoid an annoying warning
from distutils, on which distribute and zc.buildout are based:
from distutils, on which setuptools and zc.buildout are based:
>>> write(sample_buildout, 'recipes', 'README.txt', " ")
......@@ -2482,10 +2482,10 @@ database is shown.
... """)
>>> print_(system(buildout+' -vv'), end='') # doctest: +NORMALIZE_WHITESPACE
Installing 'zc.buildout', 'distribute'.
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'distribute'.
Picked: distribute = 0.6
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.7
<BLANKLINE>
Configuration data:
[buildout]
......@@ -2707,7 +2707,7 @@ Creating new buildouts and bootstrapping
----------------------------------------
If zc.buildout is installed, you can use it to create a new buildout
with it's own local copies of zc.buildout and distribute and with
with it's own local copies of zc.buildout and setuptools and with
local buildout scripts.
>>> sample_bootstrapped = tmpdir('sample-bootstrapped')
......@@ -2744,13 +2744,13 @@ We also get other buildout artifacts:
>>> _ = (ls(sample_bootstrapped, 'eggs'),
... ls(sample_bootstrapped, 'develop-eggs'))
- distribute-0.6-py2.3.egg
- setuptools-0.7-py2.3.egg
- zc.buildout-1.0-py2.3.egg
(We list both the eggs and develop-eggs directories because the
buildout or distribute egg could be installed in the develop-eggs
buildout or setuptools egg could be installed in the develop-eggs
directory if the original buildout had develop eggs for either
buildout or distribute.)
buildout or setuptools.)
Note that the buildout script was installed but not run. To run
the buildout, we'd have to run the installed buildout script.
......
......@@ -14,7 +14,7 @@
"""Python easy_install API
This module provides a high-level Python API for installing packages.
It doesn't install scripts. It uses distribute and requires it to be
It doesn't install scripts. It uses setuptools and requires it to be
installed.
"""
......@@ -57,24 +57,24 @@ if is_jython:
jython_os_name = (java.lang.System.getProperties()['os.name']).lower()
# Make sure we're not being run with an older bootstrap.py that gives us
# setuptools instead of distribute
# setuptools instead of setuptools
has_distribute = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('distribute')) is not None
has_setuptools = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('setuptools')) is not None
if has_setuptools and not has_distribute:
sys.exit("zc.buildout 2 needs distribute, not setuptools."
if has_distribute and not has_setuptools:
sys.exit("zc.buildout 2 needs setuptools, not distribute."
" Are you using an outdated bootstrap.py? Make sure"
" you have the latest version downloaded from"
" http://downloads.buildout.org/2/bootstrap.py")
distribute_loc = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('distribute')
setuptools_loc = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('setuptools')
).location
# Include buildout and distribute eggs in paths
buildout_and_distribute_path = [
distribute_loc,
# Include buildout and setuptools eggs in paths
buildout_and_setuptools_path = [
setuptools_loc,
pkg_resources.working_set.find(
pkg_resources.Requirement.parse('zc.buildout')).location,
]
......@@ -182,7 +182,7 @@ class Installer:
links.insert(0, self._download_cache)
self._index_url = index
path = (path and path[:] or []) + buildout_and_distribute_path
path = (path and path[:] or []) + buildout_and_setuptools_path
if dest is not None and dest not in path:
path.insert(0, dest)
self._path = path
......@@ -290,7 +290,7 @@ class Installer:
tmp = tempfile.mkdtemp(dir=dest)
try:
path = distribute_loc
path = setuptools_loc
args = [sys.executable, '-c', _easy_install_cmd, '-mZUNxd', tmp]
level = logger.getEffectiveLevel()
......@@ -432,7 +432,7 @@ class Installer:
and (realpath(new_location) == realpath(dist.location))
and os.path.isfile(new_location)
):
# distribute avoids making extra copies, but we want to copy
# setuptools avoids making extra copies, but we want to copy
# to the download cache
shutil.copy2(new_location, tmp)
new_location = os.path.join(tmp, os.path.basename(new_location))
......@@ -551,21 +551,21 @@ class Installer:
return dists
def _maybe_add_distribute(self, ws, dist):
def _maybe_add_setuptools(self, ws, dist):
if dist.has_metadata('namespace_packages.txt'):
for r in dist.requires():
if r.project_name in ('setuptools', 'distribute'):
if r.project_name in ('setuptools', 'setuptools'):
break
else:
# We have a namespace package but no requirement for distribute
# We have a namespace package but no requirement for setuptools
if dist.precedence == pkg_resources.DEVELOP_DIST:
logger.warn(
"Develop distribution: %s\n"
"uses namespace packages but the distribution "
"does not require distribute.",
"does not require setuptools.",
dist)
requirement = self._constrain(
pkg_resources.Requirement.parse('distribute')
pkg_resources.Requirement.parse('setuptools')
)
if ws.find(requirement) is None:
for dist in self._get_dist(requirement, ws):
......@@ -600,7 +600,7 @@ class Installer:
for requirement in requirements:
for dist in self._get_dist(requirement, ws):
ws.add(dist)
self._maybe_add_distribute(ws, dist)
self._maybe_add_setuptools(ws, dist)
# OK, we have the requested distributions and they're in the working
# set, but they may have unmet requirements. We'll simply keep
......@@ -625,7 +625,7 @@ class Installer:
for dist in self._get_dist(requirement, ws):
ws.add(dist)
self._maybe_add_distribute(ws, dist)
self._maybe_add_setuptools(ws, dist)
except pkg_resources.VersionConflict:
err = sys.exc_info()[1]
raise VersionConflict(err, ws)
......@@ -848,7 +848,7 @@ def develop(setup, dest,
undo.append(lambda: os.close(fd))
os.write(fd, (runsetup_template % dict(
distribute=distribute_loc,
setuptools=setuptools_loc,
setupdir=directory,
setup=setup,
__file__ = setup,
......@@ -1239,7 +1239,7 @@ if _interactive:
runsetup_template = """
import sys
sys.path.insert(0, %(setupdir)r)
sys.path.insert(0, %(distribute)r)
sys.path.insert(0, %(setuptools)r)
import os, setuptools
......
......@@ -127,10 +127,10 @@ about versions used. If we run the buildout in verbose mode without
specifying a versions section:
>>> print_(system(buildout+' buildout:versions= -v'), end='')
Installing 'zc.buildout', 'distribute'.
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'distribute'.
Picked: distribute = 0.6
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
Installing 'spam'.
We have the best distribution that satisfies 'spam'.
Picked: spam = 2.
......@@ -149,10 +149,10 @@ that we can fix them in a versions section.
If we run the buildout with the versions section:
>>> print_(system(buildout+' -v'), end='')
Installing 'zc.buildout', 'distribute'.
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'distribute'.
Picked: distribute = 0.6
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
Installing 'spam'.
We have the distribution that satisfies 'spam==1'.
Uninstalling foo.
......@@ -160,7 +160,7 @@ If we run the buildout with the versions section:
recipe v1
We won't get output for the spam distribution, which we didn't pick,
but we will get output for distribute, which we didn't specify
but we will get output for setuptools, which we didn't specify
versions for.
You can request buildout to generate an error if it picks any
......@@ -184,8 +184,8 @@ versions:
While:
Installing.
Checking for upgrades.
Getting distribution for 'distribute'.
Error: Picked: distribute = 0.6.30
Getting distribution for 'setuptools'.
Error: Picked: setuptools = 0.6.30
We can name a version something else, if we wish, using the versions option:
......@@ -236,12 +236,12 @@ Since buildout 2.0, the functionality of the `buildout-versions
<http://packages.python.org/buildout-versions/>`_ extension is part of
buildout itself. This makes reporting and managing versions easier.
Buildout picks a version for distribute and for the tests, we need to grab the
Buildout picks a version for setuptools and for the tests, we need to grab the
version number:
>>> import pkg_resources
>>> req = pkg_resources.Requirement.parse('distribute')
>>> distribute_version = pkg_resources.working_set.find(req).version
>>> req = pkg_resources.Requirement.parse('setuptools')
>>> setuptools_version = pkg_resources.working_set.find(req).version
If you set the ``show-picked-versions`` option, buildout will print
versions it picked at the end of its run:
......@@ -264,7 +264,7 @@ versions it picked at the end of its run:
Versions had to be automatically picked.
The following part definition lists the versions picked:
[versions]
distribute = 0.6.99
setuptools = 0.6.99
spam = 2
When everything is pinned, no output is generated:
......@@ -277,12 +277,12 @@ When everything is pinned, no output is generated:
... show-picked-versions = true
...
... [versions]
... distribute = %s
... setuptools = %s
... spam = 2
...
... [foo]
... recipe = spam
... ''' % (join('recipe', 'dist'), distribute_version))
... ''' % (join('recipe', 'dist'), setuptools_version))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
......@@ -306,7 +306,7 @@ and case differences won't impact the pinning:
...
... [foo]
... recipe = spam
... ''' % (join('recipe', 'dist'), distribute_version))
... ''' % (join('recipe', 'dist'), setuptools_version))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
......@@ -318,9 +318,9 @@ extending from that versions file:
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute = %s
... setuptools = %s
... spam = 2
... ''' % distribute_version)
... ''' % setuptools_version)
>>> write('buildout.cfg',
... '''
... [buildout]
......@@ -343,8 +343,8 @@ at the end.
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute = %s
... ''' % distribute_version)
... setuptools = %s
... ''' % setuptools_version)
>>> write('buildout.cfg',
... '''
... [buildout]
......@@ -384,8 +384,8 @@ printing them to the console):
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute = %s
... ''' % distribute_version)
... setuptools = %s
... ''' % setuptools_version)
>>> write('buildout.cfg',
... '''
... [buildout]
......
......@@ -5,12 +5,12 @@ Buildouts are often used to work on packages that will be distributed
as eggs. During development, we use develop eggs. When you've
completed a development cycle, you'll need to run your setup script to
generate a distribution and, perhaps, uploaded it to the Python
package index. If your script uses setuptools, you'll need distribute
package index. If your script uses setuptools, you'll need setuptools
in your Python path, which may be an issue if you haven't installed
distribute into your Python installation.
setuptools into your Python installation.
The buildout setup command is helpful in a situation like this. It
can be used to run a setup script and it does so with the distribute
can be used to run a setup script and it does so with the setuptools
egg in the Python path and with setuptools already imported. The fact
that setuptools is imported means that you can use setuptools-based
commands, like bdist_egg even with packages that don't use setuptools.
......
......@@ -10,7 +10,7 @@ running the script so setuptools-provided commands are available.
If you use a squeaky-clean Python to do your development, the setup
script that would import setuptools because setuptools isn't in the
path. Because buildout requires setuptools and knows where it has
installed a distribute egg, it adds the distribute egg to the Python
installed a setuptools egg, it adds the setuptools egg to the Python
path before running the script. To run a setup script, use the
buildout setup command, passing the name of a script or a directory
containing a setup script and arguments to the script. Let's look at
......
......@@ -46,8 +46,8 @@ print_ = zc.buildout.buildout.print_
fsync = getattr(os, 'fsync', lambda fileno: None)
is_win32 = sys.platform == 'win32'
distribute_location = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('distribute')).location
setuptools_location = pkg_resources.working_set.find(
pkg_resources.Requirement.parse('setuptools')).location
def cat(dir, *names):
path = os.path.join(dir, *names)
......@@ -143,7 +143,7 @@ def _runsetup(setup, *args):
os.chdir(os.path.dirname(setup))
zc.buildout.easy_install.call_subprocess(
[sys.executable, setup] + args,
env=dict(os.environ, PYTHONPATH=distribute_location))
env=dict(os.environ, PYTHONPATH=setuptools_location))
if os.path.exists('build'):
rmtree('build')
finally:
......@@ -525,6 +525,9 @@ normalize_exception_type_for_python_2_and_3 = (
not_found = (re.compile(r'Not found: [^\n]+/(\w|\.)+/\r?\n'), '')
adding_find_link = (re.compile(r"Adding find link '[^']+'"
r" from setuptools 0.7/\r?\n"), '')
ignore_not_upgrading = (
re.compile(
'Not upgrading because not running a local buildout command.\n'
......
This diff is collapsed.
......@@ -2,13 +2,13 @@ Automatic Buildout Updates
==========================
When a buildout is run, one of the first steps performed is to check for
updates to either zc.buildout or distribute. To
updates to either zc.buildout or setuptools. To
demonstrate this, we've created some "new releases" of buildout and
distribute in a new_releases folder:
setuptools in a new_releases folder:
>>> ls(new_releases)
d distribute
- distribute-99.99-py2.4.egg
d setuptools
- setuptools-99.99-py2.4.egg
d zc.buildout
- zc.buildout-99.99-py2.4.egg
......@@ -26,7 +26,7 @@ Let's update the sample buildout.cfg to look in this area:
... recipe = showversions
... """ % dict(new_releases=new_releases))
We'll also include a recipe that echos the versions of distribute and
We'll also include a recipe that echos the versions of setuptools and
zc.buildout used:
>>> mkdir(sample_buildout, 'showversions')
......@@ -43,7 +43,7 @@ zc.buildout used:
... pass
...
... def install(self):
... for project in 'zc.buildout', 'distribute':
... for project in 'zc.buildout', 'setuptools':
... req = pkg_resources.Requirement.parse(project)
... print_(project, pkg_resources.working_set.find(req).version)
... return ()
......@@ -68,17 +68,17 @@ new versions found in new releases:
>>> print_(system(buildout), end='')
Getting distribution for 'zc.buildout>=1.99'.
Got zc.buildout 99.99.
Getting distribution for 'distribute'.
Got distribute 99.99.
Getting distribution for 'setuptools'.
Got setuptools 99.99.
Upgraded:
zc.buildout version 99.99,
distribute version 99.99;
setuptools version 99.99;
restarting.
Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/showversions'
Installing show-versions.
zc.buildout 99.99
distribute 99.99
setuptools 99.99
Our buildout script has been updated to use the new eggs:
......@@ -88,7 +88,7 @@ Our buildout script has been updated to use the new eggs:
import sys
sys.path[0:0] = [
'/sample-buildout/eggs/zc.buildout-99.99-py2.4.egg',
'/sample-buildout/eggs/distribute-99.99-py2.4.egg',
'/sample-buildout/eggs/setuptools-99.99-py2.4.egg',
]
<BLANKLINE>
import zc.buildout.buildout
......@@ -97,7 +97,7 @@ Our buildout script has been updated to use the new eggs:
sys.exit(zc.buildout.buildout.main())
Now, let's recreate the sample buildout. If we specify constraints on
the versions of zc.buildout and distribute to use, running the buildout
the versions of zc.buildout and setuptools to use, running the buildout
will install earlier versions of these packages:
>>> write(sample_buildout, 'buildout.cfg',
......@@ -110,7 +110,7 @@ will install earlier versions of these packages:
...
... [versions]
... zc.buildout = < 99
... distribute = < 99
... setuptools = < 99
...
... [show-versions]
... recipe = showversions
......@@ -121,13 +121,13 @@ Now we can see that we actually "upgrade" to an earlier version.
>>> print_(system(buildout), end='')
Upgraded:
zc.buildout version 1.4.4;
distribute version 0.6;
setuptools version 0.6;
restarting.
Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/showversions'
Updating show-versions.
zc.buildout 1.0.0
distribute 0.6
setuptools 0.6
There are a number of cases, described below, in which the updates
don't happen.
......@@ -150,7 +150,7 @@ We won't upgrade in offline mode:
Develop: '/sample-buildout/showversions'
Updating show-versions.
zc.buildout 1.0.0
distribute 0.6
setuptools 0.6
Or in non-newest mode:
......@@ -158,7 +158,7 @@ Or in non-newest mode:
Develop: '/sample-buildout/showversions'
Updating show-versions.
zc.buildout 1.0.0
distribute 0.6
setuptools 0.6
We also won't upgrade if the buildout script being run isn't in the
buildouts bin directory. To see this we'll create a new buildout
......@@ -181,8 +181,8 @@ directory:
Creating directory '/sample_buildout2/develop-eggs'.
Getting distribution for 'zc.buildout>=1.99'.
Got zc.buildout 99.99.
Getting distribution for 'distribute'.
Got distribute 99.99.
Getting distribution for 'setuptools'.
Got setuptools 99.99.
Not upgrading because not running a local buildout command.
>>> ls('bin')
......@@ -206,14 +206,14 @@ directory:
>>> print_(system(buildout), end='')
Upgraded:
zc.buildout version 99.99,
distribute version 99.99;
setuptools version 99.99;
restarting.
Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/showversions'
Unused options for buildout: 'relative-paths'.
Updating show-versions.
zc.buildout 99.99
distribute 99.99
setuptools 99.99
>>> cat('bin', 'buildout') # doctest +ELL
#!/usr/local/bin/python2.7
......@@ -227,7 +227,7 @@ directory:
import sys
sys.path[0:0] = [
join(base, 'eggs/zc.buildout-99.99-py3.3.egg'),
join(base, 'eggs/distribute-99.99-py3.3.egg'),
join(base, 'eggs/setuptools-99.99-py3.3.egg'),
]
<BLANKLINE>
import zc.buildout.buildout
......@@ -282,7 +282,7 @@ gives us a sys.exit:
...
... [versions]
... zc.buildout = < 99
... distribute = < 99
... setuptools = < 99
...
... [fail]
... recipe = failrecipe
......@@ -293,7 +293,7 @@ Run the buildout:
>>> print_(system(buildout, with_exit_code=True), end='')
Upgraded:
zc.buildout version 1.4.4;
distribute version 0.6;
setuptools version 0.6;
restarting.
Generated script '/sample-buildout/bin/buildout'.
Develop: '/sample-buildout/failrecipe'
......
......@@ -74,7 +74,7 @@ Now, if we look at the buildout eggs directory:
>>> ls(sample_buildout, 'eggs')
d demo-0.2-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.3.egg
- setuptools-0.7-py2.3.egg
d zc.buildout-1.0-py2.3.egg
We see that we got an egg for demo that met the requirement, as well
......@@ -263,7 +263,7 @@ We didn't get an update for demo:
>>> ls(sample_buildout, 'eggs')
d demo-0.2-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.3.egg
- setuptools-0.7-py2.3.egg
d zc.buildout-1.0-py2.3.egg
If we run the buildout on the default online and newest modes,
......@@ -281,7 +281,7 @@ Then we'll get a new demo egg:
d demo-0.2-py2.3.egg
d demo-0.3-py2.3.egg
d demoneeded-1.1-py2.3.egg
d distribute-0.6-py2.4.egg
- setuptools-0.7-py2.4.egg
d zc.buildout-1.0-py2.4.egg
The script is updated too:
......
......@@ -106,7 +106,7 @@ computed by the egg recipe by looking at .installed.cfg:
__buildout_installed__ =
__buildout_signature__ = sample-6aWMvV2EJ9Ijq+bR8ugArQ==
zc.recipe.egg-cAsnudgkduAa/Fd+WJIM6Q==
distribute-0.6-py2.4.egg
setuptools-0.7-py2.4.egg
zc.buildout-+rYeCcmFuD1K/aB77XTj5A==
_b = /sample-buildout/bin
_d = /sample-buildout/develop-eggs
......
......@@ -145,11 +145,11 @@ class Scripts(Eggs):
if get_bool(options, 'dependent-scripts'):
# Generate scripts for all packages in the working set,
# except distribute.
# except setuptools.
reqs = list(reqs)
for dist in ws:
name = dist.project_name
if name != 'distribute' and name not in reqs:
if name != 'setuptools' and name not in reqs:
reqs.append(name)
return zc.buildout.easy_install.scripts(
......
......@@ -51,7 +51,7 @@ def test_suite():
zc.buildout.testing.not_found,
(re.compile('[d-] zc.buildout(-\S+)?[.]egg(-link)?'),
'zc.buildout.egg'),
(re.compile('[d-] distribute-[^-]+-'), 'distribute-X-'),
(re.compile('[d-] setuptools-[^-]+-'), 'setuptools-X-'),
(re.compile(r'eggs\\\\demo'), 'eggs/demo'),
(re.compile(r'[a-zA-Z]:\\\\foo\\\\bar'), '/foo/bar'),
])
......@@ -66,7 +66,7 @@ def test_suite():
(re.compile('__buildout_signature__ = '
'sample-\S+\s+'
'zc.recipe.egg-\S+\s+'
'distribute-\S+\s+'
'setuptools-\S+\s+'
'zc.buildout-\S+\s*'
),
'__buildout_signature__ = sample- zc.recipe.egg-'),
......
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