New Python version requirement for Sage?

190 views
Skip to first unread message

Volker Braun

unread,
May 27, 2020, 4:08:18 PM5/27/20
to sage-devel
Which python versions do we want to be compatible with now? Please separate 


A) Supported Python versions for building Sage

Note that I'm already seeing f-strings in #29547 so unless a policy is formulated real soon the de-facto answer is going to be Python 3.6+


B) Supported Python versions for running Sage

The default answer for B) is whatever is in build/pkgs/python3/package-version.txt, of course

Dima Pasechnik

unread,
May 27, 2020, 4:49:59 PM5/27/20
to sage-devel
On Wed, May 27, 2020 at 9:08 PM Volker Braun <vbrau...@gmail.com> wrote:
>
> Which python versions do we want to be compatible with now? Please separate
>
>
> A) Supported Python versions for building Sage
>
> Note that I'm already seeing f-strings in #29547 so unless a policy is formulated real soon the de-facto answer is going to be Python 3.6+

yes, this makes sense.

>
>
> B) Supported Python versions for running Sage
>
> The default answer for B) is whatever is in build/pkgs/python3/package-version.txt, of course

I think it's 3.7.x, for x>2.

>
> --
> 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/94cfccfd-aba2-467e-adbf-646e0889fa87%40googlegroups.com.

François Bissey

unread,
May 27, 2020, 5:09:29 PM5/27/20
to sage-...@googlegroups.com
Sage was building with py 3.6 but no python 3 lower than that a few month ago.
I don’t know if it still builds with 3.6.
The officially supported python that pass the doctest suite is python 3.7.
3.6 would spout a number of broken doctests (but mostly run as far as I could tell).
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/CAAWYfq0JfORf8SW%3Dad9EMcjsM0Nfc7QpdiYOouv4M_cB4GXqNg%40mail.gmail.com.

Matthias Koeppe

unread,
May 27, 2020, 6:58:28 PM5/27/20
to sage-devel
Actually, more precisely one needs to distinguish 

A. sage-system-python
(see build/bin/sage-system-python and build/tox.ini)
This is a minimal build requirement. All Python versions (2.x, 3.x) listed in build/tox.ini are supposed to be supported, though I am not sure if some of the oldest ones have seen much testing.

B. the python3 accepted by python3/spkg-configure.m4 for using for venv.

There is nothing wrong with an spkg that declares python3 as a build dependency and then uses sage-python23 (or just "python3" now...) at build time. This is, after all, the same python that we use for "pip install".

I haven't looked at the specific ticket.


Samuel Lelievre

unread,
May 27, 2020, 8:03:37 PM5/27/20
to sage-devel
I wish Sage can be made to run with any Python >= 3.6.

See this ticket:

- Support minimal system Python version 3.6

I love f-strings and that's a good reason to drop support
for any Python < 3.6.

By the way, is there any way, in Python < 3.6,
to import f-strings from future?

Michael Orlitzky

unread,
May 27, 2020, 8:08:41 PM5/27/20
to sage-...@googlegroups.com
On 5/27/20 4:08 PM, Volker Braun wrote:
> Which python versions do we want to be compatible with now? Please separate 
>
>
> A)Supported Python versions for building Sage
>
> Note that I'm already seeing f-strings in #29547 so unless a policy is
> formulated real soon the de-facto answer is going to be Python 3.6+

This is OK, see below.


> B) Supported Python versions for running Sage
>
> The default answer for B) is whatever is
> in build/pkgs/python3/package-version.txt, of course

I think we should make the two agree, to avoid pointless complexity. We
should base this (ongoing) decision off of (a) what is supported by
python upstream and (b) what is supported by the distributions that
consistently package and contribute to sage.

A rough list of the distributions that we should be nice to is,

$ find ./build/pkgs/ -path '*/distros/*.txt' -exec basename '{}' \; \
| sort -u
alpine.txt
arch.txt
centos.txt
conda.txt
cpan.txt
cygwin.txt
debian.txt
fedora.txt
freebsd.txt
gentoo.txt
homebrew.txt
nix.txt
opensuse.txt
slackware.txt

And the upstream list is at,

https://devguide.python.org/#branchstatus

A policy like "we support the latest security release branch, and all
bugfix release branches" looks like it will do the trick presently.
(Ignoring the intermediate bugfix branches won't be much easier, since
the newest security release lacks all of the same features.)

John H Palmieri

unread,
May 27, 2020, 11:11:45 PM5/27/20
to sage-devel
The particular ticket in question deals with matplotlib, which has Python as a dependency, so I think we can safely build with "Sage's Python 3", which should be at least 3.6. If we can accommodate older version of Python for the rest of the Sage build — and I think we can, given the current state of affairs — then I don't see why we shouldn't. If it becomes a true annoyance to deal with older Pythons, then we dump support for them, but I don't think we need to hurry to do that.

