Re: [sage-devel] Sage Python 3 proposal

2017-06-06 Thread William Stein
On Tue, Jun 6, 2017 at 1:00 PM, Daniel Krenn  wrote:
> On 2017-06-01 16:35, William Stein wrote:
>> The second oldest is "notebook -- should be able export (=print) to
>> latex/pdf/dvi", which could be finally closed when Jupyter notebook is
>> the default notebook
>
> Does typeset output meanwhile work? (I ask as, having e.g. show(x^2) in
> a Jupyter notebook, then File --> Download as --> PDF via LaTeX does not
> typeset the output, but unfortunately uses the plain text output; tested
> with 8.0.beta8)

You're right - it doesn't work. We've been tracking this problem here:
https://github.com/sagemathinc/cocalc/issues/2030

For what it is worth sagews ("sage worksheets" in CoCalc) do work very
well for export to html and pdf...

>
> --
> 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 sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-06 Thread Daniel Krenn
On 2017-06-01 16:35, William Stein wrote:
> The second oldest is "notebook -- should be able export (=print) to
> latex/pdf/dvi", which could be finally closed when Jupyter notebook is
> the default notebook

Does typeset output meanwhile work? (I ask as, having e.g. show(x^2) in
a Jupyter notebook, then File --> Download as --> PDF via LaTeX does not
typeset the output, but unfortunately uses the plain text output; tested
with 8.0.beta8)

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-06 Thread Matthias Koeppe
On Friday, June 2, 2017 at 2:01:25 AM UTC-7, François wrote:
>
>
> Actually there has been some work on enabling sage to be built and 
> installed in a prefix that isn’t under SAGE_ROOT. This is why we now 
> have sage-env-config. 
> So you could do a run of configure of sage with python2 and install it 
> in $prefix_python2 and then do the same for python3 but install it 
> in $prefix_python3. Out of the same source tree. 
> Some cleaning may be required between builds, I haven’t actually worked 
> on the functionality myself. 
>
>
In addition to the recently implemented feature `./configure --prefix=...` 
that you mention above, we would also need out-of-tree builds (VPATH 
builds); this is the standard autotools mechanism for having several build 
configurations from one source tree. (No cleaning in between builds will be 
required with this method; the source tree is always clean.) There is 
initial work in this direction on this ticket: 
https://trac.sagemath.org/ticket/21469 (it needs rebasing and updating).


-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-03 Thread Francois Bissey

> On 3/06/2017, at 18:04, Ralf Stephan  wrote:
> 
> On Friday, June 2, 2017 at 10:48:19 PM UTC+2, François wrote:
> Only used by sage. Those are the components linked to it 
> 
> Naive questions (maybe irrelevant):  Shouldn't it be only libs/pynac
> that is linked to libpynac? Are the direct links from other Sage modules
> really necessary? Should they be minimized?

I am compiling everything with `—as-needed` if something is linked with
libpynac in my list, that means some symbols from libpynac are requested
by those modules.


-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-03 Thread Ralf Stephan
On Friday, June 2, 2017 at 10:48:19 PM UTC+2, François wrote:
>
> Only used by sage. Those are the components linked to it 


Naive questions (maybe irrelevant):  Shouldn't it be only libs/pynac
that is linked to libpynac? Are the direct links from other Sage modules
really necessary? Should they be minimized?

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Francois Bissey

> On 3/06/2017, at 05:28, Nils Bruin  wrote:
> 
> On Friday, June 2, 2017 at 2:54:22 AM UTC-6, Ralf Stephan wrote:
> No. See 
> https://stackoverflow.com/questions/44322187/binary-using-both-python-c-api-version-2-and-3
> 
> But then we need to either build libraries libpynac2 and libpynac3 or put 
> libpynac somewhere in local/lib/python*. Do we know which other components 
> get linked against libpynac? Is it just the extension module pynac.pyx ?


Only used by sage. Those are the components linked to it
> readelf -d `find /usr/lib64/python2.7/site-packages/sage -name \*.so` | grep 
> -C 6 libpynac
File: /usr/lib64/python2.7/site-packages/sage/libs/pynac/pynac.so

Dynamic section at offset 0x5bbe0 contains 31 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: [libgsl.so.19]
 0x0001 (NEEDED) Shared library: [libgmp.so.10]
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libm.so.6]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x8358
--
 0x (NULL)   0x0

File: /usr/lib64/python2.7/site-packages/sage/libs/pynac/constant.so

