Switch to Python 3 by default

357 views
Skip to first unread message

Volker Braun

unread,
Oct 26, 2019, 7:58:23 PM10/26/19
to sage-devel
Maybe I missed it, but I didn't find a ticket for that. I think now would be a good time to flip the switch, though. Any thoughts?

Vincent Delecroix

unread,
Oct 26, 2019, 8:02:25 PM10/26/19
to sage-...@googlegroups.com
+1

François Bissey

unread,
Oct 26, 2019, 8:20:24 PM10/26/19
to sage-...@googlegroups.com
+1
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/4a982d46-747e-abaf-a76a-c7f5764c363f%40gmail.com.

Vincent Delecroix

unread,
Oct 26, 2019, 8:27:51 PM10/26/19
to sage-...@googlegroups.com

John H Palmieri

unread,
Oct 27, 2019, 1:01:37 AM10/27/19
to sage-devel
+1


On Saturday, October 26, 2019 at 5:27:51 PM UTC-7, vdelecroix wrote:

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


Le 26/10/2019 à 17:20, François Bissey a écrit :
> +1
>
>> On 27/10/2019, at 12:58 PM, Vincent Delecroix <20100.d...@gmail.com> wrote:
>>
>> +1
>>
>> Le 26/10/2019 à 16:58, Volker Braun a écrit :
>>> Maybe I missed it, but I didn't find a ticket for that. I think now would
>>> be a good time to flip the switch, though. Any thoughts?
>>
>> --
>> 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-...@googlegroups.com.

Samuel Lelievre

unread,
Oct 27, 2019, 1:29:41 AM10/27/19
to sage-devel
+1

VulK

unread,
Oct 27, 2019, 6:28:12 AM10/27/19
to sage-...@googlegroups.com
+1

* Samuel Lelievre <samuel....@gmail.com> [2019-10-26 22:29:40]:

>+1
>
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/ca69beab-7948-4c5a-8530-9bd13bd299d5%40googlegroups.com.

Eric Gourgoulhon

unread,
Oct 27, 2019, 6:37:33 AM10/27/19
to sage-devel
Le dimanche 27 octobre 2019 01:58:23 UTC+2, Volker Braun a écrit :
Maybe I missed it, but I didn't find a ticket for that. I think now would be a good time to flip the switch, though. Any thoughts?

+1

Eric.

 

jplab

unread,
Oct 27, 2019, 7:42:47 AM10/27/19
to sage-devel
+1


Le dimanche 27 octobre 2019 01:58:23 UTC+2, Volker Braun a écrit :

mmarco

unread,
Oct 27, 2019, 10:52:49 AM10/27/19
to sage-devel
If all the issues ar solved... sure. I was even surprised that we started haviong betas of version 9 with python 2 (I assumed that the witch to version 9 would be mostly about the transition to python 3).

+1

Dima Pasechnik

unread,
Oct 27, 2019, 11:52:34 AM10/27/19
to sage-devel
+1, although it seems that #25837 (making sagenb optional) should happen first.
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/76975173-bd00-44ed-af88-8d388f061f3a%40googlegroups.com.

Emmanuel Charpentier

unread,
Oct 27, 2019, 11:54:35 AM10/27/19
to sage-devel
In linked ticket :

Because 3 x 3 = 9 and we are at 9.0.beta3 these are three reasons to do the switch

Do you plan to start a sage_numerology package ??? ;-) Heavens... And, while you are at it, why not a sage-astrology or a a sage_econometrics package ? ;-]...

Shuddering...

That said, +1 for switching to Python3 by default.

BUT be damn sure to document the way to compile for/with Python 2 in all places we currently doncument how to compile for Python 3.

Le dimanche 27 octobre 2019 02:27:51 UTC+2, vdelecroix a écrit :

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


Le 26/10/2019 à 17:20, François Bissey a écrit :
> +1
>
>> On 27/10/2019, at 12:58 PM, Vincent Delecroix <20100.d...@gmail.com> wrote:
>>
>> +1
>>
>> Le 26/10/2019 à 16:58, Volker Braun a écrit :
>>> Maybe I missed it, but I didn't find a ticket for that. I think now would
>>> be a good time to flip the switch, though. Any thoughts?
>>
>> --
>> 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-...@googlegroups.com.

Emmanuel Charpentier

unread,
Oct 27, 2019, 11:57:07 AM10/27/19
to sage-devel
+1 for Dima's remark. Has anybody used the old Sage notebook with a Python 3-based Sage ?


Le dimanche 27 octobre 2019 16:52:34 UTC+1, Dima Pasechnik a écrit :
+1, although it seems that  #25837 (making sagenb optional) should happen first.

