unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Jack Hill <jackhill@jackhill.us>
To: 62038@debbugs.gnu.org
Subject: [bug#62038] [PATCH v2 2/2] gnu: python-hy: Report version.
Date: Thu, 16 Mar 2023 18:17:34 -0400	[thread overview]
Message-ID: <20230316221734.23689-2-jackhill@jackhill.us> (raw)
In-Reply-To: <20230316221734.23689-1-jackhill@jackhill.us>

* gnu/packages/python-xyz.scm (python-hy)[arguments]{phases}: Add
set-version and remove-installed-build-scripts.
---
 gnu/packages/python-xyz.scm | 36 ++++++++++++++++++++++++------------
 1 file changed, 24 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 509bfa77d6..3dc1a0834c 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>
@@ -15039,17 +15039,29 @@ (define-public python-hy
         (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 et 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
-- 
2.39.2





  reply	other threads:[~2023-03-16 22:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-07 19:55 [bug#62038] [PATCH 0/2] update python-hy Jack Hill
2023-03-07 19:57 ` [bug#62038] [PATCH 1/2] gnu: python-hy: Update to 0.26.0 Jack Hill
2023-03-07 19:57   ` [bug#62038] [PATCH 2/2] gnu: python-hy: Report version Jack Hill
2023-03-16 22:15 ` [bug#62038] [PATCH v2 0/2] python-hy update v2 (typo fix) Jack Hill
2023-03-16 22:17   ` [bug#62038] [PATCH v2 1/2] gnu: python-hy: Update to 0.26.0 Jack Hill
2023-03-16 22:17     ` Jack Hill [this message]
2023-03-16 22:23   ` [bug#62038] [PATCH v3 0/2] python-hy update v3 (another typo fix) Jack Hill
2023-03-16 22:24     ` [bug#62038] [PATCH v3 1/2] gnu: python-hy: Update to 0.26.0 Jack Hill
2023-03-16 22:24       ` [bug#62038] [PATCH v3 2/2] gnu: python-hy: Report version Jack Hill
2023-04-03 16:40     ` bug#62038: [PATCH v3 0/2] python-hy update v3 (another typo fix) Nicolas Goaziou
2023-04-03 17:59       ` [bug#62038] " Jack Hill

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230316221734.23689-2-jackhill@jackhill.us \
    --to=jackhill@jackhill.us \
    --cc=62038@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).