About python2 vs python3 package versions

32 views
Skip to first unread message

Antonio Rojas

unread,
Jul 13, 2019, 5:54:15 AM7/13/19
to sage-packaging, sage-devel
Hi all,
Today I tested building Sage on Arch against our python3 packages. Not surprisingly, it failed to even start. This is due to our python3 ipython package being at version 7 already, with includes some API changes that require some porting in Sage.
More and more python modules are completely dropping python2 support: ipython, sphinx, networkx, scipy, matplotlib... These packages can't be upgraded in sage-the-distribution and are therefore stuck to an old version until python2 support is dropped in Sage, which presumably won't happen for at least a couple of years. This is going to be a big problem for distributions in the period when Sage defaults to Python3 but still supports Python 2: much patching will probably be needed to support the newer versions of python3 modules with are still not upgraded in Sage due to not supporting python2.
My first question is: would Sage accept patches to support this newer version of python modules (while still keeping compatibility with the older versions shipped by Sage)?. That would allow to reduce the patching required by distros.
However, this would still not be completely satisfactory - the updated version code path would not be tested so the risk of regressions would be quite high. Ideally, Sage should allow to ship different versions for the python2 and python3 versions of these modules, so when compiling with python3 it would use the latest versions. Are there any plans in this direction, or are these packages going to be stuck to old versions until python2 support is dropped?

--Antonio



François Bissey

unread,
Jul 13, 2019, 6:00:34 AM7/13/19
to sage-packaging
I have been thinking about that as well. It would be good to have a way forward.
Recently someone from fedora mentioned they completely dropped python2 and they
still have a sage package. Reading that, I was wondering if they had patches for
everything.

François
> --
> You received this message because you are subscribed to the Google Groups "sage-packaging" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-packagin...@googlegroups.com.
> To post to this group, send email to sage-pa...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-packaging/3113762.mtIEp9FSYH%40arl-portatil.
> For more options, visit https://groups.google.com/d/optout.

Ximin Luo

unread,
Jul 13, 2019, 1:16:26 PM7/13/19
to sage-pa...@googlegroups.com, François Bissey
Out of interest, what are the technical blockers for Sage to simply migrating to python 3 and dropping support for python 2?

Sage-the-distribution already packages its own python 2 so I don't see the problem from a user perspective, of simply migrating and dropping the old one.

X

François Bissey:
--
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git

Samuel Lelièvre

unread,
Jul 13, 2019, 1:33:47 PM7/13/19
to sage-packaging, sage-devel
Sat 2019-07-13 09:54 UTC, Antonio Rojas:
For reference, this was posted both to sage-devel and sage-packaging,
and the discussion is happening in two threads:

https://groups.google.com/d/topic/sage-devel/9zRrmIQzKfI/discussion
https://groups.google.com/d/topic/sage-packaging/i9VosTO9-cM/discussion

Removing Python 2 support is the object of Trac ticket 28000,
aptly numbered in reference to "there will be no Python 2.8":

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

This ticket can be indicated as a prerequisite for other tickets
that depend on that transition.

One thing we could do for a start, given that for now we build
both Python 2 and Python 3 in any case, would be to transition
the Jupyter part of Sage-the-distribution to be python3-based,
allowing us to upgrade all the Jupyter stack to current versions.

I don't know if there are any obstacles to that.

Dima Pasechnik

unread,
Jul 13, 2019, 1:53:49 PM7/13/19
to sage-packaging, sage-devel
if this can work then making use of external Jupyter should be an option too.


I don't know if there are any obstacles to that.

--
You received this message because you are subscribed to the Google Groups "sage-packaging" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sage-packagin...@googlegroups.com.
To post to this group, send email to sage-pa...@googlegroups.com.

Antonio Rojas

unread,
Jul 13, 2019, 2:10:15 PM7/13/19
to sage-pa...@googlegroups.com
El sábado, 13 de julio de 2019 19:33:34 (CEST), Samuel Lelièvre escribió:
> For reference, this was posted both to sage-devel and sage-packaging,
> and the discussion is happening in two threads:
>
> https://groups.google.com/d/topic/sage-devel/9zRrmIQzKfI/discussion
> https://groups.google.com/d/topic/sage-packaging/i9VosTO9-cM/discussion

Sorry about that, I meant to cross-post since this topic concerns both
lists, but the sage-devel one got rejected so I reposted.

> One thing we could do for a start, given that for now we build
> both Python 2 and Python 3 in any case, would be to transition
> the Jupyter part of Sage-the-distribution to be python3-based,
> allowing us to upgrade all the Jupyter stack to current versions.
>
> I don't know if there are any obstacles to that.

That is certainly possible and we've actually been doing that for years in
Arch with just a simple patch to bin/sage-notebook [1]. However, latest
jupyter stack does probably require a never ipython than the one shipped by
Sage, which brings us back to the question of whether it is possible to
provide different versions for py2/py3.

[1]
https://git.archlinux.org/svntogit/community.git/tree/trunk/sagemath-python3-notebook.patch?h=packages/sagemath

Samuel Lelièvre

unread,
Jul 13, 2019, 2:45:50 PM7/13/19
to sage-packaging
Le sam. 13 juil. 2019 à 19:10, Antonio Rojas <aro...@archlinux.org> a écrit :
>
> El sábado, 13 de julio de 2019 19:33:34 (CEST), Samuel Lelièvre escribió:
> > For reference, this was posted both to sage-devel and sage-packaging,
> > and the discussion is happening in two threads:
> >
> > https://groups.google.com/d/topic/sage-devel/9zRrmIQzKfI/discussion
> > https://groups.google.com/d/topic/sage-packaging/i9VosTO9-cM/discussion
>
> Sorry about that, I meant to cross-post since this topic concerns both
> lists, but the sage-devel one got rejected so I reposted.

No worries. One way to deal with a discussion that can be of interest
in two lists is to start it in one list and to advertise it in the other one
so interested people are informed and can join the discussion there.

> > One thing we could do for a start, given that for now we build
> > both Python 2 and Python 3 in any case, would be to transition
> > the Jupyter part of Sage-the-distribution to be python3-based,
> > allowing us to upgrade all the Jupyter stack to current versions.
> >
> > I don't know if there are any obstacles to that.
>
> That is certainly possible and we've actually been doing that for years in
> Arch with just a simple patch to bin/sage-notebook [1]. However, latest
> jupyter stack does probably require a never ipython than the one shipped by
> Sage, which brings us back to the question of whether it is possible to
> provide different versions for py2/py3.

We build two versions of Python, we might build two versions of IPython
until we drop Python 2... or build a different version of IPython and notebook
etc depending on the Python version.

Antonio Rojas

unread,
Jul 13, 2019, 2:58:25 PM7/13/19
to sage-pa...@googlegroups.com
El sábado, 13 de julio de 2019 20:45:38 (CEST), Samuel Lelièvre escribió:
> We build two versions of Python, we might build two versions of IPython
> until we drop Python 2... or build a different version of
> IPython and notebook
> etc depending on the Python version.

That was exactly the point of my post :) I've opened Trac#28190 for this.
Reply all
Reply to author
Forward
0 new messages