From 3622f52a9a0326401aecee71727274f67041d556 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Salgado Date: Tue, 22 Jul 2025 13:53:05 +0200 Subject: [PATCH] gh-133742: Fix test_sysconfig and test_build_details for relocated directories (GH-136987) (cherry picked from commit aafbdb5df5439adc1106ced068cf87683ae68b9e) Co-authored-by: Pablo Galindo Salgado --- Lib/test/test_build_details.py | 9 +++++++++ Lib/test/test_sysconfig.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_build_details.py b/Lib/test/test_build_details.py index ba4b8c5aa9b58e..691fd0bb98c097 100644 --- a/Lib/test/test_build_details.py +++ b/Lib/test/test_build_details.py @@ -124,6 +124,10 @@ def test_location(self): def test_base_interpreter(self): value = self.key('base_interpreter') + # Skip check if installation is relocated + if sysconfig._installation_is_relocated(): + self.skipTest("Installation is relocated") + self.assertEqual(os.path.realpath(value), os.path.realpath(sys.executable)) @needs_installed_python @@ -133,6 +137,11 @@ def test_base_interpreter(self): ) def test_c_api(self): value = self.key('c_api') + + # Skip check if installation is relocated + if sysconfig._installation_is_relocated(): + self.skipTest("Installation is relocated") + self.assertTrue(os.path.exists(os.path.join(value['headers'], 'Python.h'))) version = sysconfig.get_config_var('VERSION') self.assertTrue(os.path.exists(os.path.join(value['pkgconfig_path'], f'python-{version}.pc'))) diff --git a/Lib/test/test_sysconfig.py b/Lib/test/test_sysconfig.py index 7af3144d69197e..9faabc2e25447f 100644 --- a/Lib/test/test_sysconfig.py +++ b/Lib/test/test_sysconfig.py @@ -709,7 +709,7 @@ def test_sysconfigdata_json(self): ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase'} # Keys dependent on Python being run from the prefix targetted when building (different on relocatable installs) if sysconfig._installation_is_relocated(): - ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase'} + ignore_keys |= {'prefix', 'exec_prefix', 'base', 'platbase', 'installed_base', 'installed_platbase', 'srcdir'} for key in ignore_keys: json_config_vars.pop(key, None) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy