MINGW-packages/mingw-w64-python3.13/0101-mingw_smoketests-add-a-test-to-check-if-sysconfig-re.patch
Christoph Reiter 04c9ed3700 python3.13: Add 3.13.7
* add libb2 as dep
* remove "-Wl,--large-address-aware", default now via makepkg
* remove 2to3 logic, no longer in Python
2025-09-08 22:02:30 +02:00

47 lines
1.8 KiB
Diff

From 9e3412f452f6f0ebfc87531ed1f369da7c3d54e6 Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Wed, 8 Nov 2023 19:44:22 +0530
Subject: [PATCH 101/N] mingw_smoketests: add a test to check if sysconfig
returns correct values for `LIBDIR`
---
mingw_smoketests.py | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/mingw_smoketests.py b/mingw_smoketests.py
index ca1f652..4f81c68 100644
--- a/mingw_smoketests.py
+++ b/mingw_smoketests.py
@@ -218,6 +218,9 @@ class Tests(unittest.TestCase):
import sysconfig
import platform
import importlib.machinery
+ import tempfile
+ import venv
+ import subprocess
self.assertEqual(sys.implementation.name, "cpython")
self.assertEqual(sys.platform, "win32")
self.assertTrue(sysconfig.get_platform().startswith("mingw"))
@@ -241,6 +244,21 @@ class Tests(unittest.TestCase):
self.assertEqual(platform.system(), "Windows")
self.assertTrue(isinstance(sys.api_version, int) and sys.api_version > 0)
+ with tempfile.TemporaryDirectory() as tmp:
+ builder = venv.EnvBuilder()
+ builder.create(tmp)
+ # This will not work in in-tree build
+ if not sysconfig.is_python_build():
+ op = subprocess.check_output(
+ [
+ os.path.join(tmp, "bin", "python.exe"),
+ "-c",
+ "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))"
+ ],
+ cwd=tmp,
+ )
+ self.assertTrue(op.decode().strip().startswith(sys.base_prefix))
+
def test_sys_getpath(self):
# everything sourced from getpath.py
import sys