On Sun, Oct 27, 2019 at 4:52 PM mmarco <mma...@unizar.es> wrote:
>
> If all the issues ar solved... sure. I was even surprised that we started haviong betas of version 9 with python 2 (I assumed that the witch to version 9 would be mostly about the transition to python 3).
>
> +1
>
> El domingo, 27 de octubre de 2019, 1:58:23 (UTC+2), Volker Braun escribió:
>>
>> Maybe I missed it, but I didn't find a ticket for that. I think now would be a good time to flip the switch, though. Any thoughts?
>
> --
> 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-...@googlegroups.com.

kcrisman

unread,
Oct 27, 2019, 10:53:27 PM10/27/19
to sage-devel


BUT be damn sure to document the way to compile for/with Python 2 in all places we currently doncument how to compile for Python 3.


+1
Will py2 buildbots or regular testers still exist? 

Travis Scrimshaw

unread,
Oct 30, 2019, 1:05:16 AM10/30/19
to sage-devel
+1

Frédéric Chapoton

unread,
Oct 30, 2019, 7:02:00 AM10/30/19
to sage-devel
Please feel free to edit and enhance the wiki page about the switch : https://wiki.sagemath.org/Python3-Switch


Le dimanche 27 octobre 2019 01:58:23 UTC+2, Volker Braun a écrit :

Frédéric Chapoton

unread,
Nov 3, 2019, 8:18:13 AM11/3/19
to sage-devel
Could please some of the many plus-one-ing people try the branch at #28660 and report there if it works for them, namely builds a working python3-sage by default ?

Frédéric


Le dimanche 27 octobre 2019 01:58:23 UTC+2, Volker Braun a écrit :

VulK

unread,
Nov 3, 2019, 8:46:43 AM11/3/19
to sage-...@googlegroups.com
Building now
S.


* Frédéric Chapoton <fchap...@gmail.com> [2019-11-03 05:18:13]:
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/ad9edbd6-525f-4e6c-8036-3d962e6d07a1%40googlegroups.com.

VulK

unread,
Nov 3, 2019, 11:57:19 AM11/3/19
to sage-...@googlegroups.com
I have issues with a symlink when installing ipython:

"""
...
Successfully installed ipython-5.8.0
Cleaning up...
Removed build tracker '/tmp/pip-req-tracker-x6b62y1w'

real 0m3.382s
user 0m3.027s
sys 0m0.498s
Copying package files from temporary location /opt/sage-python3/local/var/tmp/sage/build/ipython-5.8.0/inst to /opt/sage-python3/local
cp: not writing through dangling symlink '/opt/sage-python3/local/./bin/ipython'
************************************************************************
Error copying files for ipython-5.8.0.
************************************************************************
...
"""

This install was in a dir where previously I had installed using python3 and
with ./configure --with-python=3 but I ran make maintainer-clean before
attempting to compile public/python3_switch
S.




* Frédéric Chapoton <fchap...@gmail.com> [2019-11-03 05:18:13]:

Dima Pasechnik

unread,
Nov 3, 2019, 12:16:51 PM11/3/19
to sage-devel


On Sun, 3 Nov 2019, 16:57 VulK, <etn4...@gmail.com> wrote:
I have issues with a symlink when installing ipython:

"""
  ...
  Successfully installed ipython-5.8.0
  Cleaning up...
  Removed build tracker '/tmp/pip-req-tracker-x6b62y1w'

  real    0m3.382s
  user    0m3.027s
  sys     0m0.498s
  Copying package files from temporary location /opt/sage-python3/local/var/tmp/sage/build/ipython-5.8.0/inst to /opt/sage-python3/local
  cp: not writing through dangling symlink '/opt/sage-python3/local/./bin/ipython'
  ************************************************************************
  Error copying files for ipython-5.8.0.
  ************************************************************************
  ...
"""

This install was in a dir where previously I had installed using python3 and
with ./configure --with-python=3 but I ran make maintainer-clean before
attempting to compile public/python3_switch


S.




* Frédéric Chapoton <fchap...@gmail.com> [2019-11-03 05:18:13]:

>Could please some of the many plus-one-ing people try the branch at #28660
>and report there if it works for them, namely builds a working python3-sage
>by default ?
>
>Frédéric
>
>Le dimanche 27 octobre 2019 01:58:23 UTC+2, Volker Braun a écrit :
>>
>> Maybe I missed it, but I didn't find a ticket for that. I think now would
>> be a good time to flip the switch, though. Any thoughts?
>>
>
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/ad9edbd6-525f-4e6c-8036-3d962e6d07a1%40googlegroups.com.

--
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+...@googlegroups.com.

VulK

