Skip to content

Commit

Permalink
Trac #30767: Update Python to 3.10.x
Browse files Browse the repository at this point in the history
Python 3.10 was released 2021-10-04, the current version is 3.10.2,
released 2022-01-14.

Upstream PR:
- python/cpython#30005

To test, use:
{{{
./configure --without-system-python3 --enable-download-from-upstream-url
}}}

Necessary changes to the library should go on #30766 (Support Python
3.10)

Related:

- [https://www.python.org/dev/peps/pep-0619/ PEP 619 -- Python 3.10
Release Schedule]
- [https://docs.python.org/3.10/whatsnew/3.10.html What's new in Python
3.10]
- #30766: Support Python 3.10
- #30589: Test ticket: Python 3.9.0
- #30384: Adopt the “time window-based” policy for support of Python
versions from NEP 29

URL: https://trac.sagemath.org/30767
Reported by: slelievre
Ticket author(s): Matthias Koeppe
Reviewer(s): François Bissey
  • Loading branch information
Release Manager committed Mar 8, 2022
2 parents eb21746 + 95e3784 commit f250edf
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 43 deletions.
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=6274e5631c520d75bf1f0a046640fd3996fe99f0
md5=11d12076311563252a995201248d17e5
cksum=2273440860
sha1=e618946549cca1eb0d6d4cdf516003fec3975003
md5=14e8c22458ed7779a1957b26cde01db9
cksum=1118621485
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.9.9
3.10.2
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,20 @@ patch than given
1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 8fb8ea5c47..783d20bdcd 100644
index 554699608d..d5bbeb90d5 100644
--- a/setup.py
+++ b/setup.py
@@ -663,9 +663,30 @@ def add_multiarch_paths(self):
@@ -667,9 +667,30 @@ def check_extension_import(self, ext):
def add_multiarch_paths(self):
# Debian/Ubuntu multiarch support.
# https://wiki.ubuntu.com/MultiarchSpec
cc = sysconfig.get_config_var('CC')
- tmpfile = os.path.join(self.build_temp, 'multiarch')
if not os.path.exists(self.build_temp):
os.makedirs(self.build_temp)
+
+ tmpfile_sysroot = os.path.join(self.build_temp, 'sysroot')
+ ret_sysroot = run_command(
+ '%s -print-sysroot > %s 2> /dev/null' % (cc, tmpfile_sysroot))
+ '%s -print-sysroot > %s 2> /dev/null' % (CC, tmpfile_sysroot))
+
+ try:
+ if ret_sysroot == 0:
Expand All @@ -35,17 +35,17 @@ index 8fb8ea5c47..783d20bdcd 100644
+ # the compiler from debian/ubuntu
+ if sysroot not in ['', '/']:
+ add_dir_to_list(self.compiler.library_dirs,
+ sysroot + '/usr/lib')
+ sysroot + '/usr/lib/')
+ add_dir_to_list(self.compiler.include_dirs,
+ sysroot + '/usr/include')
+ sysroot + '/usr/include/')
+ return
+ finally:
+ os.unlink(tmpfile_sysroot)
+
+ tmpfile = os.path.join(self.build_temp, 'multiarch')
+
ret = run_command(
'%s -print-multiarch > %s 2> /dev/null' % (cc, tmpfile))
'%s -print-multiarch > %s 2> /dev/null' % (CC, tmpfile))
multiarch_path_component = ''
--- a/setup.py 2021-09-28 23:49:53.193868987 -0700
+++ b/setup.py 2021-09-28 23:50:13.554098642 -0700
Expand Down
31 changes: 0 additions & 31 deletions build/pkgs/python3/patches/cygwin-readline.patch

This file was deleted.

2 changes: 1 addition & 1 deletion build/pkgs/python3/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SAGE_SPKG_CONFIGURE([python3], [
m4_pushdef([MIN_VERSION], [3.7.0])
m4_pushdef([MIN_NONDEPRECATED_VERSION], [3.7.0])
m4_pushdef([LT_STABLE_VERSION], [3.10.0])
m4_pushdef([LT_STABLE_VERSION], [3.11.0])
m4_pushdef([LT_VERSION], [3.11.0])
AC_ARG_WITH([python],
[AS_HELP_STRING([--with-python=PYTHON3],
Expand Down

0 comments on commit f250edf

Please sign in to comment.