About python2 vs python3 package versions

146 views
Skip to first unread message

Antonio Rojas

unread,
Jul 13, 2019, 5:56:46 AM7/13/19
to 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 

Vincent Delecroix

unread,
Jul 13, 2019, 6:19:22 AM7/13/19
to sage-...@googlegroups.com
Dear Antonio,

First of all: thank for your work for Sage on archlinux! I like
very much to have SageMath together with my system Python environment.

Many developers are actually using Sage with Python3 (as I do). Also
a Python3 version of Sage is available on conda-forge. There was also
some effort towards a docker image at Cernay few weeks ago. I don't
think that we are that far from a switch.

Any patch is more than welcome.

For now, we do not have any mechanism for py2/py3 version forks of
packages. By what you said, it seems reasonable to introduce one. At
the level of packages (sage/build/pkgs/) we could for example have
an optional checksums-py2.ini that would be used if present and
Python2 is used. And we keep the checksums.ini for Python3. Please
open a ticket for this. It is definitely reasonable.

Best
Vincent

Dima Pasechnik

unread,
Jul 13, 2019, 6:55:41 AM7/13/19
to sage-devel
I think we as well should build either only Python2 or only Python3,
and do not try to do both in the same build.
(while having both in the same build might be marginally useful, it's
too messy to maintain IMHO)

On Sat, Jul 13, 2019 at 12:19 PM Vincent Delecroix
> --
> 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 post to this group, send email to sage-...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/8d539fa8-15df-76a9-98a7-e1c3ddcaad4e%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.

Samuel Lelièvre

unread,
Jul 13, 2019, 1:33:50 PM7/13/19
to sage-packaging, sage-devel
Sat 2019-07-13 09:54 UTC, Antonio Rojas:
>
> 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?

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:52 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-packaging/CAEcArF1yKOF1LeZHmDKJ9cdeC91DdJvF2M3vidkDEgKBiy84Gw%40mail.gmail.com.

Antonio Rojas

unread,
Aug 31, 2019, 6:38:53 PM8/31/19
to sage-devel


El sábado, 13 de julio de 2019, 19:33:50 (UTC+2), Samuel Lelievre escribió:
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.


Although this doesn't help much to solve the issue I tried to raise up in this thread, I've opened #28438 for this, which is an easy change.
 
Reply all
Reply to author
Forward
0 new messages