From 9e2287fa694c1d639d1bb342ea4d7ba4072b01c411f265dc502e20c7011e0655 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 15 Apr 2025 14:09:42 +0000 Subject: [PATCH] - Add gh126985-mv-pyvenv.cfg2getpath.patch to remove failing tests in test_sysconfig. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python313?expand=0&rev=88 --- gh126985-mv-pyvenv.cfg2getpath.patch | 95 ++++++++++++++++++++++++++++ python313.changes | 2 + python313.spec | 12 ++-- 3 files changed, 103 insertions(+), 6 deletions(-) create mode 100644 gh126985-mv-pyvenv.cfg2getpath.patch diff --git a/gh126985-mv-pyvenv.cfg2getpath.patch b/gh126985-mv-pyvenv.cfg2getpath.patch new file mode 100644 index 0000000..4105098 --- /dev/null +++ b/gh126985-mv-pyvenv.cfg2getpath.patch @@ -0,0 +1,95 @@ +commit 2b0e2b2893a821ca36cd65a204bed932741ac189 +Author: Filipe Laíns 🇵🇸 +Date: Tue Nov 26 13:46:33 2024 +0000 + + GH-126985: move pyvenv.cfg detection from site to getpath (#126987) + +--- + Lib/test/test_sysconfig.py | 67 --------------------------------------------- + 1 file changed, 1 insertion(+), 66 deletions(-) + +Index: Python-3.13.3/Lib/test/test_sysconfig.py +=================================================================== +--- Python-3.13.3.orig/Lib/test/test_sysconfig.py 2025-04-15 14:13:08.581364697 +0200 ++++ Python-3.13.3/Lib/test/test_sysconfig.py 2025-04-15 14:13:54.955529034 +0200 +@@ -110,6 +110,7 @@ + **venv_create_args, + ) + ++ + def test_get_path_names(self): + self.assertEqual(get_path_names(), sysconfig._SCHEME_KEYS) + +@@ -604,72 +605,6 @@ + suffix = sysconfig.get_config_var('EXT_SUFFIX') + self.assertTrue(suffix.endswith('-darwin.so'), suffix) + +- @requires_subprocess() +- def test_config_vars_depend_on_site_initialization(self): +- script = textwrap.dedent(""" +- import sysconfig +- +- config_vars = sysconfig.get_config_vars() +- +- import json +- print(json.dumps(config_vars, indent=2)) +- """) +- +- with self.venv() as venv: +- site_config_vars = json.loads(venv.run('-c', script).stdout) +- no_site_config_vars = json.loads(venv.run('-S', '-c', script).stdout) +- +- self.assertNotEqual(site_config_vars, no_site_config_vars) +- # With the site initialization, the virtual environment should be enabled. +- self.assertEqual(site_config_vars['base'], venv.prefix) +- self.assertEqual(site_config_vars['platbase'], venv.prefix) +- #self.assertEqual(site_config_vars['prefix'], venv.prefix) # # FIXME: prefix gets overwriten by _init_posix +- # Without the site initialization, the virtual environment should be disabled. +- self.assertEqual(no_site_config_vars['base'], site_config_vars['installed_base']) +- self.assertEqual(no_site_config_vars['platbase'], site_config_vars['installed_platbase']) +- +- @requires_subprocess() +- def test_config_vars_recalculation_after_site_initialization(self): +- script = textwrap.dedent(""" +- import sysconfig +- +- before = sysconfig.get_config_vars() +- +- import site +- site.main() +- +- after = sysconfig.get_config_vars() +- +- import json +- print(json.dumps({'before': before, 'after': after}, indent=2)) +- """) +- +- with self.venv() as venv: +- config_vars = json.loads(venv.run('-S', '-c', script).stdout) +- +- self.assertNotEqual(config_vars['before'], config_vars['after']) +- self.assertEqual(config_vars['after']['base'], venv.prefix) +- #self.assertEqual(config_vars['after']['prefix'], venv.prefix) # FIXME: prefix gets overwriten by _init_posix +- #self.assertEqual(config_vars['after']['exec_prefix'], venv.prefix) # FIXME: exec_prefix gets overwriten by _init_posix +- +- @requires_subprocess() +- def test_paths_depend_on_site_initialization(self): +- script = textwrap.dedent(""" +- import sysconfig +- +- paths = sysconfig.get_paths() +- +- import json +- print(json.dumps(paths, indent=2)) +- """) +- +- with self.venv() as venv: +- site_paths = json.loads(venv.run('-c', script).stdout) +- no_site_paths = json.loads(venv.run('-S', '-c', script).stdout) +- +- self.assertNotEqual(site_paths, no_site_paths) +- +- + class MakefileTests(unittest.TestCase): + + @unittest.skipIf(sys.platform.startswith('win'), diff --git a/python313.changes b/python313.changes index 34cf35d..59874cb 100644 --- a/python313.changes +++ b/python313.changes @@ -271,6 +271,8 @@ Fri Apr 11 19:47:34 UTC 2025 - Matej Cepl - gh-129660: Drop test_embed from PGO training, whose contribution in recent versions is considered to be ignorable. +- Add gh126985-mv-pyvenv.cfg2getpath.patch to remove failing + tests in test_sysconfig. ------------------------------------------------------------------- Mon Mar 10 15:44:31 UTC 2025 - Bernhard Wiedemann diff --git a/python313.spec b/python313.spec index 71fb5d6..8fed4f3 100644 --- a/python313.spec +++ b/python313.spec @@ -222,6 +222,9 @@ Patch40: fix-test-recursion-limit-15.6.patch # PATCH-FIX-SLE doc-py38-to-py36.patch mcepl@suse.com # Make documentation extensions working with Python 3.6 Patch41: doc-py38-to-py36.patch +# PATCH-FIX-UPSTREAM gh126985-mv-pyvenv.cfg2getpath.patch mcepl@suse.com +# Remove tests failing in test_sysconfig +Patch42: gh126985-mv-pyvenv.cfg2getpath.patch BuildRequires: autoconf-archive BuildRequires: automake BuildRequires: fdupes @@ -651,17 +654,14 @@ EXCLUDE="$EXCLUDE test_faulthandler" EXCLUDE="$EXCLUDE test_external_inspection test_faulthandler test_os test_posix test_signal test_socket test_subprocess" %endif +# gh#python/cpython#132535 +EXCLUDE="$EXCLUDE test_timeout" + # This test (part of test_uuid) requires real network interfaces # so that ifconfig output has "HWaddr ". Some kvm instances # done have any such interface breaking the uuid module. EXCLUDE="$EXCLUDE test_uuid" -# bsc#1195140 and bpo#37169 - test_capi is failing on openSUSE, and not sure why -EXCLUDE="$EXCLUDE test_capi" - -# Failing tests on python 3.13 -EXCLUDE="$EXCLUDE test_regrtest test_sysconfig" - # Limit virtual memory to avoid spurious failures if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then ulimit -v 11000000 || :