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
Rafael Monnerat
slapos.buildout
Commits
bb335abb
Commit
bb335abb
authored
Apr 26, 2013
by
Jaap Roes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added tests (and made them pass) for update_versions_file's output.
parent
f0b0aa45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
11 deletions
+25
-11
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+8
-6
src/zc/buildout/repeatable.txt
src/zc/buildout/repeatable.txt
+14
-4
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+3
-1
No files found.
src/zc/buildout/buildout.py
View file @
bb335abb
...
@@ -135,7 +135,7 @@ def _format_picked_versions(picked_versions, required_by):
...
@@ -135,7 +135,7 @@ def _format_picked_versions(picked_versions, required_by):
target
=
output
target
=
output
target
.
append
(
"%s = %s"
%
(
dist_
,
version
))
target
.
append
(
"%s = %s"
%
(
dist_
,
version
))
output
.
extend
(
required_output
)
output
.
extend
(
required_output
)
return
'
\
n
'
.
join
(
output
)
return
output
_buildout_default_options
=
_annotate_section
({
_buildout_default_options
=
_annotate_section
({
...
@@ -1017,16 +1017,18 @@ class Buildout(DictMixin):
...
@@ -1017,16 +1017,18 @@ class Buildout(DictMixin):
if
self
.
show_picked_versions
:
if
self
.
show_picked_versions
:
print_
(
"Versions had to be automatically picked."
)
print_
(
"Versions had to be automatically picked."
)
print_
(
"The following part definition lists the versions picked:"
)
print_
(
"The following part definition lists the versions picked:"
)
print_
(
output
)
print_
(
'
\
n
'
.
join
(
output
)
)
if
self
.
update_versions_file
:
if
self
.
update_versions_file
:
# Write to the versions file.
# Write to the versions file.
if
os
.
path
.
exists
(
self
.
update_versions_file
):
if
os
.
path
.
exists
(
self
.
update_versions_file
):
output
+=
(
'
\
n
# Added by buildout at %s'
%
output
[:
1
]
=
[
datetime
.
datetime
.
now
())
''
,
output
+=
'
\
n
'
'# Added by buildout at %s'
%
datetime
.
datetime
.
now
()
]
output
.
append
(
''
)
f
=
open
(
self
.
update_versions_file
,
'a'
)
f
=
open
(
self
.
update_versions_file
,
'a'
)
f
.
write
(
output
)
f
.
write
(
(
'
\
n
'
.
join
(
output
))
)
f
.
close
()
f
.
close
()
print_
(
"Picked versions have been written to "
+
print_
(
"Picked versions have been written to "
+
self
.
update_versions_file
)
self
.
update_versions_file
)
...
...
src/zc/buildout/repeatable.txt
View file @
bb335abb
...
@@ -368,8 +368,13 @@ at the end.
...
@@ -368,8 +368,13 @@ at the end.
The versions file now contains the extra pin:
The versions file now contains the extra pin:
>>> 'spam = 2' in open('my_versions.cfg').read()
>>> print_(open('my_versions.cfg').read()) # doctest: +ELLIPSIS
True
<BLANKLINE>
...
<BLANKLINE>
# Added by buildout at YYYY-MM-DD hh:mm:ss.dddddd
spam = 2
<BLANKLINE>
And re-running buildout doesn't report any picked versions anymore:
And re-running buildout doesn't report any picked versions anymore:
...
@@ -405,8 +410,13 @@ printing them to the console):
...
@@ -405,8 +410,13 @@ printing them to the console):
The versions file contains the extra pin:
The versions file contains the extra pin:
>>> 'spam = 2' in open('my_versions.cfg').read()
>>> print_(open('my_versions.cfg').read()) # doctest: +ELLIPSIS
True
<BLANKLINE>
...
<BLANKLINE>
# Added by buildout at YYYY-MM-DD hh:mm:ss.dddddd
spam = 2
<BLANKLINE>
Because buildout now includes buildout-versions' (and part of the older
Because buildout now includes buildout-versions' (and part of the older
buildout.dumppickedversions') functionality, it warns if these extensions are
buildout.dumppickedversions') functionality, it warns if these extensions are
...
...
src/zc/buildout/tests.py
View file @
bb335abb
...
@@ -3293,7 +3293,9 @@ def test_suite():
...
@@ -3293,7 +3293,9 @@ def test_suite():
),
),
(re.compile('
executable
=
%
s
' % re.escape(sys.executable)),
(re.compile('
executable
=
%
s
' % re.escape(sys.executable)),
'
executable
=
python
'),
'
executable
=
python
'),
])
(re.compile(r'
\
d
{
4
}
-
\
d
{
2
}
-
\
d
{
2
}
\
d
{
2
}:
\
d
{
2
}:
\
d
{
2
}
\
.
\
d
{
6
}
'),
'
YYYY
-
MM
-
DD
hh
:
mm
:
ss
.
dddddd
'),
]),
),
),
doctest.DocFileSuite(
doctest.DocFileSuite(
'
debugging
.
txt
',
'
debugging
.
txt
',
...
...
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