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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
6f4b5b2e
Commit
6f4b5b2e
authored
Feb 24, 2010
by
Gary Poster
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test for recent fix for buildout
parent
243bd1c4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
9 deletions
+101
-9
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+3
-2
src/zc/buildout/testing.py
src/zc/buildout/testing.py
+10
-7
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+88
-0
No files found.
src/zc/buildout/buildout.py
View file @
6f4b5b2e
...
...
@@ -392,7 +392,8 @@ class Buildout(UserDict.DictMixin):
ws
=
pkg_resources
.
WorkingSet
(
entries
)
ws
.
require
(
'zc.buildout'
)
partsdir
=
os
.
path
.
join
(
options
[
'parts-directory'
],
'buildout'
)
os
.
mkdir
(
partsdir
)
if
not
os
.
path
.
exists
(
partsdir
):
os
.
mkdir
(
partsdir
)
zc
.
buildout
.
easy_install
.
sitepackage_safe_scripts
(
options
[
'bin-directory'
],
ws
,
options
[
'executable'
],
partsdir
,
reqs
=
[
'zc.buildout'
])
...
...
@@ -565,7 +566,7 @@ class Buildout(UserDict.DictMixin):
if
installed_files
is
None
:
self
.
_logger
.
warning
(
"The %s install returned None. A path or "
"iterable o
s
paths should be returned."
,
"iterable o
f
paths should be returned."
,
part
)
installed_files
=
()
elif
isinstance
(
installed_files
,
str
):
...
...
src/zc/buildout/testing.py
View file @
6f4b5b2e
...
...
@@ -244,7 +244,7 @@ def set_installer_values(values):
for
name
,
value
in
values
.
items
():
getattr
(
zc
.
buildout
.
easy_install
,
name
)(
value
)
def
make_buildout
():
def
make_buildout
(
executable
=
None
):
"""Make a buildout that uses this version of zc.buildout."""
# Create a basic buildout.cfg to avoid a warning from buildout.
open
(
'buildout.cfg'
,
'w'
).
write
(
...
...
@@ -254,13 +254,16 @@ def make_buildout():
# a Buildout will force the Buildout's defaults on the installer).
installer_values
=
get_installer_values
()
# Use the buildout bootstrap command to create a buildout
config
=
[
(
'buildout'
,
'log-level'
,
'WARNING'
),
# trick bootstrap into putting the buildout develop egg
# in the eggs dir.
(
'buildout'
,
'develop-eggs-directory'
,
'eggs'
),
]
if
executable
is
not
None
:
config
.
append
((
'buildout'
,
'executable'
,
executable
))
zc
.
buildout
.
buildout
.
Buildout
(
'buildout.cfg'
,
[(
'buildout'
,
'log-level'
,
'WARNING'
),
# trick bootstrap into putting the buildout develop egg
# in the eggs dir.
(
'buildout'
,
'develop-eggs-directory'
,
'eggs'
),
],
'buildout.cfg'
,
config
,
user_defaults
=
False
,
).
bootstrap
([])
# Create the develop-eggs dir, which didn't get created the usual
...
...
src/zc/buildout/tests.py
View file @
6f4b5b2e
...
...
@@ -2254,6 +2254,94 @@ include-site-packages.
"""
def
bootstrap_makes_buildout_that_works_with_system_python
():
"""
In order to work smoothly with a system Python, bootstrapping creates
the buildout script with
zc.buildout.easy_install.sitepackage_safe_scripts. If it did not, a
variety of problems might happen. For instance, if another version of
buildout or setuptools is installed in the site-packages than is
desired, it may cause a problem.
A problem actually experienced in the field is when
a recipe wants a different version of a dependency that is installed in
site-packages. We will create a similar situation, and show that it is now
handled.
First let's write a dummy recipe.
>>> mkdir(sample_buildout, 'recipes')
>>> write(sample_buildout, 'recipes', 'dummy.py',
... '''
... import logging, os, zc.buildout
...
... class Dummy:
...
... def __init__(self, buildout, name, options):
... pass
...
... def install(self):
... return ()
...
... def update(self):
... pass
... ''')
>>> write(sample_buildout, 'recipes', 'setup.py',
... '''
... from setuptools import setup
...
... setup(
... name = "recipes",
... entry_points = {'zc.buildout': ['dummy = dummy:Dummy']},
... install_requires = 'demoneeded==1.2c1',
... )
... ''')
>>> write(sample_buildout, 'recipes', 'README.txt', " ")
Now we'll try to use it with a Python that has a different version of
demoneeded installed.
>>> py_path, site_packages_path = make_py()
>>> create_sample_sys_install(site_packages_path)
>>> rmdir('develop-eggs')
>>> from zc.buildout.testing import make_buildout
>>> make_buildout(executable=py_path)
>>> write(sample_buildout, 'buildout.cfg',
... '''
... [buildout]
... develop = recipes
... parts = dummy
... find-links = %(link_server)s
... executable = %(py_path)s
...
... [dummy]
... recipe = recipes:dummy
... ''' % globals())
Now we actually run the buildout. Before the change, we got the following
error:
Develop: '/sample-buildout/recipes'
While:
Installing.
Getting section dummy.
Initializing section dummy.
Installing recipe recipes.
Error: There is a version conflict.
We already have: demoneeded 1.1
but recipes 0.0.0 requires 'demoneeded==1.2c1'.
Now, it is handled smoothly.
>>> print system(buildout)
Develop: '/sample-buildout/recipes'
Getting distribution for 'demoneeded==1.2c1'.
Got demoneeded 1.2c1.
Installing dummy.
<BLANKLINE>
"""
if
sys
.
version_info
>
(
2
,
4
):
def
test_exit_codes
():
"""
...
...
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