Dynamic section at offset 0xaca8 contains 28 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x35c0
 0x000d (FINI)   0x8f98
--
 0x (NULL)   0x0

File: /usr/lib64/python2.7/site-packages/sage/symbolic/series.so

Dynamic section at offset 0x15c58 contains 28 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x4830
 0x000d (FINI)   0x11468
--
 0x (NULL)   0x0

File: /usr/lib64/python2.7/site-packages/sage/symbolic/comparison.so

Dynamic section at offset 0x1bc80 contains 28 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x4dc8
 0x000d (FINI)   0x17d78
--
 0x (NULL)   0x0

File: /usr/lib64/python2.7/site-packages/sage/symbolic/function.so

Dynamic section at offset 0x3cbd8 contains 28 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x8640
 0x000d (FINI)   0x354e4
--
 0x (NULL)   0x0

File: /usr/lib64/python2.7/site-packages/sage/symbolic/substitution_map.so

Dynamic section at offset 0xbcd0 contains 28 entries:
  TagType Name/Value
 0x0001 (NEEDED) Shared library: 
[libpynac_python2_7.so.13]
 0x0001 (NEEDED) Shared library: [libstdc++.so.6]
 0x0001 (NEEDED) Shared library: [libpython2.7.so.1.0]
 0x0001 (NEEDED) Shared library: [libgcc_s.so.1]
 0x0001 (NEEDED) Shared library: [libc.so.6]
 0x000c (INIT)   0x3628
 0x000d (FINI)   0x97dc
--
 0x (NULL)  

Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Nils Bruin
On Friday, June 2, 2017 at 2:54:22 AM UTC-6, Ralf Stephan wrote:
>
> No. See 
> https://stackoverflow.com/questions/44322187/binary-using-both-python-c-api-version-2-and-3
>
> But then we need to either build libraries libpynac2 and libpynac3 or put 
libpynac somewhere in local/lib/python*. Do we know which other components 
get linked against libpynac? Is it just the extension module pynac.pyx ?

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Francois Bissey

> On 1/06/2017, at 23:27, Kwankyu Lee  wrote:
> 
> I also thought about building both py2+3 at the same time, it would be a 
> great debugging help during the transition if you can easily run both. Then 
> in 3 years we'll just cut out the py2 part and be done with it...
> 
> I am thinking of what would be the real benefits, compared with the scheme:
> 
> I keep two sage git repos at sage2/ and sage3/ and build sage2/ for python2 
> and sage3/ for python3. I fix a problem in python3 built and commit the fix. 
> Then I import the commit to the python2 repo and check if the commit does not 
> break python2 built.
> 
> In the proposed scheme, we would not need to move the commits around. Are 
> there other advantages besides this?
> 
> And we should consider if these benefits (not yet clear to me) outweigh the 
> extra efforts to make sage buildable to run with both python2 and python3.
>  

Actually there has been some work on enabling sage to be built and
installed in a prefix that isn’t under SAGE_ROOT. This is why we now
have sage-env-config.
So you could do a run of configure of sage with python2 and install it
in $prefix_python2 and then do the same for python3 but install it
in $prefix_python3. Out of the same source tree.
Some cleaning may be required between builds, I haven’t actually worked
on the functionality myself.

François

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Dima Pasechnik
one way or the other, underlinking does not work on Cygwin.

On Friday, June 2, 2017 at 9:54:22 AM UTC+1, Ralf Stephan wrote:
>
> No. See 
> https://stackoverflow.com/questions/44322187/binary-using-both-python-c-api-version-2-and-3
>
> On Friday, June 2, 2017 at 8:35:57 AM UTC+2, François wrote:
>>
>>
>> > On 2/06/2017, at 17:57, Ralf Stephan  wrote: 
>> > 
>> > On Thursday, June 1, 2017 at 12:29:23 PM UTC+2, François wrote: 
>> > .. Installing pynac for both python at the same time 
>> > means rethinking its packaging. 
>> > 
>> > As a possible alternative, would avoiding those calls that differ 
>> > between version 2 and 3 of the C API help? It might not be so 
>> > difficult to do that. 
>> > 
>>
>> Yes, it would, and in that case we would want to underlink 
>> libpynac. By that I mean not link libpynac to libpython when 
>> you build and install it so that when you link an application 
>> you can link with any python providing the right symbols. 
>>
>> That’s what upstream gsl does with regards to cblas. 
>>
>> The approach has some downsides. It doesn’t play well with 
>> the gold linker when you specify `—as-needed` at least. Which is 
>> why I fixed gsl in sage to be linked to the current cblas 
>> instead of leaving it as shipped upstream. 
>> However there could be ways to deal with that. 
>>
>> The next issue is that I don’t know how well it works on 
>> OS X and cygwin. I am presuming it would work on OS X but 
>> I cannot make such statement for cygwin. 
>>
>> A bonus point for that approach is that it would lead to 
>> the removal of all the pragma checking for python3 in the code. 
>>
>> François 
>>
>>
>>

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Francois Bissey

