I have a quite monolithic Plone project which I'm currently breaking down to separate packages:
- general tools, e.g.
visaplan.tools
- Plone-related tools, e.g.
visaplan.plone.tools
- basic customisations for all of my instances
- customer-specific customizations
In this effort, I started to create packages in my visaplan
namespace and happily change the import
statements.
Now I have a show-stopping problem: I can't import from my new packages, and it looks like a problem with namespace packages:
...
File ".../project-root/Products/myproduct/browser/mogrify/browser.py", line 22, in <module>
from visaplan.tools.lands0 import (makeListOfStrings,
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File ".../project-root/parts/instance/etc/site.zcml", line 16.2-16.23
ZopeXMLConfigurationError: File ".../project-root/Products/myproduct/configure.zcml", line 13.4-13.34
ZopeXMLConfigurationError: File ".../project-root/Products/myproduct/browser/configure.zcml", line 85.4-85.34
ZopeXMLConfigurationError: File ".../project-root/Products/myproduct/browser/mogrify/configure.zcml", line 12.4-18.10
ImportError: No module named tools.lands0
Line 22 of that module imports 3 functions from the visaplan.tools.lands0 module which is part of the visaplan.tools package.
That package is installed (as an develoment egg), as proved by grep visaplan.tools bin/instance
.
It contains the module lands0
.
That module contains all of the 3 functions I try to import.
Ok, I thought; must be a "namespace packages" problem.
I have two visaplan.*
packages already which are used in production (still as "development packages", because they are quite special); both of them declare visaplan
to be a namespace package, and work just fine.
I have three new packages which didn't have it right from the beginning (too many namespace packages, but visaplan
has always been one of them).
And I found that buildout issue 410, https://github.com/buildout/buildout/issues/410, so I tried to recreate my virtualenv
, omitting pip
, and install zc.buildout
with bin/easy_install
. I tried several versions of zc.buildout
, setuptools
and even zc.recipe.egg
, but after rebuilding I always got the same error.
So far all packages are used as development packages, but I have created public releases for two of them (visaplan.tools and visaplan.plone.tools), so I'll try this next.
What else can I do?
- Is there some namespace packages information stored somewhere I'd need to erase?
- Do I need all packages anew, to have them created by an easyinstall-created buildout?
- Other ideas?
Thank you for your time and expertise!