Posts Tagged ‘egg’
Plone: SiteManager leftovers; not the good kind
Leftovers are typically useful when they’re in your fridge at home. They mean you don’t have to mess around making lunch for the next day for work, and can just grab them, and walk right out the door. Now, leftovers in the zope.component SiteManager aren’t so nice, especially when some Plone products fail to remove what they’ve registered. The consequences of this are that you’ve got references left which will break things when you uninstall/remove the physical eggs/files. These leftovers would be ones would be mutated food that comes to kill you after you’ve thrown it in the bin, assuming we follow the same analogy. But how to fix them? (more…)
Plone/Zope, Python and collective.autoreload / plone.reload
Here’s an interesting error message I got stumped with for a good set of hours. The issue started with me using collective.autoreload with Plone and it does the trick, mostly. With any such ‘operation’ and live reloading of code for Python, you’ve got to expect that not everything will go according to plan. Most things do, but one issue I found presented with this error message: (more…)
Plone: Python Eggs And Development
Welcome to the new year! It’s the start of another journey around the sun and the beginning of work for me. Whilst I’m the only one actually working around here today, I thought I’d take the chance and update with some useful info:
Troublesome Python eggs
Now, much to my amazement, when you’re creating/compiling/whatever Python eggs for Plone you need to actually specify the files you want included in the build. I suppose it’s fair enough, but thought it might have actually done it for me. No such luck!
The SOURCES.txt file in the egg-info folder needs to be updated accordingly. A command like find ‘pwd` -name "*.*" will do the trick and list out the files in the directory (assuming you start from the root of the egg). If there’s extra stuff in the folder, you’ll probably need to weed out the extraneous files (.pyc, git, svn, etc) before building the egg with:
david@computer: python2.4 setup.py build david@computer: python2.4 setup.py sdist bdist_egg
which gets our lovely setuptools to build (scramble?) the egg and place the source and egg into the dist folder. Providing the SOURCES.txt file was correct, then you’ll have the right files included. If you don’t, you’ll be in for trouble when you try and include the egg under ZCML etc because the files just don’t come along for the ride.
Serve with sides of bacon and toast, place into your favourite PyPi (cheese shop) and include with your buildout config.
Further reading
If you’re really bored, check out http://peak.telecommunity.com/DevCenter/setuptools for some good material on what Setuptools can do for you.