From patchwork Thu Mar 16 22:24:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jack Hill X-Patchwork-Id: 48060 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 6BE6616E84; Thu, 16 Mar 2023 22:25:13 +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=ham 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 313A216CBF for ; Thu, 16 Mar 2023 22:25:12 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcw1y-0003vA-9B; Thu, 16 Mar 2023 18:25:06 -0400 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 1pcw1u-0003uk-Mv for guix-patches@gnu.org; Thu, 16 Mar 2023 18:25:02 -0400 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 1pcw1u-0003u0-C1 for guix-patches@gnu.org; Thu, 16 Mar 2023 18:25:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pcw1u-0000D4-7K for guix-patches@gnu.org; Thu, 16 Mar 2023 18:25:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62038] [PATCH v3 2/2] gnu: python-hy: Report version. Resent-From: Jack Hill Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 16 Mar 2023 22:25: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.1679005481771 (code B ref 62038); Thu, 16 Mar 2023 22:25:02 +0000 Received: (at 62038) by debbugs.gnu.org; 16 Mar 2023 22:24:41 +0000 Received: from localhost ([127.0.0.1]:43297 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcw1Z-0000CM-CX for submit@debbugs.gnu.org; Thu, 16 Mar 2023 18:24:41 -0400 Received: from minsky.hcoop.net ([104.248.1.95]:45470) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcw1Y-0000C4-2H for 62038@debbugs.gnu.org; Thu, 16 Mar 2023 18:24:40 -0400 Received: from libre-01.lib.duke.edu ([152.3.119.171] helo=localhost.localdomain) by minsky.hcoop.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pcw1S-0006z7-Up for 62038@debbugs.gnu.org; Thu, 16 Mar 2023 18:24:35 -0400 From: Jack Hill Date: Thu, 16 Mar 2023 18:24:23 -0400 Message-Id: <20230316222423.23757-2-jackhill@jackhill.us> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230316222423.23757-1-jackhill@jackhill.us> References: <20230316222423.23757-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 509bfa77d6..a5a2048fb5 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 @@ -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 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