sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.33k stars 453 forks source link

Experimental support for Python 3.10 in Sage 9.5 #30766

Closed slel closed 2 years ago

slel commented 3 years ago

This is to support Python 3.10, which was released on 2021-10-04. https://docs.python.org/3.10/whatsnew/changelog.html#changelog

Thanks to the following tickets, Sage is mostly ready for Python 3.10 in addition to 3.9, 3.8, 3.7.

In this ticket, we enable use of system Python 3.10 but issue a warning regarding its experimental status for Sage.

The ticket does not include the upgrade of the python3 SPKG to Python 3.10. Many systems already ship Python 3.10. To test, thanks to https://wiki.sagemath.org/ReleaseTours/sage-9.5#Separate_virtual_environment_for_Python_packages, a full rebuild of the Sage distribution is not necessary - only the Python packages will be built from scratch in a separate venv.

Related:

Depends on #33013 Depends on #32930 Depends on #33040

CC: @mkoeppe @slel @kiwifb @tornaria @antonio-rojas

Component: packages: standard

Keywords: upgrade, python

Author: Matthias Koeppe, Gonzalo Tornaría

Branch: df9f1d4

Reviewer: Antonio Rojas, Matthias Koeppe

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

slel commented 3 years ago

Changed keywords from none to upgrade, python

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -1 +1,15 @@
+This is to support Python 3.10.
+Python 3.10.0 expected release: 2021-10-04.