unread,
Nov 3, 2019, 1:50:29 PM11/3/19
to sage-...@googlegroups.com
Thanks!

Next up an error while building docs

[dochtml] [discrete_] from /opt/sage-python3/src/doc/en/reference/discrete_geometry/sage/geometry/triangulation/point_configuration.rst:
[dochtml] [discrete_] Traceback (most recent call last):
[dochtml] [discrete_] File "/opt/sage-python3/local/lib/python3.7/site-packages/matplotlib/sphinxext/plot_directive.py", line 524, in run_code
[dochtml] [discrete_] six.exec_(code, ns)
[dochtml] [discrete_] File "<string>", line 4, in <module>
[dochtml] [discrete_] File "<string>", line 41, in sphinx_plot
[dochtml] [discrete_] File "sage/plot/plot3d/base.pyx", line 1637, in sage.plot.plot3d.base.Graphics3d.save (build/cythonized/sage/plot/plot3d/base.c:21661)
[dochtml] [discrete_] self.save_image(filename, **kwds)
[dochtml] [discrete_] File "sage/plot/plot3d/base.pyx", line 1566, in sage.plot.plot3d.base.Graphics3d.save_image (build/cythonized/sage/plot/plot3d/base.c:2
1219)
[dochtml] [discrete_] self._save_image_png(filename, **kwds)
[dochtml] [discrete_] File "sage/plot/plot3d/base.pyx", line 1528, in sage.plot.plot3d.base.Graphics3d._save_image_png (build/cythonized/sage/plot/plot3d/bas
e.c:20856)
[dochtml] [discrete_] scene = self._rich_repr_jmol(**opts)
[dochtml] [discrete_] File "sage/plot/plot3d/base.pyx", line 261, in sage.plot.plot3d.base.Graphics3d._rich_repr_jmol (build/cythonized/sage/plot/plot3d/base
.c:7224)
[dochtml] [discrete_] if not jdata.is_jvm_available():
[dochtml] [discrete_] File "/opt/sage-python3/local/lib/python3.7/site-packages/sage/interfaces/jmoldata.py", line 70, in is_jvm_available
[dochtml] [discrete_] java_version_number = int(re.sub(r'.*version "(0\.|1\.)?(\d*)[\s\S]*', r'\2', version))
[dochtml] [discrete_] ValueError: invalid literal for int() with base 10: 'Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true\n8'

S.

* Dima Pasechnik <dim...@gmail.com> [2019-11-03 19:16:35]:
>> https://groups.google.com/d/msgid/sage-devel/20191103165706.GD29746%40bunion
>> .
>>
>
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq07_FAOJfP7BXDAjtdmW1WJRunO13cExo%3D7Cu-3pSFLPw%40mail.gmail.com.

VulK

unread,
Nov 3, 2019, 4:55:21 PM11/3/19
to sage-...@googlegroups.com
I figured out that the error I posted depended on an ambient variable that I
have set um in my rc files, namely

export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true"

with this `java -version` returns

Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (IcedTea 3.8.0) (Gentoo icedtea-3.8.0)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

and `sage.interfaces.jmoldata.JmolData.is_jvm_available` fails. This is
independent of python3.

On the same note: the current implementation of `is_jvm_available` is not
really robust and I should open a ticket about this; any suggestion for a
better implementation?
S.


* Dima Pasechnik <dim...@gmail.com> [2019-11-03 19:16:35]:

>> https://groups.google.com/d/msgid/sage-devel/20191103165706.GD29746%40bunion
>> .
>>
>
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq07_FAOJfP7BXDAjtdmW1WJRunO13cExo%3D7Cu-3pSFLPw%40mail.gmail.com.

VulK

unread,
Nov 3, 2019, 7:35:29 PM11/3/19
to sage-...@googlegroups.com
All test passed!

Gentoo linux running on x86_64 Intel(R) Core(TM) i7-6900K CPU @ 3.20GHz

Three doctests in src/sage/rings/padics/padic_lattice_element.py failed on
safe -t --all but were succesful when the file was checked individually.

I confirm my green light
S.




* Dima Pasechnik <dim...@gmail.com> [2019-11-03 19:16:35]:

>> https://groups.google.com/d/msgid/sage-devel/20191103165706.GD29746%40bunion
>> .
>>
>
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq07_FAOJfP7BXDAjtdmW1WJRunO13cExo%3D7Cu-3pSFLPw%40mail.gmail.com.

Michael Orlitzky

unread,
Nov 4, 2019, 8:49:25 AM11/4/19
to sage-...@googlegroups.com
On 11/3/19 4:55 PM, VulK wrote:
>
> On the same note: the current implementation of `is_jvm_available` is not
> really robust and I should open a ticket about this; any suggestion for a
> better implementation?
> S.
>

