-
Notifications
You must be signed in to change notification settings - Fork 2
/
PKG-INFO
355 lines (266 loc) · 12.5 KB
/
PKG-INFO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
Metadata-Version: 1.0
Name: buildout.eggnestdev
Version: 0.3
Summary: buildout extension to auto load eggs
Home-page: http://pypi.python.org/pypi/buildout.eggnestdev
Author: Marko Mikulicic
Author-email: [email protected]
License: GPL
Description: buildout.eggnestdev
=================
The problem
-----------
It is very convenient to install functionality to a buildout with just
a couple of lines, but for those used to Zope 2, one might miss
the way of adding a piece of functionality by just dropping something
(i.e. a product) into a folder. This could be good for people who want to try
out things without worrying about editing a configuration file with
lots of directives in it.
When wanting to install a new egg using buildout you currently have to
edit the buildout configuration file(s) and add a couple of lines in
the right places. What if you could just drop a file in a folder instead?
Solution
--------
Make a buildout extension so that the only thing you need to do in order to install an egg
is to take a simple text file, and drop it in a certain directory. When you rerun buildout the
contents of that file is parsed, the specified egg is downloaded and added to the instance.
When ``buildout.eggnestdev`` is run it::
1. If ``eggnest-src-directory`` is not given the default directory ``src``
is scanned.
2. Adds the egg to the ``eggs`` and ``zcml`` option to a set of given buildout parts.
This steps are done on the fly when running buildout. So I can add/delete/rename
an egg and it will be picked up.
NOTE: The extension does not write to the buildout's configuration file.
buildout.eggnestdev options
-------------------------
eggnest-src-directory:
Specified to the directory that your egg install files should be placed.
Defaults to src. An idea could be
to have a dedicated directory called "eggnest".
eggnest-parts:
What part of your buildout config that the eggs should be added to. *required*
eggnest-verbose:
Set this to ``true`` to get more information.
Not really that much right now but a little bit more at least.
How to use it
-------------
To use ``buildout.eggnestdev`` you need to add the following to your buildout.cfg::
[buildout]
extensions =
buildout.eggnestdev
eggnest-parts =
instance
In ``eggnest-parts`` you need to specify what buildout part that the eggs should be added to.
By default the ``src`` directory is scanned for egg specification files.
eggs specification files for eggnest
------------------------------------
The egg install specification files should have this structure. This is the same as the normal buildout config format.::
[eggnest]
egg =
plone.introspector
zcml =
plone.introspector
``zcml`` can be multiple lines if additional slugs need to be specified.
If the egg is in the ``Products`` namespace the zcml is not needed in the specification file.::
[eggnest]
egg =
Products.DocFinderTab
buildout.eggnest was created by Martin Lundwall <[email protected]> after an
initial idea by Jorgen Modin <[email protected]>
buildout.eggnestdev was created by Marko Mikulicic <[email protected]> in order to support
quick addition of develop deps.
Change history
================
0.3 (unreleased)
----------------
- Support 'develop = ..' (mmikulicic)
0.2 (unreleased)
----------------
- Compatibility update for zc.buildout 1.4.0 (mlundwall)
0.1 (2008-11-22)
----------------
- Initial release (mlundwall)
Detailed Documentation
======================
Tests for buildout.eggnest buildout extension
-------------------------------------------------
Let's create a buildout configuration file::
>>> data = """
... [buildout]
... parts = zope2 instance1 instance2 instance3
... extensions =
... eggs =
... develop = %s
... eggnest-parts = instance1 instance2
... [instance1]
... recipe = plone.recipe.zope2instance
... zope2-location = ${zope2:location}
... user = admin:admin
... [instance2]
... recipe = plone.recipe.zope2instance
... zope2-location = ${zope2:location}
... user = admin:admin
... [instance3]
... recipe = plone.recipe.zope2instance
... zope2-location = ${zope2:location}
... user = admin:admin
... [zope2]
... recipe = plone.recipe.zope2install
... url = http://www.zope.org/Products/Zope/2.9.8/Zope-2.9.8-final.tgz
... """ % egg_dir
>>> rmdir(tempdir, 'buildout.test')
>>> cd(tempdir)
>>> sh('mkdir buildout.test')
mkdir buildout.test
<BLANKLINE>
>>> cd('buildout.test')
>>> touch('buildout.cfg', data=data)
>>> ls('.')
buildout.cfg
run the buildout first time so we get our zope instances::
>>> sh('svn export svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py')
svn export svn://svn.zope.org/repos/main/zc.buildout/trunk/bootstrap/bootstrap.py
A bootstrap.py
Export complete.
<BLANKLINE>
>>> sh('python2.4 bootstrap.py')
python2.4 bootstrap.py
...
Creating directory '/private/tmp/buildout.test/bin'.
Creating directory '/private/tmp/buildout.test/parts'.
Creating directory '/private/tmp/buildout.test/develop-eggs'.
Generated script '/private/tmp/buildout.test/bin/buildout'.
<BLANKLINE>
>>> sh('./bin/buildout')
./bin/buildout
...
Installing instance1.
...
Installing instance2.
...
Installing instance3.
...
<BLANKLINE>
<BLANKLINE>
Now let's create a test products specification file and add the buildout.eggnest as an extension::
>>> sh('mkdir src')
mkdir src
<BLANKLINE>
>>> product = """
... [eggnest]
... egg =
... plone.portlet.static
... zcml =
... plone.portlet.static
... """
>>> touch('src/product.txt', data=product)
>>> ls('src')
product.txt
>>> data = data.replace('extensions =', 'extensions = buildout.eggnest')
>>> touch('buildout.cfg', data=data)
Ok, so now that we have an egg, lets run the buildout in offline mode. We
should get a zcml slugs in parts/instance1/etc/package-includes and parts/instance2/etc/package-includes
but not in parts/instance3/etc/package-includes,
and a line with the path to our egg in the bin/instance1 and bin/instance2
but not in bin/instance3 files.
First we check that there is nothing of the previous mentioned things::
>>> ls('develop-eggs')
buildout.eggnest.egg-link
>>> ls('parts/instance1/etc/package-includes')
No directory named parts/instance1/etc/package-includes
>>> ls('parts/instance2/etc/package-includes')
No directory named parts/instance2/etc/package-includes
>>> ls('parts/instance3/etc/package-includes')
No directory named parts/instance3/etc/package-includes
>>> sh('grep plone.portlet.static bin/instance1')
grep plone.portlet.static bin/instance1
<BLANKLINE>
>>> sh('grep plone.portlet.static bin/instance2')
grep plone.portlet.static bin/instance2
<BLANKLINE>
>>> sh('grep plone.portlet.static bin/instance3')
grep plone.portlet.static bin/instance3
<BLANKLINE>
OK, now run the buildout in offline mode::
>>> sh('./bin/buildout')
./bin/buildout
...
Check that we have a correct created buildout.
Check that we have our zcml slugs in the package-includes::
>>> ls('parts', 'instance1', 'etc', 'package-includes')
001-plone.portlet.static-configure.zcml
>>> ls('parts', 'instance2', 'etc', 'package-includes')
001-plone.portlet.static-configure.zcml
>>> ls('parts', 'instance3', 'etc', 'package-includes')
No directory named parts/instance3/etc/package-includes
and in the end check that there is a line in bin/instance1 and bin/instance1
that includes our egg in the path::
>>> code = cat('bin', 'instance1', returndata=True)
>>> code.find('plone.portlet.static') == -1
False
>>> code = cat('bin', 'instance2', returndata=True)
>>> code.find('plone.portlet.static') == -1
False
>>> code = cat('bin', 'instance3', returndata=True)
>>> code.find('plone.portlet.static') == -1
True
Let's now try the ``eggnest-src-directory`` option. We create a new buildout.cfg file
with an empty ``eggnest-src-directory``::
>>> data = data.replace('eggs =', 'eggnest-src-directory = \neggs = ')
>>> touch('buildout.cfg', data=data)
>>> sh('./bin/buildout')
./bin/buildout
...
No zcml slug in the instance 1,2 or 3::
>>> ls('parts', 'instance1', 'etc', 'package-includes')
No directory named parts/instance1/etc/package-includes
>>> ls('parts', 'instance2', 'etc', 'package-includes')
No directory named parts/instance2/etc/package-includes
>>> ls('parts', 'instance3', 'etc', 'package-includes')
No directory named parts/instance3/etc/package-includes
Nor a line in bin/instance1, bin/instance2 or bin/instance3 with our egg path::
>>> code = cat('bin', 'instance1', returndata=True)
>>> code.find('plone.portlet.static') == -1
True
>>> code = cat('bin', 'instance2', returndata=True)
>>> code.find('plone.portlet.static') == -1
True
>>> code = cat('bin', 'instance3', returndata=True)
>>> code.find('plone.portlet.static') == -1
True
But if the ``eggnest-src-directory`` option is not empty::
>>> data = data.replace('eggnest-src-directory =', 'eggnest-src-directory = auto')
>>> touch('buildout.cfg', data=data)
>>> sh('rm src/product.txt')
rm src/product.txt
>>> sh('mkdir auto')
mkdir auto
>>> touch('auto/product.txt', data=product)
>>> ls('auto')
product.txt
>>> sh('./bin/buildout -o')
./bin/buildout -o
...
and we get a zcml slug only in the specified target::
>>> ls('parts', 'instance1', 'etc', 'package-includes')
001-plone.portlet.static-configure.zcml
>>> ls('parts', 'instance2', 'etc', 'package-includes')
001-plone.portlet.static-configure.zcml
>>> ls('parts', 'instance3', 'etc', 'package-includes')
No directory named parts/instance3/etc/package-includes
and only the specified target's control script is updated::
>>> code = cat('bin', 'instance1', returndata=True)
>>> code.find('plone.portlet.static') == -1
False
>>> code = cat('bin', 'instance2', returndata=True)
>>> code.find('plone.portlet.static') == -1
False
>>> code = cat('bin', 'instance3', returndata=True)
>>> code.find('plone.portlet.static') == -1
True
Keywords: buildout extension auto load
Platform: UNKNOWN
Classifier: Framework :: Buildout
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules