- 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
This commit is contained in:
2025-04-15 14:09:42 +00:00
committed by Git OBS Bridge
parent 9624a1ae7e
commit 9e2287fa69
3 changed files with 103 additions and 6 deletions

View File

@@ -0,0 +1,95 @@
commit 2b0e2b2893a821ca36cd65a204bed932741ac189
Author: Filipe Laíns 🇵🇸 <lains@riseup.net>
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'),

View File

@@ -271,6 +271,8 @@ Fri Apr 11 19:47:34 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- gh-129660: Drop test_embed from PGO training, whose - gh-129660: Drop test_embed from PGO training, whose
contribution in recent versions is considered to be contribution in recent versions is considered to be
ignorable. ignorable.
- Add gh126985-mv-pyvenv.cfg2getpath.patch to remove failing
tests in test_sysconfig.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Mar 10 15:44:31 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com> Mon Mar 10 15:44:31 UTC 2025 - Bernhard Wiedemann <bwiedemann@suse.com>

View File

@@ -222,6 +222,9 @@ Patch40: fix-test-recursion-limit-15.6.patch
# PATCH-FIX-SLE doc-py38-to-py36.patch mcepl@suse.com # PATCH-FIX-SLE doc-py38-to-py36.patch mcepl@suse.com
# Make documentation extensions working with Python 3.6 # Make documentation extensions working with Python 3.6
Patch41: doc-py38-to-py36.patch 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: autoconf-archive
BuildRequires: automake BuildRequires: automake
BuildRequires: fdupes 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" EXCLUDE="$EXCLUDE test_external_inspection test_faulthandler test_os test_posix test_signal test_socket test_subprocess"
%endif %endif
# gh#python/cpython#132535
EXCLUDE="$EXCLUDE test_timeout"
# This test (part of test_uuid) requires real network interfaces # This test (part of test_uuid) requires real network interfaces
# so that ifconfig output has "HWaddr <something>". Some kvm instances # so that ifconfig output has "HWaddr <something>". Some kvm instances
# done have any such interface breaking the uuid module. # done have any such interface breaking the uuid module.
EXCLUDE="$EXCLUDE test_uuid" 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 # Limit virtual memory to avoid spurious failures
if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then if test $(ulimit -v) = unlimited || test $(ulimit -v) -gt 10000000; then
ulimit -v 11000000 || : ulimit -v 11000000 || :