Update to Python 3.13.0b1

This commit is contained in:
Karolina Surma 2024-05-09 10:17:01 +02:00 committed by Miro Hrončok
commit 1c24374362
5 changed files with 82 additions and 54 deletions

View file

@ -30,10 +30,10 @@ Co-authored-by: Lumír Balhar <frenzy.madness@gmail.com>
3 files changed, 72 insertions(+), 4 deletions(-)
diff --git a/Lib/site.py b/Lib/site.py
index 162bbec4f8..40c5981e03 100644
index b63447d667..2476b1a484 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -395,8 +395,15 @@ def getsitepackages(prefixes=None):
@@ -404,8 +404,15 @@ def getsitepackages(prefixes=None):
return sitepackages
def addsitepackages(known_paths, prefixes=None):
@ -51,7 +51,7 @@ index 162bbec4f8..40c5981e03 100644
if os.path.isdir(sitedir):
addsitedir(sitedir, known_paths)
diff --git a/Lib/sysconfig/__init__.py b/Lib/sysconfig/__init__.py
index 70bdecf213..5cd75a3b96 100644
index 98a14e5d3a..8369073fee 100644
--- a/Lib/sysconfig/__init__.py
+++ b/Lib/sysconfig/__init__.py
@@ -106,6 +106,12 @@
@ -130,7 +130,7 @@ index 70bdecf213..5cd75a3b96 100644
# On Windows we want to substitute 'lib' for schemes rather
# than the native value (without modifying vars, in case it
diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py
index 61c6a5a425..fd5fbe17ad 100644
index 9233304c6a..4acaad5ed6 100644
--- a/Lib/test/test_sysconfig.py
+++ b/Lib/test/test_sysconfig.py
@@ -121,8 +121,19 @@ def test_get_path(self):
@ -154,7 +154,7 @@ index 61c6a5a425..fd5fbe17ad 100644
os.path.normpath(expected),
)
@@ -357,7 +368,7 @@ def test_get_config_h_filename(self):
@@ -377,7 +388,7 @@ def test_get_config_h_filename(self):
self.assertTrue(os.path.isfile(config_h), config_h)
def test_get_scheme_names(self):
@ -163,7 +163,7 @@ index 61c6a5a425..fd5fbe17ad 100644
if HAS_USER_BASE:
wanted.extend(['nt_user', 'osx_framework_user', 'posix_user'])
self.assertEqual(get_scheme_names(), tuple(sorted(wanted)))
@@ -369,6 +380,8 @@ def test_symlink(self): # Issue 7880
@@ -389,6 +400,8 @@ def test_symlink(self): # Issue 7880
cmd = "-c", "import sysconfig; print(sysconfig.get_platform())"
self.assertEqual(py.call_real(*cmd), py.call_link(*cmd))

View file

@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Wed, 10 Apr 2024 15:35:04 +0200
Subject: [PATCH] 00425: Only check for 'test/wheeldata' when it's actually
used
We build Python in Fedora 39+ with option `--with-wheel-pkg-dir`
pointing to a custom wheel directory and delete the contents of
upstream's `test/wheeldata`. Don't include the directory in the test set
if the wheels are used from a different location.
---
Lib/test/test_tools/test_makefile.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Lib/test/test_tools/test_makefile.py b/Lib/test/test_tools/test_makefile.py
index 29f5c28e33..b0dc56c714 100644
--- a/Lib/test/test_tools/test_makefile.py
+++ b/Lib/test/test_tools/test_makefile.py
@@ -67,6 +67,9 @@ def test_makefile_test_folders(self):
)
used.append(relpath)
+ if sysconfig.get_config_var('WHEEL_PKG_DIR'):
+ test_dirs.remove('test/wheeldata')
+
# Check that there are no extra entries:
unique_test_dirs = set(test_dirs)
self.assertSetEqual(unique_test_dirs, set(used))

View file

