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
isaak yansane-sisk
slapos.buildout
Commits
777d4bab
Commit
777d4bab
authored
Aug 21, 2012
by
Hanno Schlichting
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10 from mgedmin/fix-buildout.txt
Fix nondeterministic buildout.txt test failure
parents
82992182
4a4ed77d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
11 deletions
+21
-11
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+9
-11
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+12
-0
No files found.
src/zc/buildout/buildout.txt
View file @
777d4bab
...
@@ -435,6 +435,10 @@ the mkdir recipe to support multiple paths:
...
@@ -435,6 +435,10 @@ the mkdir recipe to support multiple paths:
... pass
... pass
... """)
... """)
..
>>> clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py')
If there is an error creating a path, the install method will exit and
If there is an error creating a path, the install method will exit and
leave previously created paths in place:
leave previously created paths in place:
...
@@ -550,6 +554,10 @@ Let's fix the recipe:
...
@@ -550,6 +554,10 @@ Let's fix the recipe:
... pass
... pass
... """)
... """)
..
>>> clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py')
And put back the typo:
And put back the typo:
>>> write(sample_buildout, 'buildout.cfg',
>>> write(sample_buildout, 'buildout.cfg',
...
@@ -580,11 +588,6 @@ When we rerun the buildout:
...
@@ -580,11 +588,6 @@ When we rerun the buildout:
...
...
OSError: ... exists...
OSError: ... exists...
.. Wait for the file to really disappear. My linux is weird.
>>> wait_until("foo goes away", lambda : not os.path.exists('foo'),
... timeout=200)
we get the same error, but we don't get the directory left behind:
we get the same error, but we don't get the directory left behind:
>>> os.path.exists('foo')
>>> os.path.exists('foo')
...
@@ -638,12 +641,7 @@ recipe:
...
@@ -638,12 +641,7 @@ recipe:
..
..
>>> for path in (
>>> clean_up_pyc(sample_buildout, 'recipes', 'mkdir.py')
... join(sample_buildout, 'recipes', 'mkdir.pyc'),
... join(sample_buildout, 'recipes', '__pycache__', 'mkdir.pyc'),
... ):
... if os.path.exists(path):
... remove(path)
We returned by calling created, taking advantage of the fact that it
We returned by calling created, taking advantage of the fact that it
returns the registered paths. We did this for illustrative purposes.
returns the registered paths. We did this for illustrative purposes.
...
...
src/zc/buildout/testing.py
View file @
777d4bab
...
@@ -93,6 +93,17 @@ def write(dir, *args):
...
@@ -93,6 +93,17 @@ def write(dir, *args):
fsync
(
f
.
fileno
())
fsync
(
f
.
fileno
())
f
.
close
()
f
.
close
()
def
clean_up_pyc
(
*
path
):
base
,
filename
=
os
.
path
.
join
(
*
path
[:
-
1
]),
path
[
-
1
]
if
filename
.
endswith
(
'.py'
):
filename
+=
'c'
# .py -> .pyc
for
path
in
(
os
.
path
.
join
(
base
,
filename
),
os
.
path
.
join
(
base
,
'__pycache__'
,
filename
),
):
if
os
.
path
.
exists
(
path
):
remove
(
path
)
## FIXME - check for other platforms
## FIXME - check for other platforms
MUST_CLOSE_FDS
=
not
sys
.
platform
.
startswith
(
'win'
)
MUST_CLOSE_FDS
=
not
sys
.
platform
.
startswith
(
'win'
)
...
@@ -264,6 +275,7 @@ def buildoutSetUp(test):
...
@@ -264,6 +275,7 @@ def buildoutSetUp(test):
buildout
=
os
.
path
.
join
(
sample
,
'bin'
,
'buildout'
),
buildout
=
os
.
path
.
join
(
sample
,
'bin'
,
'buildout'
),
wait_until
=
wait_until
,
wait_until
=
wait_until
,
print_
=
print_
,
print_
=
print_
,
clean_up_pyc
=
clean_up_pyc
,
))
))
zc
.
buildout
.
easy_install
.
prefer_final
(
prefer_final
)
zc
.
buildout
.
easy_install
.
prefer_final
(
prefer_final
)
...
...
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