summary refs log tree commit diff
path: root/gnu
diff options
context:
space:
mode:
authorJack Hill <jackhill@jackhill.us>2023-03-16 18:24:23 -0400
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2023-04-02 22:28:56 +0200
commit54247aed0033cfd7c5428f120ce9beac069b63d9 (patch)
treefe923b5f7ce901432503ec7d1f8300e9ca610915 /gnu
parentbd11fe792b6449524055ee53c613b813f6276dce (diff)
downloadguix-54247aed0033cfd7c5428f120ce9beac069b63d9.tar.gz
gnu: python-hy: Report version.
* gnu/packages/python-xyz.scm (python-hy)[arguments]<#:phases>: Add
set-version and remove-installed-build-scripts.

Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/python-xyz.scm36
1 files changed, 24 insertions, 12 deletions
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 90452c55fb..659d8ea3ff 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -58,7 +58,7 @@
 ;;; Copyright © 2015, 2018 Pjotr Prins <pjotr.guix@thebird.nl>
 ;;; Copyright © 2019, 2020 Brett Gilio <brettg@gnu.org>
 ;;; Copyright © 2019 Sam <smbaines8@gmail.com>
-;;; Copyright © 2019 Jack Hill <jackhill@jackhill.us>
+;;; Copyright © 2019, 2023 Jack Hill <jackhill@jackhill.us>
 ;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019, 2020 Alex Griffin <a@ajgrf.com>
 ;;; Copyright © 2019, 2020, 2021, 2022 Pierre Langlois <pierre.langlois@gmx.com>
@@ -15311,17 +15311,29 @@ with a new public API, and RPython support.")
         (base32 "1czhh7s81sg0nrnf4zv0ydqi4f7s6sywf4ks4fd59vpx441ca39v"))))
     (build-system python-build-system)
     (arguments
-     '(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "python" "-m" "pytest" "-k"
-                       (string-append   ; skip some failed tests
-                        "not test_sys_executable"
-                        " and not test_circular_macro_require"
-                        " and not test_macro_require"
-                        " and not test_requires_pollutes_core"))))))))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          ;; Hy includes a script that writes a version.py file that Hy uses to
+          ;; report its version. That script uses information from the git
+          ;; repository or the HY_VERSION environment variable. Therefore,
+          ;; these phases set HY_VERSION and then remove the support scripts
+          ;; which get installed in the root of the output.
+          (add-after 'unpack 'set-version
+            (lambda _
+              (setenv "HY_VERSION" #$version)))
+          (add-after 'install 'remove-installed-build-scripts
+            (lambda _
+              (delete-file-recursively (string-append #$output "/get_version"))))
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke "python" "-m" "pytest" "-k"
+                        (string-append   ; skip some failed tests
+                         "not test_sys_executable"
+                         " and not test_circular_macro_require"
+                         " and not test_macro_require"
+                         " and not test_requires_pollutes_core"))))))))
     (native-inputs
      (list python-pytest-7.1 python-wheel))
     (propagated-inputs