Matthias Koeppe

unread,
May 27, 2020, 11:37:59 PM5/27/20
to sage-devel
On Wednesday, May 27, 2020 at 3:58:28 PM UTC-7, Matthias Koeppe wrote:
On Wednesday, May 27, 2020 at 1:08:18 PM UTC-7, Volker Braun wrote:
Which python versions do we want to be compatible with now? 

one needs to distinguish 

A. sage-system-python
(see build/bin/sage-system-python and build/tox.ini)
This is a minimal build requirement. All Python versions (2.x, 3.x) listed in build/tox.ini are supposed to be supported, though I am not sure if some of the oldest ones have seen much testing.

B. the python3 accepted by python3/spkg-configure.m4 for using for venv.

There is nothing wrong with an spkg that declares python3 as a build dependency and then uses sage-python23 (or just "python3" now...) at build time. This is, after all, the same python that we use for "pip install".


To add on to this, I have also clarified the description of ticket https://trac.sagemath.org/ticket/29669 (Remove Python 2 support from the build system and CI scripts) that it does NOT affect sage-system-python at all.
 

Matthias Koeppe

unread,
May 28, 2020, 2:03:43 AM5/28/20
to sage-devel
On Wednesday, May 27, 2020 at 5:03:37 PM UTC-7, Samuel Lelievre wrote:
I wish Sage can be made to run with any Python >= 3.6.

See this ticket:

- Support minimal system Python version 3.6

Right now we only accept Python 3.7.x as the python for the venv. 
The above ticket which (re-)adds Python 3.6 support looks OK.
But I think it's best to evaluate the situation together with the 3.8 upgrade ticket (https://trac.sagemath.org/ticket/27754).


I love f-strings and that's a good reason to drop support
for any Python < 3.6.

By the way, is there any way, in Python < 3.6,
to import f-strings from future?

Apparently no, according to https://www.reddit.com/r/Python/comments/5xswh9/can_you_import_fstrings_in_python_35/ , but as usual there are some hacks that do it nevertheless https://pypi.org/project/future-fstrings/ . Best to ignore, I'd say.


kcrisman

unread,
May 28, 2020, 8:49:36 AM5/28/20
to sage-devel
Given that I have even recently received emails from people thanking me for making binaries available for quite old Mac versions with only Python 2 available, it would be good to continue (for now) to only require relatively low versions of Python (2.6+ or something?) for *building*, just as the gcc one has doesn't have to be bleeding edge as long as it can build Sage's gcc.  Non-developers are inherently conservative when it comes to upgrading equipment - especially if they have to pay for it themselves, which many do outside the R1 world.

As for the *running* Python, as long as it isn't so new that it misses the point of the recent hard work of getting as many system packages to be used as possible, then it seems not so relevant.

E. Madison Bray

unread,
May 28, 2020, 10:18:53 AM5/28/20
to sage-devel
I was going to point out the same ticket. I don't have strong
feelings about 3.6 vs 3.7 although the motivation was that the default
Python 3 on some reasonably recent distros is still 3.6, and as I
tried to demonstrate in that ticket, supporting 3.6 required only a
few small changes (modulo needing rebase, and having to test again
since that ticket is quite old now).

Volker Braun

unread,
May 28, 2020, 3:15:33 PM5/28/20
to sage-devel
Another datapoint is that the kucalc buildbot runs on Ubuntu 16.04 LTS which has Python 3.5.2

Matthias Koeppe

unread,
May 28, 2020, 3:43:16 PM5/28/20
to sage-devel
On Thursday, May 28, 2020 at 12:15:33 PM UTC-7, Volker Braun wrote:
Another datapoint is that the kucalc buildbot runs on Ubuntu 16.04 LTS which has Python 3.5.2

That's fine. 

Matthias Koeppe

unread,
May 28, 2020, 7:22:54 PM5/28/20
to sage-devel
On Thursday, May 28, 2020 at 12:15:33 PM UTC-7, Volker Braun wrote:
Another datapoint is that the kucalc buildbot runs on Ubuntu 16.04 LTS which has Python 3.5.2

I see you opened a ticket for a https://trac.sagemath.org/ticket/29753 

It would be good if you could provide substantially more information about that build.


Jonathan Kliem

unread,
Jun 1, 2020, 5:08:36 PM6/1/20
to sage-devel
At the moment we are guessing that kucalc buildbot runs with ./configure --with-python=2, because this will lead to exactly this error message (and it really is the only way that this error message makes sense, because this module is present in python 3.5.2 and the import error doesn't make any sense).

Can someone verify/change that or contact someone who will do so?

Volker Braun

unread,
Jun 2, 2020, 9:46:37 AM6/2/20
to sage-devel
Thats true, I'll fix it
Reply all
Reply to author
Forward
0 new messages