> On 2/06/2017, at 20:54, Ralf Stephan  wrote:
> 
> No. See 
> https://stackoverflow.com/questions/44322187/binary-using-both-python-c-api-version-2-and-3

So much for that then.
This email may be confidential and subject to legal privilege, it may
not reflect the views of the University of Canterbury, and it is not
guaranteed to be virus free. If you are not an intended recipient,
please notify the sender immediately and erase all copies of the message
and any attachments.

Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more
information.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Ralf Stephan
No. 
See 
https://stackoverflow.com/questions/44322187/binary-using-both-python-c-api-version-2-and-3

On Friday, June 2, 2017 at 8:35:57 AM UTC+2, François wrote:
>
>
> > On 2/06/2017, at 17:57, Ralf Stephan  
> wrote: 
> > 
> > On Thursday, June 1, 2017 at 12:29:23 PM UTC+2, François wrote: 
> > .. Installing pynac for both python at the same time 
> > means rethinking its packaging. 
> > 
> > As a possible alternative, would avoiding those calls that differ 
> > between version 2 and 3 of the C API help? It might not be so 
> > difficult to do that. 
> > 
>
> Yes, it would, and in that case we would want to underlink 
> libpynac. By that I mean not link libpynac to libpython when 
> you build and install it so that when you link an application 
> you can link with any python providing the right symbols. 
>
> That’s what upstream gsl does with regards to cblas. 
>
> The approach has some downsides. It doesn’t play well with 
> the gold linker when you specify `—as-needed` at least. Which is 
> why I fixed gsl in sage to be linked to the current cblas 
> instead of leaving it as shipped upstream. 
> However there could be ways to deal with that. 
>
> The next issue is that I don’t know how well it works on 
> OS X and cygwin. I am presuming it would work on OS X but 
> I cannot make such statement for cygwin. 
>
> A bonus point for that approach is that it would lead to 
> the removal of all the pragma checking for python3 in the code. 
>
> François 
>
>
>

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-02 Thread Francois Bissey

> On 2/06/2017, at 17:57, Ralf Stephan  wrote:
> 
> On Thursday, June 1, 2017 at 12:29:23 PM UTC+2, François wrote:
> .. Installing pynac for both python at the same time 
> means rethinking its packaging. 
> 
> As a possible alternative, would avoiding those calls that differ
> between version 2 and 3 of the C API help? It might not be so
> difficult to do that. 
> 

Yes, it would, and in that case we would want to underlink 
libpynac. By that I mean not link libpynac to libpython when
you build and install it so that when you link an application
you can link with any python providing the right symbols.

That’s what upstream gsl does with regards to cblas.

The approach has some downsides. It doesn’t play well with
the gold linker when you specify `—as-needed` at least. Which is
why I fixed gsl in sage to be linked to the current cblas
instead of leaving it as shipped upstream.
However there could be ways to deal with that.

The next issue is that I don’t know how well it works on
OS X and cygwin. I am presuming it would work on OS X but
I cannot make such statement for cygwin.

A bonus point for that approach is that it would lead to 
the removal of all the pragma checking for python3 in the code.

François


-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread Ralf Stephan
On Thursday, June 1, 2017 at 12:29:23 PM UTC+2, François wrote:
>
> .. Installing pynac for both python at the same time 
> means rethinking its packaging. 


As a possible alternative, would avoiding those calls that differ
between version 2 and 3 of the C API help? It might not be so
difficult to do that. 

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread William Stein
Erik:
> I've been thinking of cleaning up the main `sage` command anyways,
> though it would be good to transition to a new, better UI for it as
> well.
>
> For the top level of the `sage` command I wouldn't use Python.  For
> example, for things like `sage -sh` (or whatever the future equivalent
> is) starting up the Python interpreter just to launch a shell is too
> slow.  But sub-command handling can still be implemented cleanly and
> nicely in a bash script.  Individual sub-commands may, in turn, be
> written in Python depending on how relevant the overhead is.

