summaryrefslogtreecommitdiff
path: root/dev-python/pdm/files/pdm-2.24.0-respect-python.patch
blob: 2707616263e76874bf1e7cf5e8a55433460d5ff2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 6ac6bf373db1acee7f51a3d695e8b58e85f11801 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Sat, 19 Apr 2025 11:13:02 +0200
Subject: [PATCH] Force `sys.executable` in pytest fixture

Fix the pytest fixture to respect `sys.executable` rather than finding
an arbitrary Python version in `sys.base_prefix`.  No clue why upstream
changed the logic to do the latter, but it is clearly wrong on Gentoo.

Bug: https://github.com/pdm-project/pdm/issues/3486
---
 src/pdm/pytest.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pdm/pytest.py b/src/pdm/pytest.py
index d23ad4b9..3f50c0f2 100644
--- a/src/pdm/pytest.py
+++ b/src/pdm/pytest.py
@@ -407,7 +407,7 @@ def project_no_init(
     tmp_path.joinpath("caches").mkdir(parents=True)
     p.global_config["cache_dir"] = tmp_path.joinpath("caches").as_posix()
     p.global_config["log_dir"] = tmp_path.joinpath("logs").as_posix()
-    python_path = find_python_in_path(sys.base_prefix)
+    python_path = Path(sys.executable)
     if python_path is None:
         raise ValueError("Unable to find a Python path")
     p._saved_python = python_path.as_posix()