Skip to content

Commit

Permalink
Trac #33842: Upgrade python to 3.11
Browse files Browse the repository at this point in the history
Issues
- sagemath/memory_allocator#6
- sagemath/cypari2#114
- fplll/fpylll#230

URL: https://trac.sagemath.org/33842
Reported by: mkoeppe
Ticket author(s): Gonzalo Tornaría, Matthias Koeppe, Andrey Belgorodski
Reviewer(s): Matthias Koeppe, Dima Pasechnik
  • Loading branch information
Release Manager committed Jan 1, 2023
2 parents 75bedf9 + ac0105e commit 08aa2f8
Show file tree
Hide file tree
Showing 43 changed files with 617 additions and 281 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ on:
"centos-stream-9-python3.9",
"gentoo-python3.9",
"gentoo-python3.10",
"gentoo-python3.11",
"archlinux-latest",
"opensuse-15.3-gcc_11-python3.9",
"opensuse-15.4-gcc_11-python3.10",
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/babel/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Babel-VERSION.tar.gz
sha1=1ce15f82eba5184cabe6ac1491cb58262e27adfd
md5=7166099733d78aa857d74fa50d8ff58c
cksum=1695340328
sha1=75baeb68d7481a67ba203191aa460c56b0221fda
md5=9ee7784fd452d456206ecd3a12694010
cksum=227595701
upstream_url=https://pypi.io/packages/source/b/babel/Babel-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/babel/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.1
2.11.0
2 changes: 1 addition & 1 deletion build/pkgs/cython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.29.32.p1
0.29.32.p2
11 changes: 9 additions & 2 deletions build/pkgs/cython/patches/trashcan.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
See https://github.com/cython/cython/pull/2842

and https://github.com/cython/cython/pull/4475

commit c47c4ef735c4b7f1863b21bbe6f112b06c4aad05
Author: Jeroen Demeyer <J.Demeyer@UGent.be>
Date: Thu Feb 14 10:02:41 2019 +0100
Expand Down Expand Up @@ -128,7 +130,7 @@ diff --git a/Cython/Utility/ExtensionTypes.c b/Cython/Utility/ExtensionTypes.c
index 50d0e21..ca2adbe 100644
--- a/Cython/Utility/ExtensionTypes.c
+++ b/Cython/Utility/ExtensionTypes.c
@@ -74,6 +74,49 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
@@ -74,6 +74,54 @@ static int __Pyx_PyType_Ready(PyTypeObject *t) {
return r;
}

