From 27ba3604d47f741a09357164022aecea09c281c3 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Wed, 17 Sep 2025 17:44:59 +0200 Subject: [PATCH] build-system: pyproject: Add -sP flags for entry-point wrapper. Fixes guix/guix#1118. -P: prevents adding current working directory or script's directory to the search path for modules. -s: Prevent USER site-packages directory (~/.local/lib/pythonX.Y[t]/site-packages) from being included in the search path for modules. * guix/build/pyproject-build-system (create-entrypoints) [create-script]: Add -sP flags, improve pythonic style. Change-Id: Iabc7bb59bf08be1e0c662a069a30ae17a53c7fd5 Signed-off-by: Sharlatan Hellseher --- guix/build/pyproject-build-system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm index 759cdc38d748e3b2ebc90ff7a3fd196f433a8a67..b7ac02596393563aca533d094d649b284be5da7a 100644 --- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -346,7 +346,7 @@ and return write it to PATH/NAME." ;; Technically the script could also include search-paths, ;; but having a generic 'wrap phases also handles manually ;; written entry point scripts. - (format port "#!~a + (format port "#!~a -sP # Auto-generated entry point script. import sys from ~a import ~a