It might be good to add some comments here:

   https://trac.sagemath.org/ticket/21

"command line option parsing" is the oldest opened Sage ticket!

   https://trac.sagemath.org/report/58?sort=ticket=1=1

The second oldest is "notebook -- should be able export (=print) to
latex/pdf/dvi", which could be finally closed when Jupyter notebook is
the default notebook.

-- 
William (http://wstein.org)

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread Erik Bray
On Thu, Jun 1, 2017 at 4:01 PM, William Stein  wrote:
>
>
> On Thursday, June 1, 2017, Erik Bray  wrote:
>>
>> On Wed, May 31, 2017 at 10:00 PM, John H Palmieri
>>  wrote:
>> > I have a proposal for making the transition to use Sage with Python 3.
>> > See
>> > https://trac.sagemath.org/ticket/23119 for details (and a branch which
>> > works, at least in my limited testing). The proposal:
>> >
>> > - Have a new command "sage3" which runs Sage using Python 3.
>> >
>> > - If you build Sage with the environment variable SAGE_PYTHON3 set to
>> > "yes",
>> > then build for both Python 2 and Python 3. Although this will increase
>> > the
>> > build time and the required disk space (by 800MB when I tried it), it
>> > means
>> > that you should have a choice about how to run Sage which does not
>> > depend on
>> > how you built it.
>> >
>> > - Although for now, SAGE_PYTHON3 will not be set, eventually we could
>> > switch
>> > to having it always set to "yes", to encourage Python 3 development and
>> > prevent Python 3 incompatibilities. (Then later we can change the
>> > behavior
>> > again, only building for Python 3.)
>> >
>> > - It would probably be good to have a ./configure option instead of the
>> > environment variable, but I have not tried to implement that.
>> >
>> > Please provide feedback. I have not heard any other suggestions for how
>> > to
>> > run Sage with Python 3, so I thought a concrete proposal would be good
>> > to
>> > get the ball rolling.
>> >
>> > This proposal still requires solving the problems Frédéric has already
>> > mentioned
>> > (https://groups.google.com/d/msg/sage-devel/FqR-37Fu3tY/RjDx_SG_BAAJ),
>> > as
>> > well as ongoing work to make the Sage library compatible with Python 3.
>> > Everyone is encouraged to contribute!
>>
>> I basically like this idea.  Though rather than a separate `sage3`
>> command why not just a simple flag to the existing `sage` command?
>> E.g. `sage -3`.  This would have the effect of setting the default
>> Python for all things that use Python (`sage -pip`, `sage -python`,
>> and just the sage interpreter itself) to Python 3.
>
>
>
> Maybe we could also redo the command line options parsing properly for the
> new sage3 command?  Eg use sub commands like git, use the python argparse
> module properly, etc.

I've been thinking of cleaning up the main `sage` command anyways,
though it would be good to transition to a new, better UI for it as
well.

For the top level of the `sage` command I wouldn't use Python.  For
example, for things like `sage -sh` (or whatever the future equivalent
is) starting up the Python interpreter just to launch a shell is too
slow.  But sub-command handling can still be implemented cleanly and
nicely in a bash script.  Individual sub-commands may, in turn, be
written in Python depending on how relevant the overhead is.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread William Stein
On Thursday, June 1, 2017, Erik Bray  wrote:

> On Wed, May 31, 2017 at 10:00 PM, John H Palmieri
> > wrote:
> > I have a proposal for making the transition to use Sage with Python 3.
> See
> > https://trac.sagemath.org/ticket/23119 for details (and a branch which
> > works, at least in my limited testing). The proposal:
> >
> > - Have a new command "sage3" which runs Sage using Python 3.
> >
> > - If you build Sage with the environment variable SAGE_PYTHON3 set to
> "yes",
> > then build for both Python 2 and Python 3. Although this will increase
> the
> > build time and the required disk space (by 800MB when I tried it), it
> means
> > that you should have a choice about how to run Sage which does not
> depend on
> > how you built it.
> >
> > - Although for now, SAGE_PYTHON3 will not be set, eventually we could
> switch
> > to having it always set to "yes", to encourage Python 3 development and
> > prevent Python 3 incompatibilities. (Then later we can change the
> behavior
> > again, only building for Python 3.)
> >
> > - It would probably be good to have a ./configure option instead of the
> > environment variable, but I have not tried to implement that.
> >
> > Please provide feedback. I have not heard any other suggestions for how
> to
> > run Sage with Python 3, so I thought a concrete proposal would be good to
> > get the ball rolling.
> >
> > This proposal still requires solving the problems Frédéric has already
> > mentioned
> > (https://groups.google.com/d/msg/sage-devel/FqR-37Fu3tY/RjDx_SG_BAAJ),
> as
> > well as ongoing work to make the Sage library compatible with Python 3.
> > Everyone is encouraged to contribute!
>
> I basically like this idea.  Though rather than a separate `sage3`
> command why not just a simple flag to the existing `sage` command?
> E.g. `sage -3`.  This would have the effect of setting the default
> Python for all things that use Python (`sage -pip`, `sage -python`,
> and just the sage interpreter itself) to Python 3.



Maybe we could also redo the command line options parsing properly for the
new sage3 command?  Eg use sub commands like git, use the python argparse
module properly, etc.


>
> Regarding a configure flag, this fits in to my plans for "abstract
> packages" that require selecting a concrete package to fulfill it.
> Python 2 and Python 3 can be installed simultaneously, but there is
> also an abstract package called just "python" which is the default
> Python to use for Sage, and it can be fulfilled by either Python 2 or
> Python 3.
>
> --
> 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 sage-devel+unsubscr...@googlegroups.com .
> To post to this group, send email to sage-devel@googlegroups.com
> .
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Sent from my massive iPhone 6 plus.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread Francois Bissey
I am currently doing a python2+python3 build in sage-on-gentoo.
I need none of the hack currently studied for the script, they 
may end up being counter productive for sage-on-distro, we’ll 
have to see.

Doing a python2+python3 at the same time in the same prefix 
is challenging because of brial (easily fixed) and pynac
(major packaging hack + upstream PR required) are standing in 
the way. Installing pynac for both python at the same time
means rethinking its packaging.

But at least I am now doing regular build of sage with python3
on the “vbraun” fork. I am still building the doc with the python2
version. Not doing it with python3 since it is still crashing on
start up.

François

> On 1/06/2017, at 19:17, Volker Braun  wrote:
> 
> Sounds great!
> 
> I also thought about building both py2+3 at the same time, it would be a 
> great debugging help during the transition if you can easily run both. Then 
> in 3 years we'll just cut out the py2 part and be done with it...
> 
> 
> 
> -- 
> 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 sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-devel] Sage Python 3 proposal

