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

commit 8a23f2628f05766e63f2f94df3bee511d1dfa6b5
Author: Nicolas Graves <[email protected]>
AuthorDate: Fri Oct 31 00:46:40 2025 +0100

    gnu: Add python-setuptools-bootstrap.
    
    * gnu/packages/python-build.scm (python-setuptools-bootstrap): New variable.
    
    Change-Id: I7677ede70a61b9cc39ae6e021fc2f1f1afaa8d25
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/python-build.scm | 48 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index 3bddb7a3dc..92130b636f 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -41,6 +41,7 @@
 (define-module (gnu packages python-build)
   #:use-module (gnu packages)
   #:use-module ((guix licenses) #:prefix license:)
+  #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system pyproject)
   #:use-module (guix gexp)
@@ -376,6 +377,53 @@ facilitate packaging Python projects, where packaging 
includes:
                    license:asl2.0       ;packaging is dual ASL2/BSD-2
                    license:bsd-2))))
 
+(define-public python-setuptools-bootstrap
+  (package/inherit python-setuptools
+    (name "python-setuptools-bootstrap")
+    ;; version and source are purposefully not inherited, to allow
+    ;; updating python-setuptools in the python-team scope, whereas
+    ;; python-setuptools-bootstrap is in the core-packages-team scope.
+    (version "80.9.0")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "setuptools" version))
+       (sha256
+        (base32 "175iixi2h2jz8y2bpwziak360hvv43jfhipwzbdniryd5r04fszk"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; TODO: setuptools now bundles the following libraries:
+        ;; packaging, pyparsing, six and appdirs.  How to unbundle?
+        ;; Remove included binaries which are used to build self-extracting
+        ;; installers for Windows.
+        '(for-each delete-file (find-files "setuptools"
+                                           "^(cli|gui).*\\.exe$")))))
+    (build-system gnu-build-system)
+    (arguments
+     (list
+      #:tests? #f                       ;disabled to avoid extra dependencies
+      ;; Essentially a lighter copy of the former python-build-system.
+      ;; Using it rather than pyproject-build-system allows to edit the latter
+      ;; without a world rebuild (for the meson package in particular).
+      #:phases
+      #~(modify-phases %standard-phases
+          (delete 'bootstrap)
+          (delete 'configure)
+          (replace 'build
+            (lambda _
+              (invoke "python" "./setup.py" "build")))
+          (replace 'install
+            (lambda _
+              (invoke "python" "./setup.py" "install"
+                      (string-append "--prefix=" #$output) "--no-compile")
+              (invoke "python" "-m" "compileall"
+                      "--invalidation-mode=unchecked-hash" #$output))))))
+    (native-inputs (list))
+    ;; Avoid introducing an additional module-dependency.
+    (inputs (list (module-ref (resolve-interface '(gnu packages python))
+                              'python-wrapper)))
+    (propagated-inputs (list))))
+
 (define-public python-setuptools-67
   (package
     (inherit python-setuptools)

Reply via email to