I believe the Py3k port of Babel is now complete and operational, at
least as far as the testsuite is concerned.
All doctests, which have been disabled for py3, are replaced with
appropriate unittest cases, and all pass.
On Py2.x both the doctests and the replacement unittests run, which is
redundant testing, but doesn't hurt. It also provides a sanity check
for py3 to ensure the replacement unittests do not regress against the
original doctests.
I have tested on py2.6, py2.7 and py3.2 and babel builds from the same
tree on all of these.
In the process of the port I enhanced pofile reading and the changes i
made close: http://babel.edgewall.org/ticket/255 for both py3.x and 2.x
the ported source is available here:
https://bitbucket.org/felixschwarz/babel-py3k/overview
to build it you need to follow the instructions at:
http://babel.edgewall.org/wiki/SubversionCheckout with regard to
Importing the Locale Data
Importing the cldr data requires running the import_cldr script under
py2.x at the moment, it will not run under py3.x
Also building the docs requires py2.x as some of the prerequisites are
not available for py3.x yet. (namely epydoc and genshi)
Neither of these tasks are normally required by an end user, so I don't
think either of them should be considered an impediment to a Babel Py3.x
supporting release.
Also note that Py3.1 should work, but has not been tested and I do not
think Py3.0 will work as it is missing features I needed for the port.
Strontium
this is terrific! Currently out of time to review your stuff but I just
wanted to say "Thank You" again.
With the string duality (filename vs. content) I have to think a bit
more about because it doesn't really appeal to me (seems very unpythonic
at the moment) but I have to think about that (and it's also not just
about me!).
fs
On 04/18/2011 03:08 AM, Felix Schwarz wrote:
> Hi Steven,
>
> this is terrific! Currently out of time to review your stuff but I just
> wanted to say "Thank You" again.
No problem. I have played with it on my project, and in the limited
real world testing i've done I have not hit any problems.
> With the string duality (filename vs. content) I have to think a bit
> more about because it doesn't really appeal to me (seems very unpythonic
> at the moment) but I have to think about that (and it's also not just
> about me!).
I'm not concerned about it either way, it was easy enough to do, and is
easy enough to stop doing. I did it because it was mentioned by someone
that polib did it and I tried to make the po interface similar to that
provided by polib. So that, in future if desired, it could optionally
link with polib, instead of using the babel po stuff and the interface
not change. I think it would be reasonably trivial to write a
try import polib
"po lib veneeer"
except
"babel functions"
type of thing in pofile.py and mofile.py, which would give wichert
exactly what he was after, without introducing a hard dependency on
people who didn't want or need it. The only reason I didn't implement
it was because polib currently doesn't work in py3k and my focus was
getting py3k happening for babel, not supporting polib with a py3k port.
If wichert was interested in looking at the improved po file handling
stuff to verify if this is right, that would be good, as I am not a
polib expert and only spent about 20 minutes looking through its code to
come up with an improved interface for bable i think would be easy to
coerce into polib calls.
Steven
Is the Py3 compatible version of Babel available for download under
easy_install yet? I am porting over some dependencies of the Pyramid
web framework, and I am still getting syntax errors under Py3.2.
(bab)vinay@eta-natty:~/projects/scratch$ easy_install https://bitbucket.org/vinay.sajip/babel3/get/tip.tar.gz
Downloading https://bitbucket.org/vinay.sajip/babel3/get/tip.tar.gz
Processing tip.tar.gz
Running repos15-r-265281-5e1b0fd060cc/setup.py -q bdist_egg --dist-dir /tmp/easy_install-ifs0om/repos15-r-265281-5e1b0fd060cc/egg-dist-tmp-ixrqmh
warning: no files found matching 'babel/global.dat'
warning: no files found matching 'babel/localedata/*.dat'
warning: no files found matching 'doc/api/*.*'
warning: no files found matching 'doc/*.html'
Adding Babel 1.0dev to easy-install.pth file
Installing pybabel script to /home/vinay/.virtualenvs/bab/bin
Installed /home/vinay/.virtualenvs/bab/lib/python3.2/site-packages/Babel-1.0dev-py3.2.egg
Processing dependencies for Babel==1.0dev
Regards,
Vinay Sajip
Finished processing dependencies for Babel==1.0dev