Commit 9a2c05ac authored by Jim Fulton's avatar Jim Fulton

Added an upload entry point for extensions.

Also fixed some spurious failures in the bootstrap test.
parent 522d9598
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)
================== ==================
......
...@@ -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::
......
This diff is collapsed.
...@@ -2368,15 +2368,17 @@ parts: ...@@ -2368,15 +2368,17 @@ parts:
Extensions Extensions
---------- ----------
An **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
----------- -----------
......
...@@ -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'), ''),
]), ]),
)) ))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment