From patchwork Tue Mar 7 19:57:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jack Hill X-Patchwork-Id: 47777 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3116D16DED; Tue, 7 Mar 2023 19:58:27 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id F11E516DE3 for ; Tue, 7 Mar 2023 19:58:25 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZdRs-0000xh-AQ; Tue, 07 Mar 2023 14:58:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZdRj-0000xM-34 for guix-patches@gnu.org; Tue, 07 Mar 2023 14:58:04 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZdRi-00057S-Qw for guix-patches@gnu.org; Tue, 07 Mar 2023 14:58:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pZdRi-0008DH-NK for guix-patches@gnu.org; Tue, 07 Mar 2023 14:58:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#62038] [PATCH 2/2] gnu: python-hy: Report version. Resent-From: Jack Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 07 Mar 2023 19:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62038 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62038@debbugs.gnu.org Received: via spool by 62038-submit@debbugs.gnu.org id=B62038.167821907431549 (code B ref 62038); Tue, 07 Mar 2023 19:58:02 +0000 Received: (at 62038) by debbugs.gnu.org; 7 Mar 2023 19:57:54 +0000 Received: from localhost ([127.0.0.1]:47242 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZdRa-0008Ci-0J for submit@debbugs.gnu.org; Tue, 07 Mar 2023 14:57:54 -0500 Received: from minsky.hcoop.net ([104.248.1.95]:35988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pZdRY-0008CN-A7 for 62038@debbugs.gnu.org; Tue, 07 Mar 2023 14:57:52 -0500 Received: from [2001:470:8:9f5:e878:315c:5ed6:89d] (helo=leyden.home.eronel.org) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pZdRT-0005dH-5I for 62038@debbugs.gnu.org; Tue, 07 Mar 2023 14:57:47 -0500 From: Jack Hill Date: Tue, 7 Mar 2023 14:57:36 -0500 Message-Id: <20230307195736.29985-2-jackhill@jackhill.us> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230307195736.29985-1-jackhill@jackhill.us> References: <820c5bf3-4d3d-0a2e-298b-5b446cf08e94@jackhill.us> <20230307195736.29985-1-jackhill@jackhill.us> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * 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 7a1866314e..88138db1f4 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -58,7 +58,7 @@ ;;; Copyright © 2015, 2018 Pjotr Prins ;;; Copyright © 2019, 2020 Brett Gilio ;;; Copyright © 2019 Sam -;;; Copyright © 2019 Jack Hill +;;; Copyright © 2019, 2023 Jack Hill ;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2019, 2020 Alex Griffin ;;; Copyright © 2019, 2020, 2021, 2022 Pierre Langlois @@ -15020,17 +15020,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 the 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