As someone working to get sage into a distro I want to be able
to get installation of sage with python 2.7 and 3.x side by side
on the same system. The same I can with other software supporting
multiple versions of python.
What do I need for that:
pynac install a suffixed library indicating the python version
so I can have libraries for different versions of python.
A good model is python itself:
ll /usr/lib64/libpython*.so
lrwxrwxrwx 1 root root 19 Oct 18 09:05 /usr/lib64/libpython2.7.so -> 
libpython2.7.so.1.0
lrwxrwxrwx 1 root root 19 Oct 18 09:07 /usr/lib64/libpython3.2.so -> 
libpython3.2.so.1.0
lrwxrwxrwx 1 root root 19 Jan 19 21:51 /usr/lib64/libpython3.3.so -> 
libpython3.3.so.1.0

I have the same request for sage_clib.
The alternative is to install those libraries in the lib-dynload
folder of the respective python used. 
Finally get sage to figure correctly which of these to use.

Francois

On Tue, 18 Mar 2014 09:12:14 Wilfried Lübbe wrote:
> Looking at the "Metaticket: Add support for python 3.3+" (
> http://trac.sagemath.org/ticket/15530) most prereqs on the spkg side are
> resolved.
> So we might look at Sage itself!
> 
> I'd like to start with some questions that should be answered before
> engaging ...
> 
> Q1: Do we want / need to support both Python 3 (Python 3.3+) and Python 2
> (Python 2.7)?
> 
>    - In "The Annual Sage on Python 3 Thread" both Wiliam Stein (
>    https://groups.google.com/d/msg/sage-devel/cr7795sFjCQ/37ObHQ9P-YsJ) and
>    Andrew Ohana (
>    https://groups.google.com/d/msg/sage-devel/cr7795sFjCQ/Z2pde7rbORkJ)
>    seem to favor this as the target.
>    - Even the Python HowTo "Porting Python 2 Code to Python 3" now starts
>    with the sentence "With Python 3 being the future of Python while Python
>    2 is still in active use, it is good to have your project available for
>    both major releases of Python. This guide is meant to help you figure out
> how best to support both Python 2 & 3 simultaneously.".
>    - ==> See lets assume this as a working hypothesis!
> 
> Q2: How can we achieve this goal?
> 
>    - The classic/official Python view was like this: develop your code for
>    Python 2, then apply the "2to3" toolset to get Pytthon 3 compatible code.
> So you essentially have to maintain/test two branches. While this approach
> may be feasible with a stable/unchanging code, it has a number significant
> problems for a living project (which I will not detail here).
>    - In August last year Ondřej Čertík wrote a blog entry
>   
> http://ondrejcertik.blogspot.de/2013/08/how-to-support-both-python-2-and-3.
> html. He described how (and why) several projects (SymPy, NumPy, SciPy)
> abandoned the (ongoing) use of 2to3 and created a single / common Py2/3
> code base. - ==> Lets assume (for the moment) that Sage also wants a single
> Py2/3 code base.
> 
> Q3: How can we create a common Py2/3 Sage code base?
> 
>    - 2to3 only changes Python 2 code into Python 3 code. The changed code
>    does (usually) NOT work for Python 2.
>    - The projects mentioned by Ondřej use 2to3 in the process and then
>    employed some "compatibility library" to restore / maintain Python 2
>    compatibility. A well known such library is "six" by Benjamin Peterson (
>    https://pypi.python.org/pypi/six/1.6.1).
>    - A relatively new, but promising project (still in beta) is "future" by
>    Ed Schofield (https://pypi.python.org/pypi/future/0.11.3 and
>    http://python-future.org/). It tries to combine pieces of various tools
>    (lib2to3, lib3to2, six, python-modernize and others) into one unified
> tool set.
>    - ==> Perhaps the Sage wiki is the place to document the details of our
>    chosen approach.
> 
> Q4: As there other useful resources?
> 
>    - Lennart Regebro's site http://python3porting.com/ which a lot of free
>    content (and a pdf-book to buy for $12).
>    - The Python HowTo: http://docs.python.org/2.7/howto/pyporting.html
>    - The mailing list http://mail.python.org/mailman/listinfo/python-porting
> .
> 
> Thoughts, suggestions, ...
> 
> 
> Looking forward to a Python 3 enabled Sage ...
> Wilfried

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to