[Zope-dev] Re: Mixing recipes (zc.recipe.cmmi reuse)
Sidnei da Silva wrote: My intent is: "Given any recipe, no matter where data is coming from (be it an egg in PyPI, a Subversion checkout or a tarball), I would like to be able to perform an operation in the 'local copy' of the data, without depending on the person that wrote the recipe to have allowed me to do so" An example being, after a recipe that does a Subversion checkout runs, my custom operation kicks in and applies a patch to the local copy before the buildout processing continues. I believe that this might be doable today by writing custom configuration, but maybe it's such a common case that could be simplified. Maybe something along the lines of (note: this is all pseudo-config): """ [Step1] recipe = some.recipe.checkout url = svn://url-to-repo/package [Step2] recipe = zc.recipe.cmmi source = {Step1:location} Do ${Step1:location} patch = /path/to/my/patch [zope2] products = {Step2:location} """ I believe that something like this might already work today, It does. Again, this is "just Python". You have a dict-like variable 'buildout' passed to your recipe's __init__(). This has keys for each section, which contains a dict with keys for each option. So above, you could address buildout['Step1']['url'], say. You can also put things into this dict-of-dicts. Once a recipe has been run, subsequent recipes will be able to see things put into the dict. if not it might be easy to make it work that way. But what I'm after is to avoid Step2 above by listing the patch to be applied in Step1 even if 'some.recipe.checkout' does not support the 'patch' option directly. How would you avoid naming conflicts? How would you declare where that option comes from? I really don't think the overhead of having to specify a new recipe (as in your Step2 above) is very much, and it's a lot more explicit. All in all, if you tell me that the hypotetical Step2 above really can't be avoided and that the best option is to make 'some.recipe.checkout' and any other recipes out support the 'patch' option directly, I would be fine with that too. I'd suggest that's the best way. Only a limited number of recipes would really need 'path' - those could re-use your patch recipe via composition if necessary, but you have a fallback of using the recipe on its own. Martin -- Acquisition is a jealous mistress ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Mixing recipes (zc.recipe.cmmi reuse)
On 9/24/07, Jim Fulton <[EMAIL PROTECTED]> wrote: > > Or would it require the recipe > > writer to explicitly 'subclass' (?) cmmi to get patch functionality? > > I prefer composition. A number of recipes reuse the egg recipe > through composition. > > Generally, an egg will need to explicitly provide a Python API for > other eggs. See, for example, http://pypi.python.org/pypi/ > zc.recipe.egg/1.0.0b6#egg-recipe-api-for-other-recipes Gotcha, that makes sense. > > Or even, would a 'post-fetch'/'pre-build' generalization be desired, > > 'patch' being one such application? > > I have no idea what that is. :) My intent is: "Given any recipe, no matter where data is coming from (be it an egg in PyPI, a Subversion checkout or a tarball), I would like to be able to perform an operation in the 'local copy' of the data, without depending on the person that wrote the recipe to have allowed me to do so" An example being, after a recipe that does a Subversion checkout runs, my custom operation kicks in and applies a patch to the local copy before the buildout processing continues. I believe that this might be doable today by writing custom configuration, but maybe it's such a common case that could be simplified. Maybe something along the lines of (note: this is all pseudo-config): """ [Step1] recipe = some.recipe.checkout url = svn://url-to-repo/package [Step2] recipe = zc.recipe.cmmi source = {Step1:location} patch = /path/to/my/patch [zope2] products = {Step2:location} """ I believe that something like this might already work today, if not it might be easy to make it work that way. But what I'm after is to avoid Step2 above by listing the patch to be applied in Step1 even if 'some.recipe.checkout' does not support the 'patch' option directly. All in all, if you tell me that the hypotetical Step2 above really can't be avoided and that the best option is to make 'some.recipe.checkout' and any other recipes out support the 'patch' option directly, I would be fine with that too. Does it make more sense now? -- Sidnei da Silva Enfold Systemshttp://enfoldsystems.com Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214 ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Re: Mixing recipes (zc.recipe.cmmi reuse)
On Sep 18, 2007, at 6:25 PM, Sidnei da Silva wrote: Hi there, Not sure this is the right list, but let's give it a try. I would like to use the 'patches' functionality from zc.recipe.cmmi together with other recipes. I believe this is useful functionality and is interesting to all sorts of recipes, not only to cmmi-based ones. So the question is, does the zc.buildout architecture support reusing options from a recipe on other recipes? It is just Python. Buildout doesn't provide any support fro this because it isn't really needed. Or would it require the recipe writer to explicitly 'subclass' (?) cmmi to get patch functionality? I prefer composition. A number of recipes reuse the egg recipe through composition. Generally, an egg will need to explicitly provide a Python API for other eggs. See, for example, http://pypi.python.org/pypi/ zc.recipe.egg/1.0.0b6#egg-recipe-api-for-other-recipes Or even, would a 'post-fetch'/'pre-build' generalization be desired, 'patch' being one such application? I have no idea what that is. :) Jim -- Jim Fulton Zope Corporation ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Re: How to publish Zope2 products on PyPI
Philipp von Weitershausen wrote at 2007-9-23 19:24 +0200: >On 23 Sep 2007, at 19:05 , Dieter Maurer wrote: >> Philipp von Weitershausen wrote at 2007-9-22 19:27 +0200: >>> ... >>> Dieter Maurer wrote: >>> ... >>> * PyPI doesn't necessarily have to contain eggs. It's primarily a >>> discovery mechanism for humans. The fact that setuptools can download >>> packages from it is not as important as the fact that developers can >>> find packages there. >> >> The reason why I had to promiss to make my products available via PyPI >> was that they can be downloaded from there. > >Right. So then I don't understand why need all that extra machinery >in Zope and an extra namespace. Others already have pointed out, that the namespace already exists in "PyPI": "Products". It was not obvious ;-) I am fine with this. "all that extra machinery" means a declaration "additional-product[s]" -- something I have learned meanwhile exists already in Five as "registerProduct". I explain below why I think "Five" is not the proper place. > >> Thus, the functionality is there -- just maybe in the wrong place. > >If Five's registerPackage functionality is what you had been >proposing all along, then I have been misunderstanding you terribly. >Either way, you don't elaborate on why you think that this is the >"wrong" place for it. I personally consider registerPackage a >solutino for integrating new software (Zope 3-style software in >Python packages) into a legacy discovery mechanism (the automatic >Products.* loading). I have already sketched my reason why I deem "Five" the wrong place to a "registerProduct". I repeat it again: * Five is the vehicle to make Zope 3 concepts available in Zope 2. A product is a Zope 2 concept. Zope 3 does not have it. Thus why, what has Five to do with Zope 2 products? * "zope.conf" has already a declaration that controls which products are used by an instance "products". When we need another one (I do feel this need), I would have put it there, in "zope.conf", where already the other declaration lives -- and not in "Five". Having one declaration in "zope.conf" and one in "Five" looks like bad design for me... -- Dieter ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )
[Zope-dev] Zope Tests: 5 OK
Summary of messages to the zope-tests list. Period Sun Sep 23 12:00:00 2007 UTC to Mon Sep 24 12:00:00 2007 UTC. There were 5 messages: 5 from Zope Unit Tests. Tests passed OK --- Subject: OK : Zope-2.7 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:51:35 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008386.html Subject: OK : Zope-2.8 Python-2.3.6 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:53:05 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008387.html Subject: OK : Zope-2.9 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:54:35 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008388.html Subject: OK : Zope-2.10 Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:56:05 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008389.html Subject: OK : Zope-trunk Python-2.4.4 : Linux From: Zope Unit Tests Date: Sun Sep 23 20:57:36 EDT 2007 URL: http://mail.zope.org/pipermail/zope-tests/2007-September/008390.html ___ Zope-Dev maillist - Zope-Dev@zope.org http://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope )