[Zope-dev] zope.publisher dependencies
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Feb 24 10:36:11 EST 2009
On Tuesday 24 February 2009, Shane Hathaway wrote:
> I've noticed that nearly all packages that depend on zope.publisher
> depend only on a few pieces of it:
>
> - zope.publisher.interfaces
Can you give examples?
> - zope.publisher.browser.Browser{View|Page}
>
> - zope.publisher.browser.TestRequest
Packages that depend on those classes usually more or less implicitly depend
on zope.publisher. So the split might be arbitrary for this example.
> One simple, low-risk refactoring I would like to do is move
> zope.publisher.interfaces into its own package, make zope.publisher a
> namespace package, and make zope.publisher depend on
> zope.publisher.interfaces. The __init__.py in zope.publisher is already
> empty, so I expect the namespace conversion to be safe. Then I'd like
> to refine the dependency list of various packages that only require
> zope.publisher.interfaces. Any objections?
I want to see some motivation, because I fail to see how this helps.
> It is less clear what we should do with BrowserView and BrowserPage.
> They depend on zope.location, unlike the rest of zope.publisher, so they
> don't really fit there. Perhaps those two belong in a new package,
> "zope.publisher.browserbase".
I do agree moving BrowserView and BrowserPage out of the publisher because
they introduce the zope.location dependency.
> There is also the tiny new "zope.browser"
> package. Would it make sense to move them there? (It's hard to tell
> what the intent of the new package is.) I'd love to hear other
> suggestions.
I think the purpose of the package is still defining itself. I think it will
be defined by the things that we move into it. I am very tempted to say that
it is a good home for BrowserView and BrowserPage.
> As for TestRequest, I could update the setup.py of various packages that
> currently depend on zope.publisher just for TestRequest. I would make
> zope.publisher a test-only requirement.
TestRequest does not add any additional dependencies to the system, so what's
the point? It will depend on zope.publisher.browser anyways.
Regards,
Stephan
--
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"
More information about the Zope-Dev
mailing list