const false

Does it do anything except jmol? The right way to do it would be to add
--with-jvm=/path/to/jvm or something like that to the ./configure
script. The is_jvm_available() implementation would then be hard-coded
at build time, and not enabled automagically. But that's a lot of work a
a feature that no one's going to use after jmol is replaced.

VulK

unread,
Nov 5, 2019, 5:19:59 AM11/5/19
to sage-...@googlegroups.com
I am not sure I agree with setting this at build time: a jvm could be
installed afterwards and/or updated independently of sage
S.



* Michael Orlitzky
<mic...@orlitzky.com> [2019-11-04 08:49:18]:
>--
>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+...@googlegroups.com.
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/e01aeb45-7170-ef2e-9f0b-77f5c8301a5b%40orlitzky.com.

Dima Pasechnik

unread,
Nov 5, 2019, 5:30:07 AM11/5/19
to sage-devel
On Tue, Nov 5, 2019 at 10:19 AM VulK <etn4...@gmail.com> wrote:
>
> I am not sure I agree with setting this at build time: a jvm could be
> installed afterwards and/or updated independently of sage

if the configuration of the system has changed,
one may have to re-configure/rebuild.

Or are you saying that Sage fails to appreciate these truly unique
advantages of the superior Java technology? :-P


> S.
>
>
>
> * Michael Orlitzky
> <mic...@orlitzky.com> [2019-11-04 08:49:18]:
>
> >On 11/3/19 4:55 PM, VulK wrote:
> >>
> >> On the same note: the current implementation of `is_jvm_available` is not
> >> really robust and I should open a ticket about this; any suggestion for a
> >> better implementation?
> >> S.
> >>
> >
> >const false
> >
> >Does it do anything except jmol? The right way to do it would be to add
> >--with-jvm=/path/to/jvm or something like that to the ./configure
> >script. The is_jvm_available() implementation would then be hard-coded
> >at build time, and not enabled automagically. But that's a lot of work a
> > a feature that no one's going to use after jmol is replaced.
> >
> >--
> >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+...@googlegroups.com.
> >To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/e01aeb45-7170-ef2e-9f0b-77f5c8301a5b%40orlitzky.com.
>
> --
> 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+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/20191105101851.GA15686%40strabo.

VulK

unread,
Nov 5, 2019, 5:34:55 AM11/5/19
to sage-...@googlegroups.com
I am saying that I am not super fond of the idea or recompiling because of a
java update: I can see how one could get confused. Either way, considering
that no-one noticed this "feature" till now I doubt that this will have any
impact.

On a side note: is jmol going to be replaced? If so, should we just ignore
the issue?

S.




* Dima Pasechnik <dim...@gmail.com> [2019-11-05 10:29:52]:
>To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq07PM36PvCOyvcuBerh6icyf0R-FXBR%3DybpeivSbsa%2Btg%40mail.gmail.com.

Eric Gourgoulhon

unread,
Nov 5, 2019, 7:33:07 AM11/5/19
to sage-devel
Le mardi 5 novembre 2019 11:34:55 UTC+1, Salvatore Stella a écrit :
On a side note: is jmol going to be replaced? If so, should we just ignore
the issue?


Jmol has been replaced by three.js as Sage's default 3d viewer in Sage 9.0.beta0,
Note however that Jmol is still available via the option viewer='jmol' in the plot functions.

Eric.

Michael Orlitzky

unread,
Nov 5, 2019, 9:20:28 AM11/5/19
to sage-...@googlegroups.com
On 11/5/19 5:18 AM, VulK wrote:
> I am not sure I agree with setting this at build time: a jvm could be
> installed afterwards and/or updated independently of sage
> S.
>

This is generally considered a bad practice because it leads to
unpredictability:

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Automagic_dependencies

You already have to recompile sage when any of its libraries are
upgraded. (And even if you think you use the bundled versions of
everything, try upgrading your system's glibc and see what happens.) The
only reason java is different is because we half-assed this stuff a long
time ago when we decided that java was going to be a kinda-sorta
dependency but nobody felt like making an spkg for it.

The good news is, as more and more things are unbundled, rebuilding sage
during development becomes pretty easy. You only have to recompile the
things that need recompiling, which in this case would likely be the one
file where jmol is used. The bigger win is for end users, whose package
managers can handle all of this stuff for them once our build system is
sane and predictable =)

kcrisman

unread,
Nov 7, 2019, 9:15:14 AM11/7/19
to sage-devel
As a side note, also note that is actually is now a javascript library, at least in its usual incarnation in (both) notebooks, though this may not directly help upgrade issues.
Reply all
Reply to author
Forward
0 new messages