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
Nicolas Wavrant
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
Change History
**************
**************
1.2.2 (
unreleased
)
1.2.2 (
2009-06-19
)
==================
==================
- Better Windows compatibility in test infrastructure.
- Better Windows compatibility in test infrastructure.
...
@@ -16,6 +16,8 @@ Change History
...
@@ -16,6 +16,8 @@ Change History
- fixed usage of 'relative_paths' keyword parameter on Windows
- fixed usage of 'relative_paths' keyword parameter on Windows
- Added an unload entry point for extensions.
1.2.1 (2009-03-18)
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::
...
@@ -59,12 +59,7 @@ Let's try with an unknown version::
X
X
No local packages or download links found for zc.buildout==UNKNOWN
No local packages or download links found for zc.buildout==UNKNOWN
error: Could not find suitable distribution for Requirement.parse('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::
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):
...
@@ -506,6 +506,8 @@ class Buildout(UserDict.DictMixin):
elif
(
not
installed_parts
)
and
installed_exists
:
elif
(
not
installed_parts
)
and
installed_exists
:
os
.
remove
(
self
[
'buildout'
][
'installed'
])
os
.
remove
(
self
[
'buildout'
][
'installed'
])
self
.
_unload_extensions
()
def
_update_installed
(
self
,
**
buildout_options
):
def
_update_installed
(
self
,
**
buildout_options
):
installed
=
self
[
'buildout'
][
'installed'
]
installed
=
self
[
'buildout'
][
'installed'
]
f
=
open
(
installed
,
'a'
)
f
=
open
(
installed
,
'a'
)
...
@@ -533,7 +535,6 @@ class Buildout(UserDict.DictMixin):
...
@@ -533,7 +535,6 @@ class Buildout(UserDict.DictMixin):
self
.
_uninstall
(
self
.
_uninstall
(
installed_part_options
[
part
][
'__buildout_installed__'
])
installed_part_options
[
part
][
'__buildout_installed__'
])
def
_setup_directories
(
self
):
def
_setup_directories
(
self
):
__doing__
=
'Setting up buildout directories'
__doing__
=
'Setting up buildout directories'
...
@@ -564,7 +565,8 @@ class Buildout(UserDict.DictMixin):
...
@@ -564,7 +565,8 @@ class Buildout(UserDict.DictMixin):
setup
=
self
.
_buildout_path
(
setup
)
setup
=
self
.
_buildout_path
(
setup
)
files
=
glob
.
glob
(
setup
)
files
=
glob
.
glob
(
setup
)
if
not
files
:
if
not
files
:
self
.
_logger
.
warn
(
"Couldn't develop %r (not found)"
,
setup
)
self
.
_logger
.
warn
(
"Couldn't develop %r (not found)"
,
setup
)
else
:
else
:
files
.
sort
()
files
.
sort
()
for
setup
in
files
:
for
setup
in
files
:
...
@@ -831,6 +833,14 @@ class Buildout(UserDict.DictMixin):
...
@@ -831,6 +833,14 @@ class Buildout(UserDict.DictMixin):
for
ep
in
pkg_resources
.
iter_entry_points
(
'zc.buildout.extension'
):
for
ep
in
pkg_resources
.
iter_entry_points
(
'zc.buildout.extension'
):
ep
.
load
()(
self
)
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
):
def
setup
(
self
,
args
):
if
not
args
:
if
not
args
:
raise
zc
.
buildout
.
UserError
(
raise
zc
.
buildout
.
UserError
(
...
...
src/zc/buildout/buildout.txt
View file @
9a2c05ac
...
@@ -2368,15 +2368,17 @@ parts:
...
@@ -2368,15 +2368,17 @@ parts:
Extensions
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
configuration files have been read but before the buildout has begun
any processing. The intent is to allow special plugins such as
any processing. The intent is to allow special plugins such as
urllib2 request handlers to be loaded.
urllib2 request handlers to be loaded.
To load an extension, we use the extensions option and list one or
To load an extension, we use the extensions option and list one or
more distribution requirements, on separate lines. The distributions
more distribution requirements, on separate lines. The distributions
named will be loaded and any zc.buildout.extensions entry points found
named will be loaded and any ``zc.buildout.extension`` entry points found
will be called with the buildout as an argument.
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
Let's create a sample extension in our sample buildout created in the
previous section:
previous section:
...
@@ -2387,6 +2389,8 @@ previous section:
...
@@ -2387,6 +2389,8 @@ previous section:
... """
... """
... def ext(buildout):
... def ext(buildout):
... print 'ext', list(buildout)
... print 'ext', list(buildout)
... def unload(buildout):
... print 'unload', list(buildout)
... """)
... """)
>>> write(sample_bootstrapped, 'demo', 'setup.py',
>>> write(sample_bootstrapped, 'demo', 'setup.py',
...
@@ -2395,7 +2399,10 @@ previous section:
...
@@ -2395,7 +2399,10 @@ previous section:
...
...
... setup(
... setup(
... name = "demo",
... 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:
...
@@ -2436,6 +2443,7 @@ We see that our extension is loaded and executed:
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
>>> print system(os.path.join(sample_bootstrapped, 'bin', 'buildout')),
ext ['buildout']
ext ['buildout']
Develop: '/sample-bootstrapped/demo'
Develop: '/sample-bootstrapped/demo'
unload ['buildout']
Allow hosts
Allow hosts
-----------
-----------
...
...
src/zc/buildout/tests.py
View file @
9a2c05ac
...
@@ -2895,6 +2895,7 @@ def test_suite():
...
@@ -2895,6 +2895,7 @@ def test_suite():
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_endings,
zc.buildout.testing.normalize_script,
zc.buildout.testing.normalize_script,
normalize_bang,
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