[Zope3-dev] RFC: zopeproject

Philipp von Weitershausen philipp at weitershausen.de
Wed Jul 18 12:50:57 EDT 2007


On 18 Jul 2007, at 12:26 , Maciej Wisniowski wrote:
> Maybe it is too fast for these questions but these are ones I had  
> just after trying zopeproject:
>
> 1. What should I do after creating project?
> Where should I start writing my code? In one of folders created by  
> zopeproject or maybe I'm just supposed to create my own folders and  
> put them in pythonpath?

Heh, this is a *very* good question because I just realized that this  
is nowhere documented clearly. I just assumed it would be obvious.

zopeproject actually creates an almost-empty package where you're  
supposed to put the code for your web application. Let's say you  
invoked zopeproject like this::

   $ zopeproject MyZopeApp
   ...

Then inside the newly created 'MyZopeApp' directory,

   $ cd MyZopeApp

you'll find a 'myzopeapp' package:

   $ cd myzopeapp
   $ ls
   __init__.py    application.py configure.zcml

You can now add Python files to this package, register components in  
configure.zcml, etc.


I will add this to the zopeproject docs. I wonder:

* Would it help if the 'myzopeapp' package would not be in the top- 
level MyZopeApp directory, but in a 'src' directory below MyZopeApp?  
Would that make it clearer where to go?

* grokproject actually also creates a "hello world" browser page.  
That way there's some initial code there and people might know better  
where to go in and change stuff. Would that help? Or would that be  
too much unnecessary boilerplate?

> 2. Is this kind of setup (I mean using zopeproject) supposed to be  
> used to deploy applications in production environments?

It certainly can be used for deployment, though you'll probably want  
to make some changes to the configuration files before you deploy  
(rip out the administrator account, deactivate developer mode, etc.).  
Again, this is a good question that should be answered in the  
zopeproject docs.

> 3. Does this work with workingenv? While trying to install  
> zopeproject with active workingenv I get:
>
> #--------------------------------------------------------------------- 
> ----------------------------------
> (env1)pigletto at PCC2:~/workingenvs/env1$ zopeproject newone
> Enter user (Name of an initial administrator user): blablabla
> Enter passwd (Password for the initial administrator user): blablabla
> Enter eggs_dir (Location where zc.buildout will look for and place
> packages) ['/home/pigletto/buildout-eggs']:
> /home/pigletto/workingenvs/env1/buildout-eggs
> Creating directory ./newone
> Downloading zc.buildout...
> Invoking zc.buildout...
> Couldn't find index page for 'zope.app' (maybe misspelled?)
> No local packages or download links found for zope.app
> error: Could not find suitable distribution for Requirement.parse 
> ('zope.app') (--always-copy skips system and development eggs)

This is interesting. I can reproduce this.

We got rid of the zope.app egg ages ago, which means that when run  
within workingenv, buildout must be downloaded an ancient version of  
some package that still depends on it. That again means buildout is  
ignoring the find-links settings in buildout.cfg.

I've seen this behaviour once at the EuroPython sprint. I don't think  
the person in question was using workingenv, but the symptoms were  
the same. I thought it was an temporary anomaly ;), but it looks more  
like a bug in zc.buildout. Or workingenv is doing something funny to  
change easy_install's behaviour.


THanks for your input!



More information about the Zope3-dev mailing list