Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thomas Leymonerie
slapos.buildout
Commits
4837ab2d
Commit
4837ab2d
authored
Nov 06, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Various whitespace, formatting and typo cleanups. Thanks Gary!
parent
845467c6
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
89 additions
and
82 deletions
+89
-82
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+6
-6
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+32
-30
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+5
-0
src/zc/buildout/setup.txt
src/zc/buildout/setup.txt
+5
-3
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+1
-1
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+15
-16
src/zc/buildout/testselectingpython.py
src/zc/buildout/testselectingpython.py
+3
-3
src/zc/buildout/unzip.txt
src/zc/buildout/unzip.txt
+3
-4
src/zc/buildout/update.txt
src/zc/buildout/update.txt
+9
-9
zc.recipe.egg_/src/zc/recipe/egg/README.txt
zc.recipe.egg_/src/zc/recipe/egg/README.txt
+3
-3
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+7
-7
No files found.
src/zc/buildout/buildout.py
View file @
4837ab2d
...
...
@@ -52,11 +52,11 @@ if is_jython:
import
subprocess
class
MissingOption
(
zc
.
buildout
.
UserError
,
KeyError
):
"""A required option was missing
"""A required option was missing
.
"""
class
MissingSection
(
zc
.
buildout
.
UserError
,
KeyError
):
"""A required section is missin
h
"""A required section is missin
g.
"""
def
__str__
(
self
):
...
...
@@ -145,8 +145,8 @@ class Buildout(UserDict.DictMixin):
print
'Creating %r.'
%
config_file
open
(
config_file
,
'w'
).
write
(
'[buildout]
\
n
parts =
\
n
'
)
elif
command
==
'setup'
:
# Sigh.
this model of a buildout
nstance
# with methods is breaking down :(
# Sigh.
This model of a buildout i
nstance
# with methods is breaking down
.
:(
config_file
=
None
data
[
'buildout'
][
'directory'
]
=
(
'.'
,
'COMPUTED_VALUE'
)
else
:
...
...
@@ -334,7 +334,7 @@ class Buildout(UserDict.DictMixin):
return
os
.
path
.
join
(
self
.
_buildout_dir
,
name
)
def
bootstrap
(
self
,
args
):
__doing__
=
'Bootstraping.'
__doing__
=
'Bootstrap
p
ing.'
self
.
_setup_directories
()
...
...
@@ -905,7 +905,7 @@ class Buildout(UserDict.DictMixin):
if
not
args
:
raise
zc
.
buildout
.
UserError
(
"The setup command requires the path to a setup script or
\
n
"
"directory containing a setup script, and it
'
s arguments."
"directory containing a setup script, and its arguments."
)
setup
=
args
.
pop
(
0
)
if
os
.
path
.
isdir
(
setup
):
...
...
src/zc/buildout/buildout.txt
View file @
4837ab2d
...
...
@@ -575,7 +575,8 @@ When we rerun the buildout:
.. Wait for the file to really disappear. My linux is weird.
>>> wait_until("foo goes away", lambda : not os.path.exists('foo'))
>>> wait_until("foo goes away", lambda : not os.path.exists('foo'),
... timeout=100)
we get the same error, but we don't get the directory left behind:
...
...
@@ -716,7 +717,8 @@ all key-value pairs are displayed, sorted alphabetically, along with
the origin of the value (file name or COMPUTED_VALUE, DEFAULT_VALUE,
COMMAND_LINE_VALUE).
>>> print system(buildout+ ' annotate'), # doctest: +ELLIPSIS
>>> print system(buildout+ ' annotate'),
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
...
...
@@ -1156,7 +1158,7 @@ Annotated sections output shows which files are responsible for which
operations.
>>> print system(os.path.join('bin', 'buildout') + ' annotate'),
... # doctest: +ELLIPSIS
... # doctest: +ELLIPSIS
+NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
...
...
@@ -1191,7 +1193,6 @@ operations.
[part4]
option= h1 h2
/sample-buildout/extension1.cfg
...
Cleanup.
...
...
@@ -1902,6 +1903,7 @@ the buildout in the usual way:
d recipes
>>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link
parts = debug d1 d2 d3
...
...
@@ -1987,6 +1989,7 @@ were created.
The .installed.cfg is only updated for the recipes that ran:
>>> cat(sample_buildout, '.installed.cfg')
... # doctest: +NORMALIZE_WHITESPACE
[buildout]
installed_develop_eggs = /sample-buildout/develop-eggs/recipes.egg-link
parts = debug d1 d2 d3 d4
...
...
@@ -2189,7 +2192,7 @@ database is shown.
... parts =
... """)
>>> print system(buildout+' -vv'),
>>> print system(buildout+' -vv'),
# doctest: +NORMALIZE_WHITESPACE
Installing 'zc.buildout', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'setuptools'.
...
...
@@ -2510,8 +2513,7 @@ buildout installed option:
d recipes
Note that there will be no installation database if there are no
parts:
Note that there will be no installation database if there are no parts:
>>> write('buildout.cfg',
... """
...
...
src/zc/buildout/easy_install.py
View file @
4837ab2d
...
...
@@ -67,6 +67,7 @@ buildout_and_setuptools_path = [
pkg_resources
.
Requirement
.
parse
(
'zc.buildout'
)).
location
,
]
class
IncompatibleVersionError
(
zc
.
buildout
.
UserError
):
"""A specified version is incompatible with a given requirement.
"""
...
...
@@ -95,6 +96,7 @@ def _get_version(executable):
FILE_SCHEME = re.compile('
file
:
//
', re.I).match
class AllowHostsPackageIndex(setuptools.package_index.PackageIndex):
"""Will allow urls that are local to the system.
...
...
@@ -139,6 +141,7 @@ _easy_install_cmd = _safe_arg(
'
from
setuptools.command.easy_install
import
main
;
main
()
'
)
class Installer:
_versions = {}
...
...
@@ -1164,6 +1167,7 @@ sys.argv[0] = %(setup)r
execfile(%(setup)r)
"""
class
VersionConflict
(
zc
.
buildout
.
UserError
):
def
__init__
(
self
,
err
,
ws
):
...
...
@@ -1181,6 +1185,7 @@ class VersionConflict(zc.buildout.UserError):
result
.
append
(
"but %s requires %r."
%
(
dist
,
str
(
req
)))
return
'
\
n
'
.
join
(
result
)
class
MissingDistribution
(
zc
.
buildout
.
UserError
):
def
__init__
(
self
,
req
,
ws
):
...
...
src/zc/buildout/setup.txt
View file @
4837ab2d
...
...
@@ -29,12 +29,14 @@ doesn't import setuptools. Let's try running it to create an egg.
We'll use the buildout script from our sample buildout:
>>> print system(buildout+' setup'),
... # doctest: +NORMALIZE_WHITESPACE
Error: The setup command requires the path to a setup script or
directory containing a setup script, and it
'
s arguments.
directory containing a setup script, and its arguments.
Oops, we forgot to give the name of the setup script:
>>> print system(buildout+' setup setup.py bdist_egg'), # doctest: +ELLIPSIS
>>> print system(buildout+' setup setup.py bdist_egg'),
... # doctest: +ELLIPSIS
Running setup script 'setup.py'.
...
...
...
src/zc/buildout/testing.py
View file @
4837ab2d
...
...
@@ -274,7 +274,7 @@ def buildoutSetUp(test):
# Create the develop-eggs dir, which didn't get created the usual
# way due to th
r
trick above:
# way due to th
e
trick above:
os
.
mkdir
(
'develop-eggs'
)
def
start_server
(
path
):
...
...
src/zc/buildout/tests.py
View file @
4837ab2d
...
...
@@ -260,18 +260,18 @@ def make_dist_that_requires(dest, name, requires=[], version=1, egg=''):
def
show_who_requires_when_there_is_a_conflict
():
"""
It's a pain when we require eggs that have requirements that are
incompatible. We want the error we get to tell us what is missing.
It's a pain when we require eggs that have requirements that are
incompatible. We want the error we get to tell us what is missing.
Let's make a few develop distros, some of which have incompatible
requirements.
Let's make a few develop distros, some of which have incompatible
requirements.
>>> make_dist_that_requires(sample_buildout, 'sampley',
... ['demoneeded ==1.0'])
>>> make_dist_that_requires(sample_buildout, 'samplez',
... ['demoneeded ==1.1'])
Now, let's create a buildout that requires y and z:
Now, let's create a buildout that requires y and z:
>>> write('buildout.cfg',
... '''
...
...
@@ -298,8 +298,8 @@ def show_who_requires_when_there_is_a_conflict():
We already have: demoneeded 1.1
but sampley 1 requires 'demoneeded==1.0'.
Here, we see that sampley required an older version of demoneeded.
What
if we hadn't required sampley ourselves:
Here, we see that sampley required an older version of demoneeded. What
if we hadn't required sampley ourselves:
>>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb'])
>>> make_dist_that_requires(sample_buildout, 'sampleb',
...
...
@@ -317,7 +317,7 @@ def show_who_requires_when_there_is_a_conflict():
... samplez
... ''' % globals())
If we use the verbose switch, we can see where requirements are com
n
ing from:
If we use the verbose switch, we can see where requirements are coming from:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
...
...
@@ -351,10 +351,9 @@ If we use the verbose switch, we can see where requirements are comning from:
def
show_who_requires_missing_distributions
():
"""
When working with a lot of eggs, which require eggs recursively,
it can be hard to tell why we're requireing things we can't find.
Fortunately, buildout will tell us who's asking for something that
we can't find.
When working with a lot of eggs, which require eggs recursively, it can
be hard to tell why we're requiring things we can't find. Fortunately,
buildout will tell us who's asking for something that we can't find.
>>> make_dist_that_requires(sample_buildout, 'sampley', ['demoneeded'])
>>> make_dist_that_requires(sample_buildout, 'samplea', ['sampleb'])
...
...
@@ -387,8 +386,8 @@ def show_who_requires_missing_distributions():
def
test_comparing_saved_options_with_funny_characters
():
"""
If an option has newlines, extra/odd spaces or a %, we need to mak
e
sure
the comparison with the saved value works correctly.
If an option has newlines, extra/odd spaces or a %, we need to make sur
e
the comparison with the saved value works correctly.
>>> mkdir(sample_buildout, 'recipes')
>>> write(sample_buildout, 'recipes', 'debug.py',
...
...
@@ -2158,7 +2157,7 @@ def prefer_final():
"""
This test tests several permutations:
Using different version numbers to work around zip imp
p
orter cache problems. :(
Using different version numbers to work around zip importer cache problems. :(
- With prefer final:
...
...
src/zc/buildout/testselectingpython.py
View file @
4837ab2d
...
...
@@ -25,13 +25,13 @@ __test__ = dict(
test_selecting_python_via_easy_install
=
"""
\
We can specify a
n
specific Python executable.
We can specify a specific Python executable.
>>> dest = tmpdir('sample-install')
>>> ws = zc.buildout.easy_install.install(
... ['demo'], dest, links=[link_server],
... index='http://www.python.org/pypi/',
... always_unzip=True, executable=
other_executable)
... always_unzip=True, executable=other_executable)
>>> ls(dest)
d demo-0.3-py%(other_version)s.egg
...
...
src/zc/buildout/unzip.txt
View file @
4837ab2d
...
...
@@ -21,10 +21,9 @@ By default, zc.buildout doesn't unzip zip-safe eggs.
d setuptools-0.6c8-py2.4.egg
- zc.buildout.egg-link
This follows the
policy followed by setuptools itself. Experience shows this policy
to to be inconvenient. Zipped eggs make debugging more difficult and
often import more slowly.
This follows the policy followed by setuptools itself. Experience shows
this policy to to be inconvenient. Zipped eggs make debugging more
difficult and often import more slowly.
You can include an unzip option in the buildout section to change the
default unzipping policy.
...
...
src/zc/buildout/update.txt
View file @
4837ab2d
zc.recipe.egg_/src/zc/recipe/egg/README.txt
View file @
4837ab2d
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
4837ab2d
...
...
@@ -81,9 +81,9 @@ class Eggs(object):
ws
=
zc
.
buildout
.
easy_install
.
install
(
distributions
,
options
[
'eggs-directory'
],
links
=
self
.
links
,
index
=
self
.
index
,
executable
=
options
[
'executable'
],
links
=
self
.
links
,
index
=
self
.
index
,
executable
=
options
[
'executable'
],
path
=
[
options
[
'develop-eggs-directory'
]],
newest
=
self
.
buildout
[
'buildout'
].
get
(
'newest'
)
==
'true'
,
allow_hosts
=
self
.
allow_hosts
,
...
...
@@ -150,7 +150,7 @@ class Scripts(Eggs):
reqs
.
append
(
parsed
.
groups
())
if
get_bool
(
options
,
'dependent-scripts'
):
#
g
enerate scripts for all packages in the working set,
#
G
enerate scripts for all packages in the working set,
# except setuptools.
reqs
=
list
(
reqs
)
for
dist
in
ws
:
...
...
@@ -183,6 +183,6 @@ def get_bool(options, name, default=False):
return
False
else
:
raise
zc
.
buildout
.
UserError
(
"Invalid value for %s: %s"
%
(
name
,
value
))
"Invalid value for %s
option
: %s"
%
(
name
,
value
))
Egg
=
Scripts
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment