guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 74ef3a1da542e5440de56498816d8a4e5175c958
Author: Nicolas Graves <[email protected]>
AuthorDate: Wed Sep 17 17:44:59 2025 +0200

    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 <[email protected]>
---
 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 759cdc38d7..b7ac025963 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

Reply via email to