Expand All @@ -140,7 +142,12 @@ index 50d0e21..ca2adbe 100644
+
+// This requires CPython version >= 2.7.4
+// (or >= 3.2.4 but we don't support such old Python 3 versions anyway)
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070400
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03080000
+// https://github.com/python/cpython/pull/11841 merged so Cython reimplementation
+// is no longer necessary
+#define __Pyx_TRASHCAN_BEGIN Py_TRASHCAN_BEGIN
+#define __Pyx_TRASHCAN_END Py_TRASHCAN_END
+#elif CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070400
+#define __Pyx_TRASHCAN_BEGIN_CONDITION(op, cond) \
+ do { \
+ PyThreadState *_tstate = NULL; \
Expand Down
6 changes: 3 additions & 3 deletions build/pkgs/kiwisolver/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=kiwisolver-VERSION.tar.gz
sha1=61811685031328a8a2a77f45593d8238432ce35e
md5=98d746f558685c6b6658cefc39be14df
cksum=1915059157
sha1=157556602639eb6cc8546463f56feaa9023e3bcd
md5=73a4e57c33ded99dbe9a5cabca5be04b
cksum=3382585353
upstream_url=https://files.pythonhosted.org/packages/source/k/kiwisolver/kiwisolver-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/kiwisolver/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.2
1.4.3
6 changes: 3 additions & 3 deletions build/pkgs/python3/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Python-VERSION.tar.xz
sha1=49ca7a5be7f13375e863442fbd9ead893ace3238
md5=e92356b012ed4d0e09675131d39b1bde
cksum=3450973870
sha1=89ee31611b73dc0c32c178d15aa208734b462c5a
md5=4efe92adf28875c77d3b9b2e8d3bc44a
cksum=2916176597
upstream_url=https://www.python.org/ftp/python/VERSION/Python-VERSION.tar.xz
2 changes: 1 addition & 1 deletion build/pkgs/python3/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.8
3.11.1
36 changes: 0 additions & 36 deletions build/pkgs/python3/patches/cygwin-socket-tcpnodelay-21649.patch

This file was deleted.

4 changes: 2 additions & 2 deletions build/pkgs/python3/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SAGE_SPKG_CONFIGURE([python3], [
m4_pushdef([MIN_VERSION], [3.8.0])
m4_pushdef([MIN_NONDEPRECATED_VERSION], [3.8.0])
m4_pushdef([LT_STABLE_VERSION], [3.11.0])
m4_pushdef([LT_VERSION], [3.11.0])
m4_pushdef([LT_STABLE_VERSION], [3.12.0])
m4_pushdef([LT_VERSION], [3.12.0])
AC_ARG_WITH([python],
[AS_HELP_STRING([--with-python=PYTHON3],
[Python 3 executable to use for the Sage venv; default: python3])])
Expand Down
1 change: 1 addition & 0 deletions pkgs/sage-docbuild/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

Expand Down
3 changes: 2 additions & 1 deletion pkgs/sage-setup/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

Expand All @@ -31,7 +32,7 @@ packages =
sage_setup.autogen.interpreters.specs
sage_setup.command

python_requires = >=3.8, <3.11
python_requires = >=3.8, <3.12

install_requires =
pkgconfig
Expand Down
3 changes: 2 additions & 1 deletion pkgs/sagemath-categories/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.8, <3.11
python_requires = >=3.8, <3.12
install_requires =
esyscmd(`sage-get-system-packages install-requires \
sagemath_objects \
Expand Down
5 changes: 3 additions & 2 deletions pkgs/sagemath-environment/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ classifiers =
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.7, <3.11
python_requires = >=3.8, <3.12
install_requires =
esyscmd(`sage-get-system-packages install-requires \
| sed "2,\$s/^/ /;"')dnl
Expand Down
3 changes: 2 additions & 1 deletion pkgs/sagemath-objects/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.8, <3.11
python_requires = >=3.8, <3.12
install_requires =
esyscmd(`sage-get-system-packages install-requires \
gmpy2 \
Expand Down
3 changes: 2 additions & 1 deletion pkgs/sagemath-repl/setup.cfg.m4
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@ classifiers =
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: Implementation :: CPython
Topic :: Scientific/Engineering :: Mathematics

[options]
python_requires = >=3.8, <3.11
python_requires = >=3.8, <3.12
install_requires =
esyscmd(`sage-get-system-packages install-requires \
sagemath_objects \
Expand Down
26 changes: 26 additions & 0 deletions src/sage/all.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,32 @@
message='The distutils(.sysconfig module| package) is deprecated',
module='Cython|distutils|numpy|sage.env|sage.features')

# triggered by cython 0.29.32
warnings.filterwarnings('ignore', category=DeprecationWarning,
message="'cgi' is deprecated and slated for removal in Python 3.13",
module='Cython')

# triggered by pyparsing 2.4.7
warnings.filterwarnings('ignore', category=DeprecationWarning,
message="module 'sre_constants' is deprecated",
module='pyparsing')

# importlib.resources.path and ...read_binary are deprecated in python 3.11,
# but the replacement importlib.resources.files needs python 3.9
warnings.filterwarnings('ignore', category=DeprecationWarning,
message=r'(path|read_binary) is deprecated\. Use files\(\) instead\.',
module='sage.repl.rich_output.output_(graphics|graphics3d|video)')

# triggered by sphinx
warnings.filterwarnings('ignore', category=DeprecationWarning,
message="'imghdr' is deprecated and slated for removal in Python 3.13",
module='sphinx.util.images')

# triggered by docutils 0.19 on Python 3.11
warnings.filterwarnings('ignore', category=DeprecationWarning,
message=r"Use setlocale\(\), getencoding\(\) and getlocale\(\) instead",
module='docutils.io')

################ end setup warnings ###############################


Expand Down
Loading

0 comments on commit 08aa2f8

Please sign in to comment.