2017-06-01 Thread Erik Bray
On Wed, May 31, 2017 at 10:00 PM, John H Palmieri
 wrote:
> I have a proposal for making the transition to use Sage with Python 3. See
> https://trac.sagemath.org/ticket/23119 for details (and a branch which
> works, at least in my limited testing). The proposal:
>
> - Have a new command "sage3" which runs Sage using Python 3.
>
> - If you build Sage with the environment variable SAGE_PYTHON3 set to "yes",
> then build for both Python 2 and Python 3. Although this will increase the
> build time and the required disk space (by 800MB when I tried it), it means
> that you should have a choice about how to run Sage which does not depend on
> how you built it.
>
> - Although for now, SAGE_PYTHON3 will not be set, eventually we could switch
> to having it always set to "yes", to encourage Python 3 development and
> prevent Python 3 incompatibilities. (Then later we can change the behavior
> again, only building for Python 3.)
>
> - It would probably be good to have a ./configure option instead of the
> environment variable, but I have not tried to implement that.
>
> Please provide feedback. I have not heard any other suggestions for how to
> run Sage with Python 3, so I thought a concrete proposal would be good to
> get the ball rolling.
>
> This proposal still requires solving the problems Frédéric has already
> mentioned
> (https://groups.google.com/d/msg/sage-devel/FqR-37Fu3tY/RjDx_SG_BAAJ), as
> well as ongoing work to make the Sage library compatible with Python 3.
> Everyone is encouraged to contribute!

I basically like this idea.  Though rather than a separate `sage3`
command why not just a simple flag to the existing `sage` command?
E.g. `sage -3`.  This would have the effect of setting the default
Python for all things that use Python (`sage -pip`, `sage -python`,
and just the sage interpreter itself) to Python 3.

Regarding a configure flag, this fits in to my plans for "abstract
packages" that require selecting a concrete package to fulfill it.
Python 2 and Python 3 can be installed simultaneously, but there is
also an abstract package called just "python" which is the default
Python to use for Sage, and it can be fulfilled by either Python 2 or
Python 3.

-- 
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 sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.