|
[Rivet] python2 changeAndy Buckley andy.buckley at cern.chTue Jun 10 22:17:28 BST 2014
On 10/06/14 16:48, Frank Siegert wrote: > Just for the record, I have temporarily given up on adding Python3 > compatibility to YODA/Rivet. Parts of the necessary changes are > already on the python3 repos, but I noticed that quite a bit more work > is necessary in the cython source files... explicitly > encoding/decoding strings and bytes within Python and to/from C++. Aaargh. This is exactly the sort of thing that I fear sinking time into re. Python3 migration! > I have tried for a few days to get this working, and even though I now > understand a lot more cython than I used (and wanted) to, I still > haven't figured out an elegant solution, in particular not one that is > maintainable in parallel for Python 2 and 3. Ok, good to know. > For the time being, I'm resorting to building with (the non-default) > python2 even in Archlinux, which is relatively simple with a few sed > replacements in our build systems: > https://aur.archlinux.org/packages/yo/yoda/PKGBUILD > https://aur.archlinux.org/packages/ri/rivet/PKGBUILD > > Once python3 is becoming more widespread we can revisit the porting, > in particular once somebody more familiar with cython needs python3 > compatibility themselves ;-) Ha! Well, I'm happy to help with the Cython side if you'll do the Python3 stuff. Let's come back to it when Python3 starts to impinge on HEP as well as hardcore bleeding edge hobbyists of the Archlinux persuasion ;-) Thanks again, Andy > On 15 May 2014 11:45, David Grellscheid <david.grellscheid at durham.ac.uk> wrote: >> >>> Does anybody have experience with the __future__ compatibility layer? >> >> They change the behaviour of features, so that a python2 interpreter >> does the right thing with python3 code: >> >> As the first lines in the file write: >> >> from __future__ import print_function # works from 2.6 >> from __future__ import division # from 2.5 >> from __future__ import with_statement # from 2.5 >> from __future__ import # ... whatever else you need, see ... >> >> # https://docs.python.org/2/library/__future__.html >> >> David -- Dr Andy Buckley, Royal Society University Research Fellow Particle Physics Expt Group, University of Glasgow / PH Dept, CERN
More information about the Rivet mailing list |