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

commit 7e745855397fda631a545e19a56e5ed6512de84a
Author: Sharlatan Hellseher <sharlata...@gmail.com>
AuthorDate: Fri Jul 11 21:50:23 2025 +0100

    gnu: python-flit-core-bootstrap: Switch to pyproject.
    
    * gnu/packages/python-build.scm (python-flit-core-bootstrap):
      [build-system]: Use pyproject.
      [arguments] <phases>: Add 'fix-license; use default 'install.
    
    Change-Id: I79baaf6885c0c07ad508f110307fc31487439fd4
---
 gnu/packages/python-build.scm | 46 ++++++++++++++++++++++---------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm
index f450e8550f..9325f20f20 100644
--- a/gnu/packages/python-build.scm
+++ b/gnu/packages/python-build.scm
@@ -616,30 +616,32 @@ compatible build front-ends to build Poetry managed 
projects.")
        (uri (pypi-uri "flit" version))
        (sha256
         (base32 "0h1pxi2hgr95321bgl45l86693zl14l3shj0idsyg4k9v56z700w"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      ;; flit-core has a test suite, but it requires Pytest.  Disable it so
+      ;; as to not pull pytest as an input.
+      #:tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-license
+            ;; flit_core bundles the 'tomli' TOML parser, to avoid a
+            ;; bootstrapping problem. See
+            ;; <https://github.com/pypa/packaging-problems/issues/342>.
+            (lambda _
+              (delete-file-recursively "flit_core/flit_core/vendor")
+              (substitute* "flit_core/pyproject.toml"
+                (("license-files.*") "license-files = [\"LICENSE*\"]\n"))))
+          (replace 'build
+            ;; flit-core requires itself to build.  Luckily, a
+            ;; bootstrapping script exists, which does so using just
+            ;; the checkout sources and Python.
+            (lambda _
+              (chdir "flit_core")
+              (invoke "python" "build_dists.py")))
+          (delete 'sanity-check))))
     (propagated-inputs
      (list python-toml))
-    (arguments
-     ;; flit-core has a test suite, but it requires Pytest.  Disable it so
-     ;; as to not pull pytest as an input.
-     `(#:tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'build
-           ;; flit-core requires itself to build.  Luckily, a
-           ;; bootstrapping script exists, which does so using just
-           ;; the checkout sources and Python.
-           (lambda _
-             (invoke "python" "flit_core/build_dists.py")))
-         (replace 'install
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((out (assoc-ref outputs "out"))
-                   (whl (car (find-files "." "\\.whl$"))))
-               (invoke "pip" "--no-cache-dir" "--no-input"
-                       "install" "--no-deps" "--prefix" out whl))))
-         ;; The sanity-check phase fails because flit depends on tomli at
-         ;; run-time, but this core variant avoids it to avoid a cycle.
-         (delete 'sanity-check))))
     (home-page "https://github.com/pypa/flit";)
     (synopsis "Core package of the Flit Python build system")
     (description "This package provides @code{flit-core}, a PEP 517 build

Reply via email to