[Zope-dev] z3c.form missing *.mo files?

Brian Sutherland brian at vanguardistas.net
Tue Jul 12 13:11:36 EDT 2011


On Tue, Jul 12, 2011 at 07:26:59PM +0300, Marius Gedminas wrote:
> On Tue, Jul 12, 2011 at 07:19:07PM +0300, Marius Gedminas wrote:
> > And then what?  Surely just having python-gettext installed and a couple
> > of environment variables defined is not enough to magically produce .mo
> > files 

Yes, actually it does ;)

But the compiling happens during run-time when you start up the server.
Neither the sdist nor binary egg need to contain the .mo files.

I can't remember if it actually writes those files out to the
filesystem.

> -- I would also need to run some Python script somewhere,
> > presumably.  Is it z3c.form's bin/pocompile?
> 
> So I tried
> 
>   cd ~/src/z3c.form
>   bin/pocompile
>   python setup.py sdist
> 
> and found that my dist/z3c.form-2.4.5dev.tar.gz now contains a .mo next
> to each .po in src/z3c/form/locales/.
> 
> So, should I release z3c.form 2.4.5 with the .mo's?
> 
> I would also like to add a RELEASING.txt with something like this
> 
>     If you're making a public z3c.form release to the Python Package
>     Index, don't forget to generate .mo files with::
> 
>       bin/pocompile
> 
>     before you do the usual ``python setup.py sdist register upload``
>     step.
> 
> Ideally, I'd like ``python setup.py sdist`` itself to check for up-to-date
> .mo's and either regenerate them automatically, or at least complain
> loudly.

I normally use a setuptools plugin I wrote for this:

    http://pypi.python.org/pypi/van.potomo

The chicken and egg issue means it's probably worse than what you wrote.

/me hoping that distutils2 will take care of these things.

-- 
Brian Sutherland


More information about the Zope-Dev mailing list