Loading Configuration from the zope.app Egg

Author

JimFulton

Status

IsProposal

Problem

We wish to distribute the Python packages now contained in the zope.app package in separate eggs. The existing zope.app package could be factored in a number of ways. The actual factoring is outside the scope of this proposal.

Previously, our plan was to move move many of these packages out of zope.app. Based on experience over the past few months, especially the reaction to our initial moves, I now think that this would be too disruptive. The only alternatives to moving these packages are:

  1. Including everything now in zope.app in the zope.app egg.
  2. Making zope.app a namespace package so that the packages contained in it can be distributed individually.

The first option is unattractive because it would make the zope.app egg larger than it needs to be and would cause applications to include software that they may not use. On the other hand, it is simplest to implement and unneeded modules included in the zope.app egg need not be imported and loaded. I think that controlling whether the configuration for these extra packages get loaded will be tricky. Ideally, one would like to load a single configuration from an egg, but, the zope.app egg would have a number of optional configuration files corresponding to the separate optional packages within the egg. I feel that the extra complexity of managing the configuration issues will outweigh implemantation simplicity.

The second option has the problem that zope.app isn't currently a namespace package. In particular, it contains a configure.zcml file that is loaded by user-editable configuration files (for example, site.zcml). (There are other ZCML files in zope.app, but these are less problematic, since these are referenced by configure.zcml.) To make zope.app a namespace package, we need some way of loading configure.zcml from somewhere else without breaking existing configuration files.

Proposal

I think the cleanest approach is to make zope.app a namespace package. I want to avoid breaking existing configuration files so I'd like to propose a bit of a hack. If a ZCML include directive names the zope.app package and the (explicitly or implicitly) requested file can't be found, then we'll look in in the package zope.app.zcmlfiles instead. I don't like special casing zope.app, but I think that doing so is better than saddling ourselves with a long-range feature that we don't generally need or want. Hopefully, the special casing will be removed some time in the future.

Implementation Status

Implemented and merged to trunk, will be available for 3.4 release



( 97 subscribers )