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
3d3b61b2
Commit
3d3b61b2
authored
Oct 06, 2012
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test passing on windows and Python 2.6
parent
9d845464
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
54 additions
and
27 deletions
+54
-27
buildout.cfg
buildout.cfg
+1
-0
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+2
-1
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+0
-2
src/zc/buildout/download.py
src/zc/buildout/download.py
+13
-15
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+7
-1
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+6
-0
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+22
-8
zc.recipe.egg_/src/zc/recipe/egg/tests.py
zc.recipe.egg_/src/zc/recipe/egg/tests.py
+3
-0
No files found.
buildout.cfg
View file @
3d3b61b2
...
...
@@ -10,6 +10,7 @@ zope.exceptions = 4.0.1
[py]
recipe = zc.recipe.egg
eggs = zc.buildout
zc.recipe.egg
zope.testing
interpreter = py
...
...
src/zc/buildout/buildout.py
View file @
3d3b61b2
...
...
@@ -394,7 +394,8 @@ class Buildout(DictMixin):
if
args
:
eggs
=
'
\
n
'
.
join
(
a
for
a
in
args
if
not
sep
.
search
(
a
))
paths
=
'
\
n
'
.
join
(
sep
.
sub
(
os
.
path
.
sep
,
a
)
for
a
in
args
if
sep
.
search
(
a
))
sep
.
sub
(
re
.
escape
(
os
.
path
.
sep
),
a
)
for
a
in
args
if
sep
.
search
(
a
))
f
.
write
(
'[buildout]
\
n
'
'parts = py
\
n
'
'
\
n
'
...
...
src/zc/buildout/buildout.txt
View file @
3d3b61b2
...
...
@@ -2575,10 +2575,8 @@ or paths to use:
>>> cd(sample_bootstrapped)
>>> remove('setup.cfg')
>>> remove('bin', 'buildout')
>>> print_(system(buildout + ' -csetup.cfg init demo other ./src'), end='')
Creating '/sample-bootstrapped/setup.cfg'.
Generated script '/sample-bootstrapped/bin/buildout'.
Getting distribution for 'zc.recipe.egg'.
Got zc.recipe.egg 1.3.3dev.
Installing py.
...
...
src/zc/buildout/download.py
View file @
3d3b61b2
...
...
@@ -181,22 +181,20 @@ class Download(object):
self
.
logger
.
info
(
'Downloading %s'
%
url
)
handle
,
tmp_path
=
tempfile
.
mkstemp
(
prefix
=
'buildout-'
)
os
.
close
(
handle
)
try
:
try
:
tmp_path
,
headers
=
urlretrieve
(
url
,
tmp_path
)
if
not
check_md5sum
(
tmp_path
,
md5sum
):
raise
ChecksumError
(
'MD5 checksum mismatch downloading %r'
%
url
)
except
IOError
:
e
=
sys
.
exc_info
()[
1
]
os
.
remove
(
tmp_path
)
raise
zc
.
buildout
.
UserError
(
"Error downloading extends for URL "
"%s: %s"
%
(
url
,
e
))
except
Exception
:
os
.
remove
(
tmp_path
)
raise
finally
:
os
.
close
(
handle
)
tmp_path
,
headers
=
urlretrieve
(
url
,
tmp_path
)
if
not
check_md5sum
(
tmp_path
,
md5sum
):
raise
ChecksumError
(
'MD5 checksum mismatch downloading %r'
%
url
)
except
IOError
:
e
=
sys
.
exc_info
()[
1
]
os
.
remove
(
tmp_path
)
raise
zc
.
buildout
.
UserError
(
"Error downloading extends for URL "
"%s: %s"
%
(
url
,
e
))
except
Exception
:
os
.
remove
(
tmp_path
)
raise
if
path
:
shutil
.
move
(
tmp_path
,
path
)
...
...
src/zc/buildout/easy_install.py
View file @
3d3b61b2
...
...
@@ -94,6 +94,8 @@ def _get_index(index_url, find_links, allow_hosts=('*',)):
if
index_url
is
None
:
index_url
=
default_index_url
if
index_url
.
startswith
(
'file://'
):
index_url
=
index_url
[
7
:]
index
=
AllowHostsPackageIndex
(
index_url
,
hosts
=
allow_hosts
)
if
find_links
:
...
...
@@ -433,6 +435,7 @@ class Installer:
# Retrieve the dist:
if
avail
is
None
:
self
.
_index
.
obtain
(
requirement
)
raise
MissingDistribution
(
requirement
,
ws
)
# We may overwrite distributions, so clear importer
...
...
@@ -1049,7 +1052,10 @@ def _create_script(contents, dest):
if
changed
:
open
(
dest
,
'w'
).
write
(
contents
)
logger
.
info
(
"Generated script %r."
,
script
)
logger
.
info
(
"Generated script %r."
,
# Normalize for windows
script
.
endswith
(
'-script.py'
)
and
script
[:
-
10
]
or
script
)
try
:
os
.
chmod
(
dest
,
493
)
# 0755
...
...
src/zc/buildout/testing.py
View file @
3d3b61b2
...
...
@@ -503,3 +503,9 @@ normalize_exception_type_for_python_2_and_3 = (
re.compile(r'
^
(
\
w
+
\
.)
*
([
A
-
Z
][
A
-
Za
-
z0
-
9
]
+
Error
:
)
'),
'
\
2
')
not_found = (re.compile(r'
^
Not
found
:
[
^
\
n
]
+/
\
w
+/
\
r
?
\
n
', re.M), '')
ignore_not_upgrading = (
re.compile(
'
Not
upgrading
because
not
running
a
local
buildout
command
.
\
n
'
), '')
src/zc/buildout/tests.py
View file @
3d3b61b2
...
...
@@ -2912,6 +2912,7 @@ def test_suite():
zc
.
buildout
.
testing
.
normalize_endings
,
zc
.
buildout
.
testing
.
normalize_script
,
zc
.
buildout
.
testing
.
normalize_egg_py
,
zc
.
buildout
.
testing
.
not_found
,
(
re
.
compile
(
'__buildout_signature__ = recipes-
\
S+
'
),
'
__buildout_signature__
=
recipes
-
SSSSSSSSSSS
'),
(re.compile('
executable
=
[
\
S
]
+
python
\
S
*
', re.I),
...
...
@@ -2945,6 +2946,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
(re.compile('
__buildout_signature__
=
recipes
-
\
S
+
'),
'
__buildout_signature__
=
recipes
-
SSSSSSSSSSS
'),
(re.compile('
[
-
d
]
distribute
-
\
S
+
[.]
egg
'), '
distribute
.
egg
'),
...
...
@@ -2974,6 +2976,7 @@ def test_suite():
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found,
(re.compile('
zc
.
buildout
.
buildout
.
MissingOption
'),
'
MissingOption
'),
(re.compile(r'
\
S
+
buildout
.
py
'), '
buildout
.
py
'),
...
...
@@ -2994,6 +2997,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
normalize_bang,
normalize_S,
(re.compile('
99
[.]
99
'), '
NINETYNINE
.
NINETYNINE
'),
...
...
@@ -3010,20 +3014,25 @@ def test_suite():
setUp=easy_install_SetUp,
tearDown=zc.buildout.testing.buildoutTearDown,
checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found,
normalize_bang,
normalize_S,
(re.compile('
[
-
d
]
distribute
-
\
S
+
[.]
egg
'), '
distribute
.
egg
'),
(re.compile(r'
\\
[
\\
]
?
'), '
/
'),
(re.compile('
(
\
n
?
)
-
([
a
-
zA
-
Z_
.
-
]
+
)
\
n
-
\\
2.
exe
\
n
'),
'
\\
1
-
\\
2
\
n
'),
]+(sys.version_info < (2, 5) and [
(re.compile('
.
*
No
module
named
runpy
.
*
', re.S), ''),
(re.compile('
.
*
usage
:
pdb
.
py
scriptfile
.
*
', re.S), ''),
(re.compile('
.
*
Error
:
what
does
not
exist
.
*
', re.S), ''),
] or [])),
),
doctest.DocFileSuite(
...
...
@@ -3032,13 +3041,15 @@ def test_suite():
tearDown=zc.buildout.testing.buildoutTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS,
checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
(re.compile('
at
-
?
0
x
[
^>
]
+
'), '
<
MEM
ADDRESS
>
'),
(re.compile('
http
:
//
localhost
:[
0
-
9
]{
4
,
5
}
/
'),
'
http
:
//
localhost
/
'),
(re.compile('
[
0
-
9
a
-
f
]{
32
}
'), '
<
MD5
CHECKSUM
>
'),
zc.buildout.testing.normalize_path,
]),
zc.buildout.testing.normalize_exception_type_for_python_2_and_3,
zc.buildout.testing.not_found,
(re.compile('
at
-
?
0
x
[
^>
]
+
'), '
<
MEM
ADDRESS
>
'),
(re.compile('
http
:
//
localhost
:[
0
-
9
]{
4
,
5
}
/
'),
'
http
:
//
localhost
/
'),
(re.compile('
[
0
-
9
a
-
f
]{
32
}
'), '
<
MD5
CHECKSUM
>
'),
zc.buildout.testing.normalize_path,
zc.buildout.testing.ignore_not_upgrading,
]),
),
doctest.DocTestSuite(
...
...
@@ -3050,6 +3061,7 @@ def test_suite():
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.normalize___pycache__,
zc.buildout.testing.not_found,
(re.compile(r'
^
(
\
w
+
\
.)
*
(
Missing
\
w
+
:
)
'), '
\
2
'),
(re.compile("buildout: Running
\
S*se
t
up.py"),
'
buildout
:
Running
setup
.
py
'),
...
...
@@ -3086,6 +3098,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_egg_py,
zc.buildout.testing.not_found,
(re.compile('__buildout_signature__ = recipes-
\
S+
'
),
'__buildout_signature__ = recipes-SSSSSSSSSSS'),
(re.compile('[-d] distribute-
\
S+[.]egg
'
), 'distribute.egg'),
...
...
@@ -3120,6 +3133,7 @@ def test_suite():
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.not_found,
normalize_bang,
(re.compile('Downloading.*distribute.*egg
\
n
'), ''),
]),
...
...
zc.recipe.egg_/src/zc/recipe/egg/tests.py
View file @
3d3b61b2
...
...
@@ -48,6 +48,7 @@ def test_suite():
zc
.
buildout
.
testing
.
normalize_egg_py
,
zc
.
buildout
.
tests
.
normalize_bang
,
zc
.
buildout
.
tests
.
normalize_S
,
zc
.
buildout
.
testing
.
not_found
,
(
re
.
compile
(
'[d-] zc.buildout(-
\
S+)?[.]egg(-li
n
k)?'
),
'zc.buildout.egg'
),
(
re
.
compile
(
'[d-] distribute-[^-]+-'
),
'distribute-X-'
),
...
...
@@ -61,6 +62,7 @@ def test_suite():
checker
=
renormalizing
.
RENormalizing
([
zc
.
buildout
.
testing
.
normalize_path
,
zc
.
buildout
.
testing
.
normalize_endings
,
zc
.
buildout
.
testing
.
not_found
,
(
re
.
compile
(
'__buildout_signature__ = '
'sample-
\
S+
\
s+'
'zc.recipe.egg-
\
S+
\
s+'
...
...
@@ -80,6 +82,7 @@ def test_suite():
checker=renormalizing.RENormalizing([
zc.buildout.testing.normalize_path,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.not_found,
(re.compile("(d ((ext)?demo(needed)?|other)"
"-
\
d[.]
\
d-py)
\
d[.]
\
d(-
\
S+)?[.]egg
"
),
'
\\
1
V
.
V
.
egg
'),
...
...
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