+This ticket is for the patches necessary to support
+Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.
+
+It does not include the actual upgrade to Python 3.10.
+To test, see #30767.
+
+Related:
+
+- [PEP 619 -- Python 3.10 Release Schedule](https://www.python.org/dev/peps/pep-0619/)
+- #30184: Support Python 3.9
+- #30384: Adopt the “time window-based” policy for support of Python versions from NEP 29
+
slel commented 3 years ago

Dependencies: #30768

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -10,6 +10,8 @@
 Related:

 - [PEP 619 -- Python 3.10 Release Schedule](https://www.python.org/dev/peps/pep-0619/)
+- [What's new in Python 3.10](https://docs.python.org/3.10/whatsnew/3.10.html)
+- #30767: Test ticket: Python 3.10 development releases
 - #30184: Support Python 3.9
 - #30384: Adopt the “time window-based” policy for support of Python versions from NEP 29
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -3,6 +3,8 @@

 This ticket is for the patches necessary to support
 Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.
+
+- needs Cython 0.29.23 (#31445)

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

Changed dependencies from #30768 to #30768, #31445

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -5,6 +5,7 @@
 Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.

 - needs Cython 0.29.23 (#31445)
+- `gmpy2` fails to build with Python 3.10: error: ‘_PyHASH_NAN’ undeclared - https://bugzilla.redhat.com/show_bug.cgi?id=1959010

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

Branch: u/mkoeppe/support_python_3_10

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -5,7 +5,7 @@
 Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.

 - needs Cython 0.29.23 (#31445)
-- `gmpy2` fails to build with Python 3.10: error: ‘_PyHASH_NAN’ undeclared - https://bugzilla.redhat.com/show_bug.cgi?id=1959010
+- `gmpy2` fails to build with Python 3.10: error: ‘_PyHASH_NAN’ undeclared - https://bugzilla.redhat.com/show_bug.cgi?id=1959010 ... patches at https://copr-dist-git.fedorainfracloud.org/cgit/@python/python3.10/python-gmpy2.git/tree/

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

New commits:

6ca849fbuild/pkgs/cython: Update to 0.29.23
4e4fd58Merge #31445
mkoeppe commented 3 years ago

Commit: 4e4fd58

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -5,7 +5,7 @@
 Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.

 - needs Cython 0.29.23 (#31445)
-- `gmpy2` fails to build with Python 3.10: error: ‘_PyHASH_NAN’ undeclared - https://bugzilla.redhat.com/show_bug.cgi?id=1959010 ... patches at https://copr-dist-git.fedorainfracloud.org/cgit/@python/python3.10/python-gmpy2.git/tree/
+- #31855 Patch/upgrade `gmpy2` to add python 3.10 support

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445 to #30768, #31445, #31855

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 4e4fd58 to 2d7d715

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

8cd9ecebuild/pkgs/gmpy2/patches: Add patches from Fedora @python/python3.10
2d7d715Merge #31855
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

3321a59build/pkgs/python3/spkg-configure.m4: Accept system python 3.10.x
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 2d7d715 to 3321a59

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -6,6 +6,7 @@

 - needs Cython 0.29.23 (#31445)
 - #31855 Patch/upgrade `gmpy2` to add python 3.10 support
+- pyzmq-19.0.2 `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99`

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -6,7 +6,7 @@

 - needs Cython 0.29.23 (#31445)
 - #31855 Patch/upgrade `gmpy2` to add python 3.10 support
-- pyzmq-19.0.2 `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99`
+- #31856 Upgrade pyzmq to fix `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99` with pyzmq-19.0.2 

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445, #31855 to #30768, #31445, #31855, #31856

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 3321a59 to 65355f9

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

2a7d940build/pkgs/pyzmq: Update to 22.0.3
65355f9Merge #31856
mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445, #31855, #31856 to #30768, #31445, #31855, #31856, #31008

mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -7,6 +7,8 @@
 - needs Cython 0.29.23 (#31445)
 - #31855 Patch/upgrade `gmpy2` to add python 3.10 support
 - #31856 Upgrade pyzmq to fix `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99` with pyzmq-19.0.2 
+- `babel`
+- `numpy`

 It does not include the actual upgrade to Python 3.10.
 To test, see #30767.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 65355f9 to a661b6a

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

f720722build/pkgs/sagelib/src/tox.ini: Add factor nobuildisolation
c451b31src/setup.cfg.m4 (install_requires): Add sage_conf
6700223Merge tag '9.3.rc0' into t/30913/sagelib__add_setup_cfg__install_requires_
04da2c6build/pkgs/ipywidgets: Patch out declaring install-requires of nbformat and jupyterlab-widgets
815c944Merge #30913
b06731cRemove Python 3.6 support from metadata and documentation
57338c1Update numpy to 1.20.2, scipy to 1.6.2, networkx to 2.5.1
ac49be0build/pkgs/numpy: Update to 1.20.3
02f6848build/pkgs/scipy: Update to 1.6.3
a661b6aMerge #31008
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -6,8 +6,7 @@

 - needs Cython 0.29.23 (#31445)
 - #31855 Patch/upgrade `gmpy2` to add python 3.10 support
-- #31856 Upgrade pyzmq to fix `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99` with pyzmq-19.0.2 
-- `babel`
+- #31856 Upgrade `pyzmq`, `babel` - to fix `error: implicit declaration of function 'PyObject_AsWriteBuffer' is invalid in C99` with pyzmq-19.0.2 
 - `numpy`

 It does not include the actual upgrade to Python 3.10.
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from a661b6a to 13121d7

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

a64d920build/pkgs/babel: Update to 2.9.1, add upstream_url
13121d7Merge #31856
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -2,7 +2,7 @@
 Python 3.10.0 expected release: 2021-10-04.

 This ticket is for the patches necessary to support
-Python 3.10 in addition to 3.9, 3.8, 3.7, 3.6.
+Python 3.10 in addition to 3.9, 3.8, 3.7.

 - needs Cython 0.29.23 (#31445)
 - #31855 Patch/upgrade `gmpy2` to add python 3.10 support
mkoeppe commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,5 +1,6 @@
 This is to support Python 3.10.
-Python 3.10.0 expected release: 2021-10-04.
+- Python 3.10.0rc1 released 2021-08-11.
+- Python 3.10.0 expected release: 2021-10-04.

 This ticket is for the patches necessary to support
 Python 3.10 in addition to 3.9, 3.8, 3.7.
mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445, #31855, #31856, #31008 to #30768, #31445, #31855

mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445, #31855 to #30768, #31445, #31855, #32105

mkoeppe commented 3 years ago

Changed dependencies from #30768, #31445, #31855, #32105 to #32488, #30768, #31445, #31855, #32105

mkoeppe commented 3 years ago

Changed dependencies from #32488, #30768, #31445, #31855, #32105 to #32488, #30768, #31855, #32105

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

bab5de7build/pkgs/python3/spkg-configure.m4: Accept system python 3.10.x
033366cbuild/pkgs/numpy: Update to 1.21.1
c6a3a39build/pkgs/numpy: Update to 1.21.2
d0ca161Merge #32488
eced0deMerge #32372
edc435ere-activate abc warnings
f0cd750Merge #30768
41f7f4ebuild/pkgs/gmpy2: Update to 2.1.0rc1
731ccf1Merge #31855
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 13121d7 to 731ccf1

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from 731ccf1 to 2749e67

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

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

2749e67pkgs/sage-setup/setup.cfg: Allow Python 3.10
mkoeppe commented 3 years ago
comment:29
  [scipy-1.6.3]   ERROR: Package 'scipy' requires a different Python: 3.10.0 not in '<3.10,>=3.7'
mkoeppe commented 3 years ago
comment:30
  [pplpy-0.8.6]   Copying package files from temporary location /Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/var/tmp/sage/build/pplpy-0.8.6/inst to /Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1
  [pplpy-0.8.6]   Running post-install script for pplpy-0.8.6.
  [pplpy-0.8.6]   Traceback (most recent call last):
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/bin/sphinx-build", line 5, in <module>
  [pplpy-0.8.6]       from sphinx.cmd.build import main
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/site-packages/sphinx/cmd/build.py", line 25, in <module>
  [pplpy-0.8.6]       from sphinx.application import Sphinx
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/site-packages/sphinx/application.py", line 31, in <module>
  [pplpy-0.8.6]       from sphinx.config import Config
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/site-packages/sphinx/config.py", line 21, in <module>
  [pplpy-0.8.6]       from sphinx.util import logging
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/site-packages/sphinx/util/__init__.py", line 41, in <module>
  [pplpy-0.8.6]       from sphinx.util.typing import PathMatcher
  [pplpy-0.8.6]     File "/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/site-packages/sphinx/util/typing.py", line 37, in <module>
  [pplpy-0.8.6]       from types import Union as types_Union
  [pplpy-0.8.6]   ImportError: cannot import name 'Union' from 'types' (/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/types.py)
  [pplpy-0.8.6]   make[5]: *** [html] Error 1
  [pplpy-0.8.6]   cp: build/html/*: No such file or directory
mkoeppe commented 3 years ago

Changed dependencies from #32488, #30768, #31855, #32105 to #32488, #30768, #31855, #32105, #32518

mkoeppe commented 3 years ago
comment:32

Replying to @mkoeppe:

  [scipy-1.6.3]   ERROR: Package 'scipy' requires a different Python: 3.10.0 not in '<3.10,>=3.7'

It does not look like a 1.6.4 is in preparation (https://github.com/scipy/scipy/commits/maintenance/1.6.x)... so I guess we'll have to do the update to 1.7.x in #32105

mkoeppe commented 3 years ago
comment:33

Workaround for the scipy install problem: --ignore-requires-python (new commits in #32492)

mkoeppe commented 3 years ago
comment:34

Replying to @mkoeppe:

  [pplpy-0.8.6]       from types import Union as types_Union
  [pplpy-0.8.6]   ImportError: cannot import name 'Union' from 'types' (/Users/mkoeppe/s/sage/sage-rebasing/local/var/lib/sage/venv-python3.10.0rc1/lib/python3.10/types.py)
  [pplpy-0.8.6]   make[5]: *** [html] Error 1
  [pplpy-0.8.6]   cp: build/html/*: No such file or directory

Fixed by the sphinx upgrade in #32518

mkoeppe commented 3 years ago

Changed dependencies from #32488, #30768, #31855, #32105, #32518 to #32488, #30768, #31855, #32492, #32518

mkoeppe commented 3 years ago
comment:36

cvxopt build fails, needs https://github.com/cvxopt/cvxopt/pull/190

mkoeppe commented 3 years ago

Changed dependencies from #32488, #30768, #31855, #32492, #32518 to #32488, #30768, #31855, #32492, #32518, #32519

mkoeppe commented 3 years ago
comment:38

Replying to @mkoeppe:

cvxopt build fails, needs https://github.com/cvxopt/cvxopt/pull/190

That's #32519

mkoeppe commented 3 years ago

Reviewer: https://github.com/mkoeppe/sage/actions/runs/1239984523