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
Łukasz Nowak
slapos.buildout
Commits
47645243
Commit
47645243
authored
Dec 30, 2012
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cherry-picked
d3c78d5c
Make sure (???) buildout doesn't downgrade due to defer-final
parent
ecac6b62
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
24 deletions
+92
-24
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+16
-4
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+2
-1
src/zc/buildout/repeatable.txt
src/zc/buildout/repeatable.txt
+2
-2
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+69
-14
src/zc/buildout/update.txt
src/zc/buildout/update.txt
+3
-3
No files found.
src/zc/buildout/buildout.py
View file @
47645243
...
...
@@ -277,8 +277,11 @@ class Buildout(UserDict.DictMixin):
versions
=
options
.
get
(
'versions'
)
if
versions
:
zc
.
buildout
.
easy_install
.
default_versions
(
dict
(
self
[
versions
]))
versions
=
dict
(
self
[
versions
])
zc
.
buildout
.
easy_install
.
default_versions
(
versions
)
else
:
versions
=
{}
self
.
versions
=
versions
self
.
offline
=
options
.
get_bool
(
'offline'
)
if
self
.
offline
:
...
...
@@ -881,13 +884,22 @@ class Buildout(UserDict.DictMixin):
if
not
self
.
newest
:
return
options
=
self
[
'buildout'
]
specs
=
[
'zc.buildout'
]
if
zc
.
buildout
.
easy_install
.
is_distribute
:
specs
.
append
(
'distribute'
)
else
:
specs
.
append
(
'setuptools'
)
# Prevent downgrading due to prefer-final:
options
=
self
[
'buildout'
]
if
not
(
'zc.buildout-version'
in
options
or
'zc.buildout'
in
self
.
versions
):
v
=
pkg_resources
.
working_set
.
find
(
pkg_resources
.
Requirement
.
parse
(
'zc.buildout'
)
).
version
options
[
'zc.buildout-version'
]
=
'>='
+
v
ws
=
zc
.
buildout
.
easy_install
.
install
(
[
(
spec
+
' '
+
options
.
get
(
spec
+
'-version'
,
''
)).
strip
()
...
...
src/zc/buildout/buildout.txt
View file @
47645243
...
...
@@ -2259,7 +2259,7 @@ database is shown.
... """)
>>> print system(buildout+' -vv'), # doctest: +NORMALIZE_WHITESPACE
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.9a1
', 'setuptools'.
We have a develop egg: zc.buildout X.X.
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = V.V
...
...
@@ -2293,6 +2293,7 @@ database is shown.
unzip = false
use-dependency-links = true
verbosity = 20
zc.buildout-version = >=1.9a1
<BLANKLINE>
All of these options can be overridden by configuration files or by
...
...
src/zc/buildout/repeatable.txt
View file @
47645243
...
...
@@ -124,7 +124,7 @@ about versions used. If we run the buildout in verbose mode without
specifying a versions section:
>>> print system(buildout+' buildout:versions= -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
...
...
@@ -146,7 +146,7 @@ that we can fix them in a versions section.
If we run the buildout with the versions section:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0.
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
...
...
src/zc/buildout/tests.py
View file @
47645243
...
...
@@ -321,7 +321,7 @@ if we hadn't required sampley ourselves:
If we use the verbose switch, we can see where requirements are coming from:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
...
...
@@ -420,7 +420,7 @@ indicate the eggs from site-packages that have been selected. You'll see
we have two: demo 0.3 and demoneeded 1.1.
>>> print system(buildout+" -v"),
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.9.0
', 'setuptools'.
We have a develop egg: zc.buildout V
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = V
...
...
@@ -616,7 +616,7 @@ def create_sections_on_command_line():
... ''')
>>> print system(buildout + ' foo:bar=1 -vv'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
...
[foo]
bar = 1
...
...
@@ -2801,7 +2801,7 @@ def dealing_with_extremely_insane_dependencies():
However, if we run in verbose mode, we can see why packages were included:
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.9.0
', 'setuptools'.
We have a develop egg: zc.buildout 1.0.0
We have the best distribution that satisfies 'setuptools'.
Picked: setuptools = 0.6
...
...
@@ -3092,7 +3092,7 @@ The default is prefer-final = false:
... ''' % globals())
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
...
Picked: demo = 0.4c1
...
...
...
@@ -3114,7 +3114,7 @@ We get the same behavior if we add prefer-final = false
... ''' % globals())
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
...
Picked: demo = 0.4c1
...
...
...
@@ -3136,7 +3136,7 @@ distributions:
... ''' % globals())
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing 'zc.buildout', 'setuptools'.
Installing 'zc.buildout
>=1.99
', 'setuptools'.
...
Picked: demo = 0.3
...
...
...
@@ -3160,6 +3160,50 @@ We get an error if we specify anything but true or false:
While:
Initializing.
Error: Invalid value for prefer-final option: no
"""
def
wont_downgrade_due_to_prefer_final
():
r"""
If we install a non-final buildout version, we don't want to
downgrade just bcause we prefer-final. If a buildout version
isn't specified, either through buildout-version or a versions
entry, then buildout-version gets set to >=CURRENT_VERSION.
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... ''')
>>> [v] = [l.split('=', 1)[1].strip()
... for l in system(buildout+' -vv').split('\n')
... if l.startswith('zc.buildout-version = ')]
>>> v == '>=' + pkg_resources.working_set.find(
... pkg_resources.Requirement.parse('zc.buildout')
... ).version
True
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... zc.buildout-version = >.1
... ''')
>>> [l.split('=', 1)[1].strip()
... for l in system(buildout+' -vv').split('\n')
... if l.startswith('zc.buildout-version =')]
['>.1']
>>> write('buildout.cfg',
... '''
... [buildout]
... parts =
... versions = versions
... [versions]
... zc.buildout = 43
... ''')
>>> print system(buildout+' -v'), # doctest: +ELLIPSIS
Installing...
Error: Couldn't find a distribution for 'zc.buildout==43'.
"""
...
...
@@ -3975,6 +4019,8 @@ def test_suite():
zc
.
buildout
.
testing
.
normalize_egg_py
,
zc
.
buildout
.
tests
.
hide_distribute_additions
,
hide_zip_safe_message
,
(
re
.
compile
(
r'zc.buildout-version = >=\
S+
'), ''),
(re.compile(r"Installing '
zc
.
buildout
>=
\
S
+
"), ''),
(re.compile('__buildout_signature__ = recipes-
\
S+
'
),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile('executable = [
\
S ]+py
t
hon
\
S*
'
, re.I),
...
...
@@ -4010,6 +4056,9 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.hide_distribute_additions,
hide_zip_safe_message,
(re.compile(r"
Installing
'zc.buildout >=
\
S+
"
), ''),
(re.compile(r"Getting distribution for '
zc
.
buildout
>=
\
S
+
"),
''),
(re.compile('__buildout_signature__ = recipes-
\
S+
'
),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile('executable = [
\
S ]+py
t
hon
\
S*
'
, re.I),
...
...
@@ -4058,6 +4107,9 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
normalize_bang,
zc.buildout.tests.hide_distribute_additions,
(re.compile(r"
Installing
'zc.buildout >=
\
S+
"
), ''),
(re.compile(r"Getting distribution for '
zc
.
buildout
>=
\
S
+
"),
''),
(re.compile('99[.]99'), 'NINETYNINE.NINETYNINE'),
(re.compile('(zc.buildout|setuptools)-
\
d+[.]
\
d+
\
S*
'
'-py
\
d.
\
d.egg'),
...
...
@@ -4115,12 +4167,12 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([
(
re
.
compile
(
' at -?0x[^>]+'
),
'<MEM ADDRESS>'
),
(
re
.
compile
(
'http://localhost:[0-9]{4,5}/'
),
'http://localhost/'
),
(
re
.
compile
(
'[0-9a-f]{32}'
),
'<MD5 CHECKSUM>'
),
zc
.
buildout
.
testing
.
normalize_path
,
]),
(re.compile(' at -?0x[^>]+'), '<MEM ADDRESS>'),
(re.compile('http://localhost:[0-9]{4,5}/'),
'http://localhost/'),
(re.compile('[0-9a-f]{32}'), '<MD5 CHECKSUM>'),
zc.buildout.testing.normalize_path,
]),
),
doctest.DocTestSuite(
...
...
@@ -4133,6 +4185,8 @@ def test_suite():
zc.buildout.testing.normalize_egg_py,
zc.buildout.tests.hide_distribute_additions,
hide_first_index_page_message,
(re.compile(r"
Installing
'zc.buildout >=
\
S+
"
), '
Installing
'),
(re.compile(r'
^
(
\
w
+
\
.)
*
(
Missing
\
w
+
:
)
'), '
\
2
'),
(re.compile("buildout: Running
\
S*se
t
up.py"),
'
buildout
:
Running
setup
.
py
'),
(re.compile('
(
setuptools
|
distribute
)
-
\
S
+-
'),
...
...
@@ -4151,7 +4205,8 @@ def test_suite():
'-q develop -mxN -d /sample-buildout/develop-eggs'
),
(re.compile(r'^[*]...'), '...'),
# for bug_92891_bootstrap_crashes_with_egg_recipe_in_buildout_section
# for 92891
# bootstrap_crashes_with_egg_recipe_in_buildout_section
(re.compile(r"
Unused
options
for
buildout
:
'eggs'
'scripts'
\
.
"),
"
Unused
options
for
buildout
:
'scripts'
'eggs'
.
"),
(re.compile('distribute'), 'setuptools'),
...
...
src/zc/buildout/update.txt
View file @
47645243
...
...
@@ -65,7 +65,7 @@ Now if we run the buildout, the buildout will upgrade itself to the
new versions found in new releases:
>>> print system(buildout),
Getting distribution for 'zc.buildout'.
Getting distribution for 'zc.buildout
>=1.99
'.
Got zc.buildout 99.99.
Getting distribution for 'setuptools'.
Got setuptools 99.99.
...
...
@@ -200,7 +200,7 @@ directory:
Creating directory '/sample_buildout2/parts'.
Creating directory '/sample_buildout2/eggs'.
Creating directory '/sample_buildout2/develop-eggs'.
Getting distribution for 'zc.buildout'.
Getting distribution for 'zc.buildout
>=1.99
'.
Got zc.buildout 99.99.
Getting distribution for 'setuptools'.
Got setuptools 99.99.
...
...
@@ -233,7 +233,7 @@ We'll mimic this by passing the argument actually in the command line.
>>> print system(buildout +
... ' buildout:accept-buildout-test-releases=true'),
... # doctest: +NORMALIZE_WHITESPACE
Getting distribution for 'zc.buildout'.
Getting distribution for 'zc.buildout
>=1.99
'.
Got zc.buildout 100.0b1.
Upgraded:
zc.buildout version 100.0b1,
...
...
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