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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
9a2c05ac
Commit
9a2c05ac
authored
Jun 19, 2009
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an upload entry point for extensions.
Also fixed some spurious failures in the bootstrap test.
parent
522d9598
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
58 deletions
+74
-58
CHANGES.txt
CHANGES.txt
+3
-1
src/zc/buildout/bootstrap.txt
src/zc/buildout/bootstrap.txt
+1
-6
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+57
-47
src/zc/buildout/buildout.txt
src/zc/buildout/buildout.txt
+12
-4
src/zc/buildout/tests.py
src/zc/buildout/tests.py
+1
-0
No files found.
CHANGES.txt
View file @
9a2c05ac
Change History
**************
1.2.2 (
unreleased
)
1.2.2 (
2009-06-19
)
==================
- Better Windows compatibility in test infrastructure.
...
...
@@ -16,6 +16,8 @@ Change History
- fixed usage of 'relative_paths' keyword parameter on Windows
- Added an unload entry point for extensions.
1.2.1 (2009-03-18)
==================
...
...
src/zc/buildout/bootstrap.txt
View file @
9a2c05ac
...
...
@@ -59,12 +59,7 @@ Let's try with an unknown version::
X
No local packages or download links found for zc.buildout==UNKNOWN
error: Could not find suitable distribution for Requirement.parse('zc.buildout==UNKNOWN')
Traceback (most recent call last):
File "bootstrap.py", line 78, in <module>
) == 0
AssertionError
<BLANKLINE>
X
...
Now let's try with `1.1.2`, which happens to exist::
...
...
src/zc/buildout/buildout.py
View file @
9a2c05ac
...
...
@@ -506,6 +506,8 @@ class Buildout(UserDict.DictMixin):
elif
(
not
installed_parts
)
and
installed_exists
:
os
.
remove
(
self
[
'buildout'
][
'installed'
])
self
.
_unload_extensions
()
def
_update_installed
(
self
,
**
buildout_options
):
installed
=
self
[
'buildout'
][
'installed'
]
f
=
open
(
installed
,
'a'
)
...
...
@@ -533,7 +535,6 @@ class Buildout(UserDict.DictMixin):
self
.
_uninstall
(
installed_part_options
[
part
][
'__buildout_installed__'
])
def
_setup_directories
(
self
):
__doing__
=
'Setting up buildout directories'
...
...
@@ -564,7 +565,8 @@ class Buildout(UserDict.DictMixin):
setup
=
self
.
_buildout_path
(
setup
)
files
=
glob
.
glob
(
setup
)
if
not
files
:
self
.
_logger
.
warn
(
"Couldn't develop %r (not found)"
,
setup
)
self
.
_logger
.
warn
(
"Couldn't develop %r (not found)"
,
setup
)
else
:
files
.
sort
()
for
setup
in
files
:
...
...
@@ -831,6 +833,14 @@ class Buildout(UserDict.DictMixin):
for
ep
in
pkg_resources
.
iter_entry_points
(
'zc.buildout.extension'
):
ep
.
load
()(
self
)
def
_unload_extensions
(
self
):
__doing__
=
'Unloading extensions.'
specs
=
self
[
'buildout'
].
get
(
'extensions'
,
''
).
split
()
if
specs
:
for
ep
in
pkg_resources
.
iter_entry_points
(
'zc.buildout.unloadextension'
):
ep
.
load
()(
self
)
def
setup
(
self
,
args
):
if
not
args
:
raise
zc
.
buildout
.
UserError
(
...
...
src/zc/buildout/buildout.txt
View file @
9a2c05ac
...
...
@@ -2368,15 +2368,17 @@ parts:
Extensions
----------
A
n **experimental**
feature allows code to be loaded and run after
A feature allows code to be loaded and run after
configuration files have been read but before the buildout has begun
any processing. The intent is to allow special plugins such as
urllib2 request handlers to be loaded.
To load an extension, we use the extensions option and list one or
more distribution requirements, on separate lines. The distributions
named will be loaded and any zc.buildout.extensions entry points found
will be called with the buildout as an argument.
named will be loaded and any ``zc.buildout.extension`` entry points found
will be called with the buildout as an argument. When buildout
finishes processing, any ``zc.buildout.unloadextension`` entry points
found will be called with the buildout as an argument.
Let's create a sample extension in our sample buildout created in the
previous section:
...
...
@@ -2387,6 +2389,8 @@ previous section:
... """
... def ext(buildout):
... print 'ext', list(buildout)
... def unload(buildout):
... print 'unload', list(buildout)
... """)
>>> write(sample_bootstrapped, 'demo', 'setup.py',
...
...
@@ -2395,7 +2399,10 @@ previous section:
...
... setup(
... name = "demo",
... entry_points = {'zc.buildout.extension': ['ext = demo:ext']},
... entry_points = {
... 'zc.buildout.extension': ['ext = demo:ext'],
... 'zc.buildout.unloadextension': ['ext = demo:unload'],
... },
... )
... """)
...
...
@@ -2436,6 +2443,7 @@ We see that our extension is loaded and executed:
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
ext ['buildout']
Develop: '/sample-bootstrapped/demo'
unload ['buildout']
Allow hosts
-----------
...
...
src/zc/buildout/tests.py
View file @
9a2c05ac
...
...
@@ -2895,6 +2895,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
normalize_bang,
(re.compile('Downloading.*setuptools.*egg
\
n
'), ''),
]),
))
...
...
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