diff --git a/build/pkgs/python3/SPKG.rst b/build/pkgs/python3/SPKG.rst index 55757b972e6..b102c79fbbb 100644 --- a/build/pkgs/python3/SPKG.rst +++ b/build/pkgs/python3/SPKG.rst @@ -15,6 +15,9 @@ You can also use ``--with-python=/path/to/python3_binary`` to tell Sage to use a number of Python modules to be available within the Python in question. Currently, as of Sage 10.3, these modules are as follows: ``sqlite3``, ``ctypes``, ``math``, ``hashlib``, ``socket``, ``zlib``, ``ssl``, ``ensurepip``. +For Python >= 3.12, also ``setuptools`` is required; for older Python versions, +``distutils.core`` is required. These modules will be checked for by the ``configure`` +script. Use the ``configure`` option ``--without-system-python3`` if you want Python 3 built from scratch. diff --git a/build/pkgs/python3/checksums.ini b/build/pkgs/python3/checksums.ini index f0f0ce6eb75..73dddf24722 100644 --- a/build/pkgs/python3/checksums.ini +++ b/build/pkgs/python3/checksums.ini @@ -1,4 +1,4 @@ tarball=Python-VERSION.tar.xz -sha1=a368aeed7a3325e47b55168452c356a8eb27ab50 -sha256=9e06008c8901924395bc1da303eac567a729ae012baa182ab39269f650383bb3 +sha1=c221421f3ba734daaf013dbdc7b48aa725cea18e +sha256=f6d419a6d8743ab26700801b4908d26d97e8b986e14f95de31b32de2b0e79554 upstream_url=https://www.python.org/ftp/python/VERSION/Python-VERSION.tar.xz diff --git a/build/pkgs/python3/package-version.txt b/build/pkgs/python3/package-version.txt index b6d8b7612f0..455808f8e19 100644 --- a/build/pkgs/python3/package-version.txt +++ b/build/pkgs/python3/package-version.txt @@ -1 +1 @@ -3.11.8 +3.12.4 diff --git a/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch b/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch deleted file mode 100644 index ec3d84c8499..00000000000 --- a/build/pkgs/python3/patches/0001-bpo-22699-Allow-compiling-on-debian-ubuntu-with-a-di.patch +++ /dev/null @@ -1,64 +0,0 @@ -From aef4a7749dec9ecf942647af39d7a1303c758131 Mon Sep 17 00:00:00 2001 -From: Isuru Fernando -Date: Thu, 16 Sep 2021 15:46:09 -0500 -Subject: [PATCH 08/24] bpo-22699: Allow compiling on debian/ubuntu with a - different compiler - -This PR fixes one issue mentioned in the bpo -https://bugs.python.org/issue22699#msg364685 with a slightly better -patch than given ---- - setup.py | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -diff --git a/setup.py b/setup.py -index 554699608d..d5bbeb90d5 100644 ---- a/setup.py -+++ b/setup.py -@@ -667,9 +667,30 @@ def check_extension_import(self, ext): - def add_multiarch_paths(self): - # Debian/Ubuntu multiarch support. - # https://wiki.ubuntu.com/MultiarchSpec -- 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)) -+ -+ try: -+ if ret_sysroot == 0: -+ with open(tmpfile_sysroot) as fp: -+ sysroot = fp.readline().strip() -+ # if the sysroot is not /, then we are not using -+ # the compiler from debian/ubuntu -+ if sysroot not in ['', '/']: -+ add_dir_to_list(self.compiler.library_dirs, -+ sysroot + '/usr/lib/') -+ add_dir_to_list(self.compiler.include_dirs, -+ 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)) - 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 -@@ -738,7 +738,8 @@ - for env_var, arg_name, dir_list in ( - ('LDFLAGS', '-R', self.compiler.runtime_library_dirs), - ('LDFLAGS', '-L', self.compiler.library_dirs), -- ('CPPFLAGS', '-I', self.compiler.include_dirs)): -+ ('CPPFLAGS', '-I', self.compiler.include_dirs), -+ ('CPPFLAGS', '-isystem', self.compiler.include_dirs)): - env_val = sysconfig.get_config_var(env_var) - if env_val: - parser = argparse.ArgumentParser() --- -2.30.2 - diff --git a/build/pkgs/python3/patches/linux_linking_issue_25229.patch b/build/pkgs/python3/patches/linux_linking_issue_25229.patch deleted file mode 100644 index 43131a27913..00000000000 --- a/build/pkgs/python3/patches/linux_linking_issue_25229.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py ---- a/Lib/distutils/unixccompiler.py 2018-06-27 05:07:35.000000000 +0200 -+++ b/Lib/distutils/unixccompiler.py 2018-06-28 09:32:52.719006731 +0200 -@@ -234,7 +234,7 @@ - return ["-Wl,+s", "-L" + dir] - return ["+s", "-L" + dir] - else: -- if self._is_gcc(compiler): -+ if sys.platform[:5] == "linux" or self._is_gcc(compiler): - # gcc on non-GNU systems does not need -Wl, but can - # use it anyway. Since distutils has always passed in - # -Wl whenever gcc was used in the past it is probably diff --git a/build/pkgs/python3/spkg-configure.m4 b/build/pkgs/python3/spkg-configure.m4 index d67601a98ae..a51e2394e51 100644 --- a/build/pkgs/python3/spkg-configure.m4 +++ b/build/pkgs/python3/spkg-configure.m4 @@ -1,7 +1,7 @@ SAGE_SPKG_CONFIGURE([python3], [ m4_pushdef([MIN_VERSION], [3.9.0]) m4_pushdef([MIN_NONDEPRECATED_VERSION], [3.9.0]) - m4_pushdef([LT_STABLE_VERSION], [3.12.0]) + m4_pushdef([LT_STABLE_VERSION], [3.13.0]) m4_pushdef([LT_VERSION], [3.13.0]) AC_ARG_WITH([python], [AS_HELP_STRING([--with-python=PYTHON3],