sagemath/sage

For Sage 9.2: Remove Python 2 support from the build system and CI scripts

mkoeppe opened this issue · 17 comments

The ticket makes it an error (with a clear message) when ./configure --with-python=2 is invoked.

checking Python version to install... configure: error: the only allowed value for --with-python is 3.  Support for Python 2 has been removed in Sage 9.2.

The ticket keeps variables such as SAGE_PYTHON_VERSION and SAGE_PYTHON3 unchanged, for compatibility.

Also, to clarify in light of the discussion in https://groups.google.com/d/msg/sage-devel/fgsSsJmVVXo/ZIcJq9x3AAAJ, this ticket does not affect which versions of Python are sufficient as sage-system-python (this is still all versions listed in build/tox.ini, which includes various 2.x and 3.x).

Part of meta-ticket #29141.

Depends on #29633

CC: @dimpase @orlitzky @embray @fchapoton @jhpalmieri @vbraun

Component: build

Author: Matthias Koeppe

Branch/Commit: ff41817

Reviewer: Michael Orlitzky

Issue created by migration from https://trac.sagemath.org/ticket/29669

Dependencies: #29633

Branch pushed to git repo; I updated commit sha1. New commits:

96a5e76Remove python2 from tox and [GitHub](../wiki/GitHub) CI scripts

Author: Matthias Koeppe

Description changed:

--- 
+++ 
@@ -1 +1,8 @@
+The ticket makes it an error (with a clear message) when `./configure --with-python=2` is invoked.
 
+```
+checking Python version to install... configure: error: the only allowed value for --with-python is 3.  Support for Python 2 has been removed in Sage 9.2.
+```
+
+The ticket keeps variables such as `SAGE_PYTHON_VERSION` and `SAGE_PYTHON3` unchanged, for compatibility.
+

Reviewer: Michael Orlitzky

comment:7

This was never quite right,

case "$with_python" in
     3*) SAGE_PYTHON_VERSION=3;;

because it accepts --with-python=3.9 and ignores everything after the 3 (it should throw an error in my opinion). Not a big deal now since it will be deleted soon.

There's a lot of other python-2.x stuff to be removed in the build system, scripts, docs, and SPKGs, but I think you are aware of that and plan to deal with it later? If so this is fine as a first step.

comment:8

Replying to @orlitzky:

This was never quite right,

case "$with_python" in
     3*) SAGE_PYTHON_VERSION=3;;

because it accepts --with-python=3.9 and ignores everything after the 3 (it should throw an error in my opinion).

Good point. Let me make this a warning actually.

Changed commit from 96a5e76 to ff41817

Branch pushed to git repo; I updated commit sha1 and set ticket back to needs_review. New commits:

ea7df3econfigure.ac: Remove message 'Checking for Python version to install...'
ff41817configure.ac: Warn on 'configure --with-python=3.x'
comment:10

Replying to @orlitzky:

There's a lot of other python-2.x stuff to be removed in the build system, scripts, docs, and SPKGs, but I think you are aware of that and plan to deal with it later? If so this is fine as a first step.

Yes, there's a lot to be done, and there is a meta-ticket for that: #29141.

Description changed:

--- 
+++ 
@@ -6,3 +6,4 @@
 
 The ticket keeps variables such as `SAGE_PYTHON_VERSION` and `SAGE_PYTHON3` unchanged, for compatibility.
 
+Part of meta-ticket #29141.
comment:13

Thanks!

Description changed:

--- 
+++ 
@@ -6,4 +6,6 @@
 
 The ticket keeps variables such as `SAGE_PYTHON_VERSION` and `SAGE_PYTHON3` unchanged, for compatibility.
 
+Also, to clarify in light of the discussion in https://groups.google.com/d/msg/sage-devel/fgsSsJmVVXo/ZIcJq9x3AAAJ, this ticket does not affect which versions of Python are sufficient as `sage-system-python` (this is still all versions listed in `build/tox.ini`, which includes various 2.x and 4.x).
+
 Part of meta-ticket #29141.

Description changed:

--- 
+++ 
@@ -6,6 +6,6 @@
 
 The ticket keeps variables such as `SAGE_PYTHON_VERSION` and `SAGE_PYTHON3` unchanged, for compatibility.
 
-Also, to clarify in light of the discussion in https://groups.google.com/d/msg/sage-devel/fgsSsJmVVXo/ZIcJq9x3AAAJ, this ticket does not affect which versions of Python are sufficient as `sage-system-python` (this is still all versions listed in `build/tox.ini`, which includes various 2.x and 4.x).
+Also, to clarify in light of the discussion in https://groups.google.com/d/msg/sage-devel/fgsSsJmVVXo/ZIcJq9x3AAAJ, this ticket does not affect which versions of Python are sufficient as `sage-system-python` (this is still all versions listed in `build/tox.ini`, which includes various 2.x and 3.x).
 
 Part of meta-ticket #29141.