@ -0,0 +1,58 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Sam Gross <colesbury@gmail.com>
Date: Thu, 9 May 2024 16:06:20 -0400
Subject: [PATCH] 00428: gh-118846: Fix PGO tests in free-threaded build
Avoid immortalizing objects in tests that verify garbage collection of
classes or modules.
This fixes test_ordered_dict and test_struct.
(cherry picked from commit 1b1db2fd9a531e26b79b34667bccfb938c4d184d)
---
Lib/test/test_ordered_dict.py | 3 ++-
Lib/test/test_struct.py | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_ordered_dict.py b/Lib/test/test_ordered_dict.py
index 4571b23dfe..06a0e81227 100644
--- a/Lib/test/test_ordered_dict.py
+++ b/Lib/test/test_ordered_dict.py
@@ -10,7 +10,7 @@
import weakref
from collections.abc import MutableMapping
from test import mapping_tests, support
-from test.support import import_helper
+from test.support import import_helper, suppress_immortalization
py_coll = import_helper.import_fresh_module('collections',
@@ -667,6 +667,7 @@ def test_dict_update(self):
dict.update(od, [('spam', 1)])
self.assertNotIn('NULL', repr(od))
+ @suppress_immortalization()
def test_reference_loop(self):
# Issue 25935
OrderedDict = self.OrderedDict
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py
index 15f6ee06ff..5508cc3eec 100644
--- a/Lib/test/test_struct.py
+++ b/Lib/test/test_struct.py
@@ -9,7 +9,7 @@
import weakref
from test import support
-from test.support import import_helper
+from test.support import import_helper, suppress_immortalization
from test.support.script_helper import assert_python_ok
ISBIGENDIAN = sys.byteorder == "big"
@@ -674,6 +674,7 @@ def __del__(self):
self.assertIn(b"Exception ignored in:", stderr)
self.assertIn(b"C.__del__", stderr)
+ @suppress_immortalization()
def test__struct_reference_cycle_cleaned_up(self):
# Regression test for python/cpython#94207.

View file

@ -14,10 +14,10 @@ URL: https://www.python.org/
# WARNING When rebasing to a new Python version,
# remember to update the python3-docs package as well
%global general_version %{pybasever}.0
%global prerel a6
%global prerel b1
%global upstream_version %{general_version}%{?prerel}
Version: %{general_version}%{?prerel:~%{prerel}}
Release: 3%{?dist}
Release: 1%{?dist}
License: Python-2.0.1
@ -141,13 +141,7 @@ Provides: bundled(python3dist(packaging)) = 24
# Extra build without GIL, the freethreading PEP 703 provisional way
# (the -freethreading subpackage)
# support for s390x is pending investigation in
# https://github.com/python/cpython/issues/117755
%ifnarch s390x
%bcond_without freethreading_build
%else
%bcond_with freethreading_build
%endif
# Support for the GDB debugger
%bcond_without gdb_hooks
@ -384,14 +378,14 @@ Source11: idle3.appdata.xml
# pypa/distutils integration: https://github.com/pypa/distutils/pull/70
Patch251: 00251-change-user-install-location.patch
# 00425 # a563ac3076a00f0f48b3f94ff63d91d37cb4f1e9
# Only check for 'test/wheeldata' when it's actually used
# 00428 # 8c674ea0d9368e1b239bc9c7ee6044d925e252a4
# gh-118846: Fix PGO tests in free-threaded build
#
# We build Python in Fedora 39+ with option `--with-wheel-pkg-dir`
# pointing to a custom wheel directory and delete the contents of
# upstream's `test/wheeldata`. Don't include the directory in the test set
# if the wheels are used from a different location.
Patch425: 00425-only-check-for-test-wheeldata-when-it-s-actually-used.patch
# Avoid immortalizing objects in tests that verify garbage collection of
# classes or modules.
#
# This fixes test_ordered_dict and test_struct.
Patch428: 00428-gh-118846-fix-pgo-tests-in-free-threaded-build.patch
# (New patches go here ^^^)
#
@ -1346,6 +1340,7 @@ CheckPython freethreading
%dir %{pylibdir}/__pycache__/
%{pylibdir}/__pycache__/*%{bytecode_suffixes}
%{pylibdir}/_pyrepl/
%{pylibdir}/asyncio/
%{pylibdir}/collections/
%{pylibdir}/concurrent/
@ -1431,6 +1426,9 @@ CheckPython freethreading
%{dynload_dir}/_elementtree.%{1}.so\
%{dynload_dir}/_hashlib.%{1}.so\
%{dynload_dir}/_heapq.%{1}.so\
%{dynload_dir}/_interpchannels.%{1}.so\
%{dynload_dir}/_interpqueues.%{1}.so\
%{dynload_dir}/_interpreters.%{1}.so\
%{dynload_dir}/_json.%{1}.so\
%{dynload_dir}/_lsprof.%{1}.so\
%{dynload_dir}/_lzma.%{1}.so\
@ -1577,9 +1575,6 @@ CheckPython freethreading
%{dynload_dir}/_testlimitedcapi.%{1}.so\
%{dynload_dir}/_testmultiphase.%{1}.so\
%{dynload_dir}/_testsinglephase.%{1}.so\
%{dynload_dir}/_xxinterpchannels.%{1}.so\
%{dynload_dir}/_xxinterpqueues.%{1}.so\
%{dynload_dir}/_xxsubinterpreters.%{1}.so\
%{dynload_dir}/_xxtestfuzz.%{1}.so\
%{dynload_dir}/xxlimited.%{1}.so\
%{dynload_dir}/xxlimited_35.%{1}.so\
@ -1700,6 +1695,9 @@ CheckPython freethreading
# ======================================================
%changelog
* Thu May 09 2024 Karolina Surma <ksurma@redhat.com> - 3.13.0~b1-1
- Update to Python 3.13.0b1
* Mon May 06 2024 Miro Hrončok <mhroncok@redhat.com> - 3.13.0~a6-3
- Build Python with -O3
- https://fedoraproject.org/wiki/Changes/Python_built_with_gcc_O3

View file

@ -1,2 +1,2 @@
SHA512 (Python-3.13.0a6.tar.xz) = 6e999c718cdfede4abc52297aae7160a2864424e8f49a47321fa822d40c331a3d061a0982e355351a0c4bea40e9b1ec3832d76a7f4b6b3986b62fca2757f0ca1
SHA512 (Python-3.13.0a6.tar.xz.asc) = 1ec2abe8198a5fbd98490274bed7e84b48fcfc6ff25fcb474455d9f33b62673cfb7cf4939b304684aed005975d166143cb644b9a3e484d25de3dacb869de0131
SHA512 (Python-3.13.0b1.tar.xz) = 81cc1d8691bfcc8f8bb232ea15c18039d0df036f5cbc1667fec3b6c34cdf198bed97418ec775c037778c250b7bc4f35bd5fb938dd478cc17fc48c74b8a2b2d19
SHA512 (Python-3.13.0b1.tar.xz.asc) = c10832b5016ad9a9588b7efd29a35272c1c07b444df116c397fed82d66f30150687d68a6853637094be2fe1d8ed0928a9cd151617c91d9eb9938ba1385bd7143