From patchwork Sat Oct 22 19:09:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43932 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 81A5327BBEA; Mon, 24 Oct 2022 04:01:51 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 B36CE27BBE9 for ; Mon, 24 Oct 2022 04:01:50 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjCm-0006xm-EN for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:12:28 -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 1omJsh-00080V-1a for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -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 1omJsg-0004Yy-Pc for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJsg-0003L5-JC for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 01/22] gnu: python-setuptools: Move to python-build. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:10:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646578612782 (code B ref 58587); Sat, 22 Oct 2022 19:10:02 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:09:46 +0000 Received: from localhost ([127.0.0.1]:42350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsP-0003K5-EX for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:45 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59108) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsN-0003Js-R1 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsH-0004Vu-RT; Sat, 22 Oct 2022 15:09:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=FB5hIfd0iWFW843+4TFGSvtLo2B9qEI2PkzC+dNMgvA=; b=Ya+uoufqGjK1tYFuqwH3 Ztw8170zD4O76Is1myuU1PJYs1g2IYEs6chrTOIWbRiuQW7j9K6xnsZ3jFJUiTaGP8zVB+HvAfbdI hhslWIeDBZOD1UuOUFCbQuRt9Sap5fpbB7bRx59H4YQ279b6gEKRN/rGnKkCy9S8rS5lDt8zC0ulr BpdFwyhDM6hFv4+FK4qz05p9kdMzfeoG0dIq1xGFv8juB6IM4R51zfgPYJByW7NSzuSryKrQT2MDS hdJpZCBxtgXaoeH+ek4MIpVeMZrNzsvPcFxwmzYJBMVT9U83iXWtvYBs6Xp9T7bKIHiy1lRL0Xqmf AjNvYIMgGPf/ug==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsH-0003gQ-Ds; Sat, 22 Oct 2022 15:09:37 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:09 +0200 Message-Id: <20221022190930.13086-1-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <87eduzu18u.fsf@gnu.org> References: <87eduzu18u.fsf@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches From: Lars-Dominik Braun * gnu/packages/python-xyz.scm (python-setuptools): Move… * gnu/packages/python-build.scm: …here. * gnu/packages/chemistry.scm, gnu/packages/messaging.scm, gnu/packages/sequoia.scm, tests/lint.scm: Adjust module imports accordingly. Co-authored-by: Marius Bakke --- gnu/packages/chemistry.scm | 1 + gnu/packages/messaging.scm | 1 + gnu/packages/python-build.scm | 40 +++++++++++++++++++++++++++++++++++ gnu/packages/python-xyz.scm | 40 ----------------------------------- gnu/packages/sequoia.scm | 2 +- tests/lint.scm | 2 +- 6 files changed, 44 insertions(+), 42 deletions(-) diff --git a/gnu/packages/chemistry.scm b/gnu/packages/chemistry.scm index d0582c4b6f..6549da3453 100644 --- a/gnu/packages/chemistry.scm +++ b/gnu/packages/chemistry.scm @@ -56,6 +56,7 @@ (define-module (gnu packages chemistry) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-xyz) #:use-module (gnu packages qt) #:use-module (gnu packages serialization) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index fa889d24a7..86d9914c90 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -116,6 +116,7 @@ (define-module (gnu packages messaging) #:use-module (gnu packages pkg-config) #:use-module (gnu packages protobuf) #:use-module (gnu packages python) + #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-web) diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm index 9d9b07f769..3ff988820f 100644 --- a/gnu/packages/python-build.scm +++ b/gnu/packages/python-build.scm @@ -41,6 +41,46 @@ (define-module (gnu packages python-build) ;;; ;;; Code: +(define-public python-setuptools + (package + (name "python-setuptools") + (version "64.0.3") + (source + (origin + (method url-fetch) + (uri (pypi-uri "setuptools" version)) + (sha256 + (base32 + "1sllqf0bhsl2yilf1w0xnlz0r4yaksmwaj0ap91zdc6kgbigdjiv")) + (modules '((guix build utils))) + (snippet + ;; Remove included binaries which are used to build self-extracting + ;; installers for Windows. + ;; TODO: Find some way to build them ourself so we can include them. + '(for-each delete-file (find-files "setuptools" + "^(cli|gui).*\\.exe$"))))) + (build-system python-build-system) + ;; FIXME: Tests require pytest, which itself relies on setuptools. + ;; One could bootstrap with an internal untested setuptools. + (arguments (list #:tests? #f)) + (home-page "https://pypi.org/project/setuptools/") + (synopsis "Library designed to facilitate packaging Python projects") + (description "Setuptools is a fully-featured, stable library designed to +facilitate packaging Python projects, where packaging includes: +@itemize +@item Python package and module definitions +@item distribution package metadata +@item test hooks +@item project installation +@item platform-specific details. +@end itemize") + ;; TODO: setuptools now bundles the following libraries: + ;; packaging, pyparsing, six and appdirs. How to unbundle? + (license (list license:psfl ;setuptools itself + license:expat ;six, appdirs, pyparsing + license:asl2.0 ;packaging is dual ASL2/BSD-2 + license:bsd-2)))) + (define-public python-wheel (package (name "python-wheel") diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index ebc56bbc11..3ea29ec3b9 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -2043,46 +2043,6 @@ (define-public python-serpent other machines, such as over the network.") (license license:expat))) -(define-public python-setuptools - (package - (name "python-setuptools") - (version "64.0.3") - (source - (origin - (method url-fetch) - (uri (pypi-uri "setuptools" version)) - (sha256 - (base32 - "1sllqf0bhsl2yilf1w0xnlz0r4yaksmwaj0ap91zdc6kgbigdjiv")) - (modules '((guix build utils))) - (snippet - ;; Remove included binaries which are used to build self-extracting - ;; installers for Windows. - ;; TODO: Find some way to build them ourself so we can include them. - '(for-each delete-file (find-files "setuptools" - "^(cli|gui).*\\.exe$"))))) - (build-system python-build-system) - ;; FIXME: Tests require pytest, which itself relies on setuptools. - ;; One could bootstrap with an internal untested setuptools. - (arguments (list #:tests? #f)) - (home-page "https://pypi.org/project/setuptools/") - (synopsis "Library designed to facilitate packaging Python projects") - (description "Setuptools is a fully-featured, stable library designed to -facilitate packaging Python projects, where packaging includes: -@itemize -@item Python package and module definitions -@item distribution package metadata -@item test hooks -@item project installation -@item platform-specific details. -@end itemize") - ;; TODO: setuptools now bundles the following libraries: - ;; packaging, pyparsing, six and appdirs. How to unbundle? - (license (list license:psfl ;setuptools itself - license:expat ;six, appdirs, pyparsing - license:asl2.0 ;packaging is dual ASL2/BSD-2 - license:bsd-2)))) - (define-public python-setuptools-declarative-requirements (package (name "python-setuptools-declarative-requirements") diff --git a/gnu/packages/sequoia.scm b/gnu/packages/sequoia.scm index a8d21ac1a4..7002f684b8 100644 --- a/gnu/packages/sequoia.scm +++ b/gnu/packages/sequoia.scm @@ -36,7 +36,7 @@ (define-module (gnu packages sequoia) #:use-module (gnu packages nettle) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) - #:use-module (gnu packages python-xyz) ;; python-setuptools + #:use-module (gnu packages python-build) ;python-setuptools #:use-module (gnu packages rust) #:use-module (gnu packages tls)) diff --git a/tests/lint.scm b/tests/lint.scm index 8be74d2604..641486f89b 100644 --- a/tests/lint.scm +++ b/tests/lint.scm @@ -49,7 +49,7 @@ (define-module (test-lint) #:use-module (gnu packages) #:use-module (gnu packages glib) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages python-xyz) + #:use-module (gnu packages python-build) #:use-module ((gnu packages bash) #:select (bash bash-minimal)) #:use-module (web uri) #:use-module (web server) From patchwork Sat Oct 22 19:09:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43820 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 977ED27BBEA; Mon, 24 Oct 2022 00:07:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 153D227BBE9 for ; Mon, 24 Oct 2022 00:07:44 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjDF-0006z4-BS for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:12:57 -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 1omJsh-00080e-T1 for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:04 -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 1omJsh-0004cI-L8 for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJsh-0003LE-7f for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 02/22] gnu: pypy: Move to separate module. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646579312802 (code B ref 58587); Sat, 22 Oct 2022 19:10:03 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:09:53 +0000 Received: from localhost ([127.0.0.1]:42354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsW-0003KO-0i for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsU-0003K4-3G for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsO-0004WK-TQ; Sat, 22 Oct 2022 15:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=IAXFTLdI1nDiv7sk1T3Id64Vj6NU2663aGsOdelfs34=; b=CEo9kLLafLK8ChRffsFs jRjJL/wfgWCktJvcZuR/5NsY6QCXJJP929ATmvgd3j6zshijpV/W/umanFz5JC2O0vi2/Zz2F5Ie0 UKq4oUkP8hsdtha/C5BshVzrR9tnfMd7QTAX4qFzAi4DD7zVK99wH1al1W3tvecOgqfl2Ed0Fd/bX i/EKVws0mXVRuiP3Cxt/TPtKlDYLmUr+muwLaLu20A6B+4HSCJH3ONgWAfvoSDJMY+WLHGBC8Y1HQ 3Kl1+J65v1MfKDSy0/GDFxjhaYPJs+KxM4OpwrGhgoniRszzhozydhRea7dnB+564MzpFeY1MvS1Y KaI3DoZIYjZHkg==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsO-0003ge-By; Sat, 22 Oct 2022 15:09:44 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:10 +0200 Message-Id: <20221022190930.13086-2-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022190930.13086-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022190930.13086-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches From: Lars-Dominik Braun This removes the need to import (gnu packages python-xyz) in (gnu packages python), avoiding issues with circular imports. * gnu/packages/python.scm (pypy): Move… * gnu/packages/pypy.scm (pypy): …here * gnu/local.mk: Register new file. Co-authored-by: Marius Bakke --- gnu/local.mk | 1 + gnu/packages/pypy.scm | 273 ++++++++++++++++++++++++++++++++++++++++ gnu/packages/python.scm | 170 ------------------------- 3 files changed, 274 insertions(+), 170 deletions(-) create mode 100644 gnu/packages/pypy.scm diff --git a/gnu/local.mk b/gnu/local.mk index 8247180bef..bf598cec8b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -506,6 +506,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/pure.scm \ %D%/packages/purescript.scm \ %D%/packages/pv.scm \ + %D%/packages/pypy.scm \ %D%/packages/python.scm \ %D%/packages/python-build.scm \ %D%/packages/python-check.scm \ diff --git a/gnu/packages/pypy.scm b/gnu/packages/pypy.scm new file mode 100644 index 0000000000..002cfd59cd --- /dev/null +++ b/gnu/packages/pypy.scm @@ -0,0 +1,273 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013 Nikita Karetnikov +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge +;;; Copyright © 2014, 2015 Mark H Weaver +;;; Copyright © 2014, 2017, 2019 Eric Bavier +;;; Copyright © 2014, 2015 Federico Beffa +;;; Copyright © 2015 Omar Radwan +;;; Copyright © 2015 Pierre-Antoine Rault +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus +;;; Copyright © 2015, 2016 Christine Lemmer-Webber +;;; Copyright © 2015 Eric Dvorsak +;;; Copyright © 2015, 2016 David Thompson +;;; Copyright © 2015, 2016, 2017, 2021 Leo Famulari +;;; Copyright © 2015, 2017 Ben Woodcroft +;;; Copyright © 2015, 2016 Erik Edrosa +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner +;;; Copyright © 2015, 2017 Kyle Meyer +;;; Copyright © 2015, 2016 Chris Marusich +;;; Copyright © 2016 Danny Milosavljevic +;;; Copyright © 2016 Lukas Gradl +;;; Copyright © 2016, 2018 Hartmut Goebel +;;; Copyright © 2016 Daniel Pimentel +;;; Copyright © 2016 Sou Bunnbu +;;; Copyright © 2016, 2017 Troy Sankey +;;; Copyright © 2016, 2017 Nikita +;;; Copyright © 2016 Dylan Jeffers +;;; Copyright © 2016 David Craven +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke +;;; Copyright © 2016, 2017 Stefan Reichör +;;; Copyright © 2016 Dylan Jeffers +;;; Copyright © 2016, 2017 Alex Vong +;;; Copyright © 2016, 2017, 2018 Arun Isaac +;;; Copyright © 2016–2018, 2021 Tobias Geerinckx-Rice +;;; Copyright © 2016, 2017, 2018, 2021 Julien Lepiller +;;; Copyright © 2016, 2017 Thomas Danckaert +;;; Copyright © 2017 Carlo Zancanaro +;;; Copyright © 2017 Frederick M. Muriithi +;;; Copyright © 2017, 2018 Adriano Peluso +;;; Copyright © 2017 Ben Sturmfels +;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe +;;; Copyright © 2017 José Miguel Sánchez García +;;; Copyright © 2017 Roel Janssen +;;; Copyright © 2017, 2018 Kei Kebreau +;;; Copyright © 2017 Rutger Helling +;;; Copyright © 2017 Muriithi Frederick Muriuki +;;; Copyright © 2017 Brendan Tildesley +;;; Copyright © 2018 Ethan R. Jones +;;; Copyright © 2018 Vijayalakshmi Vedantham +;;; Copyright © 2018 Mathieu Lirzin +;;; Copyright © 2018 Adam Massmann +;;; Copyright © 2016, 2018 Tomáš Čech +;;; Copyright © 2018 Nicolas Goaziou +;;; Copyright © 2018 Oleg Pykhalov +;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer +;;; Copyright © 2018 Luther Thompson +;;; Copyright © 2018 Vagrant Cascadian +;;; Copyright © 2019 Tanguy Le Carrour +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2021 Greg Hogan +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages pypy) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages certs) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages dbm) + #:use-module (gnu packages hurd) + #:use-module (gnu packages libffi) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages readline) + #:use-module (gnu packages shells) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages tcl) + #:use-module (gnu packages tls) + #:use-module (gnu packages xml) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26)) + +(define-public pypy + (package + (name "pypy") + (version "7.3.5") + (source (origin + (method url-fetch) + (uri (string-append "https://downloads.python.org/pypy/" + "pypy3.7-v" version "-src.tar.bz2")) + (sha256 + (base32 + "18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;FIXME: 43 out of 364 tests are failing + #:modules '((ice-9 ftw) (ice-9 match) + (guix build utils) (guix build gnu-build-system)) + #:disallowed-references (list nss-certs) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("rpython/rlib/clibffi.py") + ;; find_library does not work for libc + (("ctypes\\.util\\.find_library\\('c'\\)") "'libc.so'")) + (substitute* '("lib_pypy/cffi/_pycparser/ply/cpp.py") + ;; Make reproducible (XXX: unused?) + (("time\\.localtime\\(\\)") "time.gmtime(0)")) + (substitute* '("pypy/module/sys/version.py") + ;; Make reproducible + (("t\\.gmtime\\(\\)") "t.gmtime(0)")) + (substitute* '("lib_pypy/_tkinter/tklib_build.py") + ;; Link to versioned libtcl and libtk + (("linklibs = \\['tcl', 'tk'\\]") + "linklibs = ['tcl8.6', 'tk8.6']") + (("incdirs = \\[\\]") + (string-append + "incdirs = ['" + #$(this-package-input "tcl") "/include', '" + #$(this-package-input "tk") "/include']"))) + (substitute* '("lib_pypy/_curses_build.py") + ;; Find curses + (("/usr/local") + #$(this-package-input "ncurses"))) + (substitute* '("lib_pypy/_dbm.py") + ;; Use gdbm compat library, so we don’t need to pull + ;; in bdb. + (("ctypes.util.find_library\\('db'\\)") + (format #f "~s" (search-input-file + inputs "lib/libgdbm_compat.so")))) + (substitute* '("lib_pypy/_sqlite3_build.py") + ;; Always use search paths + (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") + ;; Find sqlite3 + (("/usr/local") (assoc-ref inputs "sqlite")) + (("libname = 'sqlite3'") + (format #f "libname = ~s" + (search-input-file inputs "lib/libsqlite3.so.0")))) + (substitute* '("lib-python/3/subprocess.py") + ;; Fix shell path + (("/bin/sh") + (search-input-file inputs "/bin/sh"))) + (substitute* '("lib-python/3/distutils/unixccompiler.py") + ;; gcc-toolchain does not provide symlink cc -> gcc + (("\"cc\"") "\"gcc\"")))) + (add-after 'unpack 'set-source-file-times-to-1980 + ;; copied from python package, required by zip testcase + (lambda _ + (let ((circa-1980 (* 10 366 24 60 60))) + (ftw "." (lambda (file stat flag) + (utime file circa-1980 circa-1980) + #t))))) + (replace 'build + (lambda _ + (with-directory-excursion "pypy/goal" + ;; Build with jit optimization. + (invoke "python2" + "../../rpython/bin/rpython" + (string-append "--make-jobs=" + (number->string (parallel-job-count))) + "-Ojit" + "targetpypystandalone" + "--allworkingmodules")) + ;; Build c modules and package everything, so tests work. + (with-directory-excursion "pypy/tool/release" + (invoke "python2" "package.py" + "--archive-name" "pypy-dist" + "--builddir" (getcwd))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (begin + (setenv "HOME" "/tmp") ; test_with_pip tries to + ; access ~/.cache/pip + ;; Run library tests only (no interpreter unit tests). + ;; This is what Gentoo does. + (invoke "python" "pypy/test_all.py" + "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" + "lib-python")) + (format #t "test suite not run~%")))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((bin-pypy3 (string-append #$output "/bin/pypy3")) + (shebang-match-python "#!.+/bin/python") + (shebang-pypy3 (string-append "#!" bin-pypy3)) + (dist-dir "pypy/tool/release/pypy-dist")) + (with-directory-excursion dist-dir + ;; Delete test data. + (for-each + (lambda (x) + (delete-file-recursively (string-append + "lib-python/3/" x))) + '("tkinter/test" + "test" + "sqlite3/test" + "lib2to3/tests" + "idlelib/idle_test" + "distutils/tests" + "ctypes/test" + "unittest/test")) + ;; Patch shebang referencing python. + (substitute* '("lib-python/3/cgi.py" + "lib-python/3/encodings/rot_13.py") + ((shebang-match-python) shebang-pypy3)) + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute* '("lib_pypy/_md5.py" + "lib_pypy/_sha1.py") + ((shebang-match-python) shebang-pypy3)))) + (copy-recursively dist-dir #$output))))))) + (native-inputs + (list gzip + nss-certs ; For ssl tests + pkg-config + python-2 + python2-pycparser + tar)) ; Required for package.py + (inputs + (list bzip2 + expat + gdbm + glibc + libffi + ncurses + openssl + sqlite + tcl + tk + xz + zlib)) + (home-page "https://www.pypy.org/") + (synopsis "Python implementation with just-in-time compilation") + (description "PyPy is a faster, alternative implementation of the Python +programming language employing a just-in-time compiler. It supports most +Python code natively, including C extensions.") + (license (list license:expat ; pypy itself; _pytest/ + license:psfl ; python standard library in lib-python/ + license:asl2.0 ; dotviewer/font/ and some of lib-python/ + license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* + license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ + (license:non-copyleft + "http://www.unicode.org/copyright.html"))))) + +(define-public pypy3 + (deprecated-package "pypy3" pypy)) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e31158dfc0..00c3eb7774 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -81,17 +81,13 @@ (define-module (gnu packages python) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages bash) - #:use-module (gnu packages certs) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages dbm) #:use-module (gnu packages hurd) #:use-module (gnu packages libffi) - #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) - #:use-module (gnu packages shells) #:use-module (gnu packages sqlite) #:use-module (gnu packages tcl) #:use-module (gnu packages tls) @@ -736,169 +732,3 @@ (define-public micropython compatible with normal Python as possible to allow you to transfer code with ease from the desktop to a microcontroller or embedded system.") (license license:expat))) - -(define-public pypy - (package - (name "pypy") - (version "7.3.5") - (source (origin - (method url-fetch) - (uri (string-append "https://downloads.python.org/pypy/" - "pypy3.7-v" version "-src.tar.bz2")) - (sha256 - (base32 - "18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r")))) - (build-system gnu-build-system) - (arguments - (list - #:tests? #f ;FIXME: 43 out of 364 tests are failing - #:modules '((ice-9 ftw) (ice-9 match) - (guix build utils) (guix build gnu-build-system)) - #:disallowed-references (list nss-certs) - #:phases - #~(modify-phases %standard-phases - (delete 'configure) - (add-after 'unpack 'patch-source - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("rpython/rlib/clibffi.py") - ;; find_library does not work for libc - (("ctypes\\.util\\.find_library\\('c'\\)") "'libc.so'")) - (substitute* '("lib_pypy/cffi/_pycparser/ply/cpp.py") - ;; Make reproducible (XXX: unused?) - (("time\\.localtime\\(\\)") "time.gmtime(0)")) - (substitute* '("pypy/module/sys/version.py") - ;; Make reproducible - (("t\\.gmtime\\(\\)") "t.gmtime(0)")) - (substitute* '("lib_pypy/_tkinter/tklib_build.py") - ;; Link to versioned libtcl and libtk - (("linklibs = \\['tcl', 'tk'\\]") - "linklibs = ['tcl8.6', 'tk8.6']") - (("incdirs = \\[\\]") - (string-append - "incdirs = ['" - #$(this-package-input "tcl") "/include', '" - #$(this-package-input "tk") "/include']"))) - (substitute* '("lib_pypy/_curses_build.py") - ;; Find curses - (("/usr/local") - #$(this-package-input "ncurses"))) - (substitute* '("lib_pypy/_dbm.py") - ;; Use gdbm compat library, so we don’t need to pull - ;; in bdb. - (("ctypes.util.find_library\\('db'\\)") - (format #f "~s" (search-input-file - inputs "lib/libgdbm_compat.so")))) - (substitute* '("lib_pypy/_sqlite3_build.py") - ;; Always use search paths - (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") - ;; Find sqlite3 - (("/usr/local") (assoc-ref inputs "sqlite")) - (("libname = 'sqlite3'") - (format #f "libname = ~s" - (search-input-file inputs "lib/libsqlite3.so.0")))) - (substitute* '("lib-python/3/subprocess.py") - ;; Fix shell path - (("/bin/sh") - (search-input-file inputs "/bin/sh"))) - (substitute* '("lib-python/3/distutils/unixccompiler.py") - ;; gcc-toolchain does not provide symlink cc -> gcc - (("\"cc\"") "\"gcc\"")))) - (add-after 'unpack 'set-source-file-times-to-1980 - ;; copied from python package, required by zip testcase - (lambda _ - (let ((circa-1980 (* 10 366 24 60 60))) - (ftw "." (lambda (file stat flag) - (utime file circa-1980 circa-1980) - #t))))) - (replace 'build - (lambda _ - (with-directory-excursion "pypy/goal" - ;; Build with jit optimization. - (invoke "python2" - "../../rpython/bin/rpython" - (string-append "--make-jobs=" - (number->string (parallel-job-count))) - "-Ojit" - "targetpypystandalone" - "--allworkingmodules")) - ;; Build c modules and package everything, so tests work. - (with-directory-excursion "pypy/tool/release" - (invoke "python2" "package.py" - "--archive-name" "pypy-dist" - "--builddir" (getcwd))))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (if tests? - (begin - (setenv "HOME" "/tmp") ; test_with_pip tries to - ; access ~/.cache/pip - ;; Run library tests only (no interpreter unit tests). - ;; This is what Gentoo does. - (invoke "python" "pypy/test_all.py" - "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" - "lib-python")) - (format #t "test suite not run~%")))) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((bin-pypy3 (string-append #$output "/bin/pypy3")) - (shebang-match-python "#!.+/bin/python") - (shebang-pypy3 (string-append "#!" bin-pypy3)) - (dist-dir "pypy/tool/release/pypy-dist")) - (with-directory-excursion dist-dir - ;; Delete test data. - (for-each - (lambda (x) - (delete-file-recursively (string-append - "lib-python/3/" x))) - '("tkinter/test" - "test" - "sqlite3/test" - "lib2to3/tests" - "idlelib/idle_test" - "distutils/tests" - "ctypes/test" - "unittest/test")) - ;; Patch shebang referencing python. - (substitute* '("lib-python/3/cgi.py" - "lib-python/3/encodings/rot_13.py") - ((shebang-match-python) shebang-pypy3)) - (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute* '("lib_pypy/_md5.py" - "lib_pypy/_sha1.py") - ((shebang-match-python) shebang-pypy3)))) - (copy-recursively dist-dir #$output))))))) - (native-inputs - (list gzip - nss-certs ; For ssl tests - pkg-config - python-2 - python2-pycparser - tar)) ; Required for package.py - (inputs - (list bzip2 - expat - gdbm - glibc - libffi - ncurses - openssl - sqlite - tcl - tk - xz - zlib)) - (home-page "https://www.pypy.org/") - (synopsis "Python implementation with just-in-time compilation") - (description "PyPy is a faster, alternative implementation of the Python -programming language employing a just-in-time compiler. It supports most -Python code natively, including C extensions.") - (license (list license:expat ; pypy itself; _pytest/ - license:psfl ; python standard library in lib-python/ - license:asl2.0 ; dotviewer/font/ and some of lib-python/ - license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* - license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ - (license:non-copyleft - "http://www.unicode.org/copyright.html"))))) - -(define-public pypy3 - (deprecated-package "pypy3" pypy)) From patchwork Sat Oct 22 19:09:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43826 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 C099727BBEA; Mon, 24 Oct 2022 01:00:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 DD1EA27BBE9 for ; Mon, 24 Oct 2022 01:00:07 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjDK-000741-QL for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:13:02 -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 1omJsi-00080k-9G for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:04 -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 1omJsh-0004gU-Td for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJsh-0003LM-Oy for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 03/22] gnu: python-pip: Move to (gnu packages python-build). Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646579812821 (code B ref 58587); Sat, 22 Oct 2022 19:10:03 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:09:58 +0000 Received: from localhost ([127.0.0.1]:42358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsc-0003Ki-G3 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsa-0003KN-Pv for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:57 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsV-0004X2-K7 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=K4MJRIUhkpDFagll/aR/A9WakT+wr9pPRiSQzD38fkk=; b=PErYlZvcDHQVH/SHpis6 f+BAheZp4mikx0MTUySn4gUFaX+VNTNlIUJBiZuOSc5DYeFLJIBFQDlxXQ09umCwDXmOyonY0qLcN mFhXZZR8CBLg/NDle5Z05bUM8lUHSpD/fjVhOYrfDQqrCizQQI5RE447CPFsej+BC/H1gJiHDnzV/ CQyIvVr7J5h6xUcSEfCvfiJ97M4glohTc3OKR8I3EFqf49JpH5QVlPpQyidyHhNzigd4pzMqXfEGa SYRYhvrl/NwslY9N+EeXw5A6owlEl89rB1NLGfqIydwy+kieoXkxXabbgrY7r/zV7Dag6QFH6Sk7B Z6FrT0p7Ot7QaQ==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsV-0003i4-8e for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:51 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:11 +0200 Message-Id: <20221022190930.13086-3-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022190930.13086-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022190930.13086-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-pip): Move from here ... * gnu/packages/python-build.scm (python-pip): ... to here. --- gnu/packages/python-build.scm | 21 +++++++++++++++++++++ gnu/packages/python-xyz.scm | 21 --------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm index 3ff988820f..c8f57ea286 100644 --- a/gnu/packages/python-build.scm +++ b/gnu/packages/python-build.scm @@ -41,6 +41,27 @@ (define-module (gnu packages python-build) ;;; ;;; Code: +(define-public python-pip + (package + (name "python-pip") + (version "22.2.2") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pip" version)) + (sha256 + (base32 + "0jwac0bhfp48w4fqibf1ysrs2grksdv92hwqm7bmdw2jn2fr5l9z")))) + (build-system python-build-system) + (arguments + '(#:tests? #f)) ; there are no tests in the pypi archive. + (home-page "https://pip.pypa.io/") + (synopsis "Package manager for Python software") + (description + "Pip is a package manager for Python software, that finds packages on the +Python Package Index (PyPI).") + (license license:expat))) + (define-public python-setuptools (package (name "python-setuptools") diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 3ea29ec3b9..1ded6f0384 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -12650,27 +12650,6 @@ (define-public python-pretend responses, rather than doing any computation.") (license license:bsd-3))) -(define-public python-pip - (package - (name "python-pip") - (version "22.2.2") - (source - (origin - (method url-fetch) - (uri (pypi-uri "pip" version)) - (sha256 - (base32 - "0jwac0bhfp48w4fqibf1ysrs2grksdv92hwqm7bmdw2jn2fr5l9z")))) - (build-system python-build-system) - (arguments - '(#:tests? #f)) ; there are no tests in the pypi archive. - (home-page "https://pip.pypa.io/") - (synopsis "Package manager for Python software") - (description - "Pip is a package manager for Python software, that finds packages on the -Python Package Index (PyPI).") - (license license:expat))) - ;;; Variant used to break a dependency cycle with ;;; python-pytest-perf-bootstrap. (define-public python-pip-run-bootstrap From patchwork Sat Oct 22 19:09:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43961 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 2D4A627BBEA; Mon, 24 Oct 2022 04:39:15 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 E91FB27BBE9 for ; Mon, 24 Oct 2022 04:39:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjEC-0007Cd-HG for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:13:56 -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 1omJtf-00088Y-AF for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:03 -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 1omJte-0004z3-Pj for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJte-0003NV-Jz for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 04/22] build-system: Add pyproject-build-system. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646581012888 (code B ref 58587); Sat, 22 Oct 2022 19:11:02 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:10:10 +0000 Received: from localhost ([127.0.0.1]:42365 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsl-0003Lm-TB for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsi-0003Kq-Gp for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsd-0004XS-B9; Sat, 22 Oct 2022 15:09:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=LqMe4d64lL1vzak1feIMR73uYwWgFb/VZo3Auw4ghw4=; b=YTl0YyOnSgRK9qJ75oi4 /7YBZRrB0bXQoGpPTWv/ujwfIJpnBDA0ZDISxavCUIkizzeDlmeoNBfDdeoQDY1XdBKb8s8TIY/jB U246xUTPOb9KUF4BkePuT/CawSMOMitK+w2FI6MellsZqQzY56V7haPmpE4S2bKrqrw+RqbEQavXW AeLQJZAQMsUuJSzCMWL61cbKADjBO8fy2dZPvLi3Hm/OcG323XcIZ/E7bZUCmJPOa1H5zSSqbpWbf 8UDEWUCqYmtLew+5LlDg/VVJNqVZ1LJZeCwJlRUXokLhU5c6kqWdFjuZpWiwdcKNgIV+k4BqNzKYL ZcdI+QOQ86NTqQ==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsc-0003iN-EG; Sat, 22 Oct 2022 15:09:59 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:12 +0200 Message-Id: <20221022190930.13086-4-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022190930.13086-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022190930.13086-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches From: Lars-Dominik Braun This is an experimental build system based on python-build-system that implements PEP 517-compliant builds. * doc/guix.texi (Build Systems): Add pyproject-build-system section. * doc/contributing.texi (Python Modules): Mention pyproject.toml and the PYTHON-TOOLCHAIN package, as well as differences to python-build-system. * guix/build-system/pyproject.scm, guix/build/pyproject-build-system.scm, gnu/packages/aux-files/python/sanity-check-next.py, gnu/packages/python-commencement.scm: New files. * Makefile.am (MODULES): Register the new build systems. * gnu/local.mk (GNU_SYSTEM_MODULES): Add python-commencement.scm. * gnu/packages/python.scm (python-sans-pip, python-sans-pip-wrapper): New variables. Co-authored-by: Marius Bakke --- Makefile.am | 2 + doc/contributing.texi | 36 +- doc/guix.texi | 29 ++ .../aux-files/python/sanity-check-next.py | 98 +++++ gnu/packages/python.scm | 52 ++- guix/build-system/pyproject.scm | 148 +++++++ guix/build/pyproject-build-system.scm | 367 ++++++++++++++++++ 7 files changed, 723 insertions(+), 9 deletions(-) create mode 100644 gnu/packages/aux-files/python/sanity-check-next.py create mode 100644 guix/build-system/pyproject.scm create mode 100644 guix/build/pyproject-build-system.scm diff --git a/Makefile.am b/Makefile.am index 22dcc43f99..6ccb790c11 100644 --- a/Makefile.am +++ b/Makefile.am @@ -166,6 +166,7 @@ MODULES = \ guix/build-system/maven.scm \ guix/build-system/node.scm \ guix/build-system/perl.scm \ + guix/build-system/pyproject.scm \ guix/build-system/python.scm \ guix/build-system/renpy.scm \ guix/build-system/ocaml.scm \ @@ -222,6 +223,7 @@ MODULES = \ guix/build/minetest-build-system.scm \ guix/build/node-build-system.scm \ guix/build/perl-build-system.scm \ + guix/build/pyproject-build-system.scm \ guix/build/python-build-system.scm \ guix/build/ocaml-build-system.scm \ guix/build/qt-build-system.scm \ diff --git a/doc/contributing.texi b/doc/contributing.texi index 4b1eed1cb1..c3221d23e4 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -786,12 +786,29 @@ for instance, the module python-dateutil is packaged under the names starts with @code{py} (e.g.@: @code{pytz}), we keep it and prefix it as described above. +@quotation Note +Currently there are two different build systems for Python packages in Guix: +@var{python-build-system} and @var{pyproject-build-system}. For the +longest time, Python packages were built from an informally specified +@file{setup.py} file. That worked amazingly well, considering Python's +success, but was difficult to build tooling around. As a result, a host +of alternative build systems emerged and the community eventually settled on a +@url{https://peps.python.org/pep-0517/, formal standard} for specifying build +requirements. @var{pyproject-build-system} is Guix's implementation of this +standard. It is considered ``experimental'' in that it does not yet support +all the various PEP-517 @emph{build backends}, but you are encouraged to try +it for new Python packages and report any problems. It will eventually be +deprecated and merged into @var{python-build-system}. +@end quotation + @subsubsection Specifying Dependencies @cindex inputs, for Python packages Dependency information for Python packages is usually available in the package source tree, with varying degrees of accuracy: in the -@file{setup.py} file, in @file{requirements.txt}, or in @file{tox.ini}. +@file{pyproject.toml} file, the @file{setup.py} file, in +@file{requirements.txt}, or in @file{tox.ini} (the latter mostly for +test dependencies). Your mission, when writing a recipe for a Python package, is to map these dependencies to the appropriate type of ``input'' (@pxref{package @@ -802,10 +819,12 @@ following check list to determine which dependency goes where. @itemize @item -We currently package Python 2 with @code{setuptools} and @code{pip} -installed like Python 3.4 has per default. Thus you don't need to -specify either of these as an input. @command{guix lint} will warn you -if you do. +We currently package Python with @code{setuptools} and @code{pip} +installed per default. This is about to change, and users are encouraged +to use @code{python-toolchain} if they want a build environment for Python. + +@command{guix lint} will warn if @code{setuptools} or @code{pip} are +added as native-inputs because they are generally not necessary. @item Python dependencies required at run time go into @@ -814,9 +833,10 @@ Python dependencies required at run time go into @file{requirements.txt} file. @item -Python packages required only at build time---e.g., those listed with -the @code{setup_requires} keyword in @file{setup.py}---or only for -testing---e.g., those in @code{tests_require}---go into +Python packages required only at build time---e.g., those listed under +@code{build-system.requires} in @file{pyproject.toml} or with the +@code{setup_requires} keyword in @file{setup.py}---or dependencies only +for testing---e.g., those in @code{tests_require} or @file{tox.ini}---go into @code{native-inputs}. The rationale is that (1) they do not need to be propagated because they are not needed at run time, and (2) in a cross-compilation context, it's the ``native'' input that we'd want. diff --git a/doc/guix.texi b/doc/guix.texi index f0fb383005..621f9923b4 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -9311,7 +9311,36 @@ instead of the default @code{"out"} output. This is useful for packages that include a Python package as only a part of the software, and thus want to combine the phases of @code{python-build-system} with another build system. Python bindings are a common usecase. +@end defvr + +@defvr {Scheme Variable} pyproject-build-system +This is a variable exported by @code{guix build-system pyproject}. It +is based on of @var{python-build-system}, and adds support for +@file{pyproject.toml} and @url{https://peps.python.org/pep-0517/, PEP 517}. +It also supports a variety of build backends and test frameworks. + +The API is slightly different from @var{python-build-system}: +@enumerate +@item +@code{#:use-setuptools?} and @code{#:test-target} is removed. +@item +@code{#:build-backend} is added. It defaults to @code{#false} and will try +to guess the appropriate backend based on @file{pyproject.toml}. +@item +@code{#:test-backend} is added. It defaults to @code{#false} and will guess +an appropriate test backend based on what is available in package inputs. +@item +@code{#:test-flags} is added. The default is @code{#false}, and varies based +on the detected @code{#:test-backend}. +@end enumerate + +It is considered ``experimental'' in that the implementation details are +not set in stone yet, however users are encouraged to try it for new +Python projects (even those using @file{setup.py}). The API is subject to +change, but any breaking changes in the Guix channel will be dealt with. +Eventually this build system will be deprecated and merged back into +@var{python-build-system}, probably some time in 2024. @end defvr @defvr {Scheme Variable} perl-build-system diff --git a/gnu/packages/aux-files/python/sanity-check-next.py b/gnu/packages/aux-files/python/sanity-check-next.py new file mode 100644 index 0000000000..891606f72b --- /dev/null +++ b/gnu/packages/aux-files/python/sanity-check-next.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- + +# This version adds a small change to accomodate missing python-setuptools. +# Original patch by Lars-Dominik Braun in wip-python-pep517, commit +# 720dbe22d431262938be29dd9a9ddb78c44a99b3. +# --- sanity-check.py 2022-06-12 14:40:06.814337702 +0200 +# +++ sanity-check.py 2022-10-16 23:21:38.990651568 +0200 +# @@ -19,9 +19,13 @@ +# from __future__ import print_function # Python 2 support. +# import importlib +# -import pkg_resources +# import sys +# import traceback +# +try: +# + import pkg_resources +# +except ImportError: +# + print('Warning: Skipping, because python-setuptools are not available.') +# + sys.exit(0) + +# TODO: Merge with sanity-check.py in the next core-updates cycle. + +from __future__ import print_function # Python 2 support. +import importlib +import sys +import traceback +try: + import pkg_resources +except ImportError: + print('Warning: Skipping, because python-setuptools are not available.') + sys.exit(0) + +try: + from importlib.machinery import PathFinder +except ImportError: + PathFinder = None + +ret = 0 + +# Only check site-packages installed by this package, but not dependencies +# (which pkg_resources.working_set would include). Path supplied via argv. +ws = pkg_resources.find_distributions(sys.argv[1]) + +for dist in ws: + print('validating', repr(dist.project_name), dist.location) + try: + print('...checking requirements: ', end='') + req = str(dist.as_requirement()) + # dist.activate() is not enough to actually check requirements, we + # have to .require() it. + pkg_resources.require(req) + print('OK') + except Exception as e: + print('ERROR:', req, repr(e)) + ret = 1 + continue + + # Try to load top level modules. This should not have any side-effects. + try: + metalines = dist.get_metadata_lines('top_level.txt') + except (KeyError, EnvironmentError): + # distutils (i.e. #:use-setuptools? #f) will not install any metadata. + # This file is also missing for packages built using a PEP 517 builder + # such as poetry. + print('WARNING: cannot determine top-level modules') + continue + for name in metalines: + # Only available on Python 3. + if PathFinder and PathFinder.find_spec(name) is None: + # Ignore unavailable modules, often C modules, which were not + # installed at the top-level. Cannot use ModuleNotFoundError, + # because it is raised by failed imports too. + continue + try: + print('...trying to load module', name, end=': ') + importlib.import_module(name) + print('OK') + except Exception: + print('ERROR:') + traceback.print_exc(file=sys.stdout) + ret = 1 + + # Try to load entry points of console scripts too, making sure they + # work. They should be removed if they don't. Other groups may not be + # safe, as they can depend on optional packages. + for group, v in dist.get_entry_map().items(): + if group not in {'console_scripts', 'gui_scripts'}: + continue + for name, ep in v.items(): + try: + print('...trying to load endpoint', group, name, end=': ') + ep.load() + print('OK') + except Exception: + print('ERROR:') + traceback.print_exc(file=sys.stdout) + ret = 1 + +sys.exit(ret) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 00c3eb7774..f55e5a16da 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -26,7 +26,7 @@ ;;; Copyright © 2016, 2017 Nikita ;;; Copyright © 2016 Dylan Jeffers ;;; Copyright © 2016 David Craven -;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke +;;; Copyright © 2016-2022 Marius Bakke ;;; Copyright © 2016, 2017 Stefan Reichör ;;; Copyright © 2016, 2017 Alex Vong ;;; Copyright © 2016, 2017, 2018 Arun Isaac @@ -60,6 +60,7 @@ ;;; Copyright © 2020, 2021 Greg Hogan ;;; Copyright © 2022 Philip McGrath ;;; Copyright © 2022 jgart +;;; Copyright © 2021 Lars-Dominik Braun ;;; ;;; This file is part of GNU Guix. ;;; @@ -87,6 +88,7 @@ (define-module (gnu packages python) #:use-module (gnu packages hurd) #:use-module (gnu packages libffi) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python-build) #:use-module (gnu packages readline) #:use-module (gnu packages sqlite) #:use-module (gnu packages tcl) @@ -674,6 +676,54 @@ (define* (wrap-python3 python (define-public python-wrapper (wrap-python3 python)) (define-public python-minimal-wrapper (wrap-python3 python-minimal)) +;; The Python used in pyproject-build-system. +(define-public python-sans-pip + (hidden-package + (package/inherit python + (arguments + (substitute-keyword-arguments (package-arguments python) + ((#:configure-flags flags #~()) + #~(append '("--with-ensurepip=no") + (delete "--with-ensurepip=install" #$flags)))))))) + +(define-public python-sans-pip-wrapper + (wrap-python3 python-sans-pip)) + +(define-public python-toolchain + (package + (name "python-toolchain") + (version (package-version python)) + (source #f) + (build-system trivial-build-system) + (arguments + (list #:modules '((guix build union)) + #:builder + #~(begin + (use-modules (ice-9 match) + (srfi srfi-1) + (guix build union)) + (union-build #$output + (filter-map (match-lambda + ((_ . directory) directory)) + %build-inputs))))) + (inputs + (list python-sans-pip-wrapper + python-pip + python-pypa-build + python-setuptools + python-wheel)) + (native-search-paths + (package-native-search-paths python)) + (search-paths + (package-search-paths python)) + (license (package-license python)) + (synopsis "Python toolchain") + (description + "Python toolchain including Python itself, setuptools and pip. Use this +package if you need a minimal Python toolchain instead of just the +interpreter.") + (home-page (package-home-page python)))) + (define-public micropython (package (name "micropython") diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm new file mode 100644 index 0000000000..d6b727ab5d --- /dev/null +++ b/guix/build-system/pyproject.scm @@ -0,0 +1,148 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Lars-Dominik Braun +;;; Copyright © 2022 Marius Bakke +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build-system pyproject) + #:use-module ((gnu packages) #:select (search-auxiliary-file)) + #:use-module (guix gexp) + #:use-module (guix store) + #:use-module (guix utils) + #:use-module (guix memoization) + #:use-module (guix gexp) + #:use-module (guix monads) + #:use-module (guix packages) + #:use-module (guix derivations) + #:use-module (guix search-paths) + #:use-module (guix build-system) + #:use-module (guix build-system gnu) + #:use-module (guix build-system python) + #:use-module (ice-9 match) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:export (%pyproject-build-system-modules + default-python + pyproject-build + pyproject-build-system)) + +;; Commentary: +;; +;; Standard build procedure for Python packages using 'pyproject.toml'. +;; This is implemented as an extension of 'python-build-system'. +;; +;; Code: + +(define %pyproject-build-system-modules + ;; Build-side modules imported by default. + `((guix build pyproject-build-system) + (guix build json) + ,@%python-build-system-modules + ,@%gnu-build-system-modules)) + +(define (default-python) + "Return the default Python package." + ;; Lazily resolve the binding to avoid a circular dependency. + (let ((python (resolve-interface '(gnu packages python)))) + (module-ref python 'python-toolchain))) + +(define sanity-check.py + ;; TODO: Merge with sanity-check.py in the next rebuild cycle. + (search-auxiliary-file "python/sanity-check-next.py")) + +(define* (lower name + #:key source inputs native-inputs outputs system target + (python (default-python)) + #:allow-other-keys + #:rest arguments) + "Return a bag for NAME." + (define private-keywords + '(#:target #:python #:inputs #:native-inputs)) + + (and (not target) ;XXX: no cross-compilation + (bag + (name name) + (system system) + (host-inputs `(,@(if source + `(("source" ,source)) + '()) + ,@inputs + + ;; Keep the standard inputs of 'gnu-build-system'. + ,@(standard-packages))) + (build-inputs `(("python" ,python) + ("sanity-check.py" ,(local-file sanity-check.py)) + ,@native-inputs)) + (outputs (append outputs '(wheel))) + (build pyproject-build) + (arguments (strip-keyword-arguments private-keywords arguments))))) + +(define* (pyproject-build name inputs + #:key source + (tests? #t) + (configure-flags ''()) + (build-backend #f) + (test-backend #f) + (test-flags #f) + (phases '%standard-phases) + (outputs '("out" "wheel")) + (search-paths '()) + (system (%current-system)) + (guile #f) + (imported-modules %pyproject-build-system-modules) + (modules '((guix build pyproject-build-system) + (guix build utils)))) + "Build SOURCE using PYTHON, and with INPUTS." + (define build + (with-imported-modules imported-modules + #~(begin + (use-modules #$@(sexp->gexp modules)) + + #$(with-build-variables inputs outputs + #~(pyproject-build + #:name #$name + #:source #+source + #:configure-flags #$configure-flags + #:system #$system + #:build-backend #$build-backend + #:test-backend #$test-backend + #:test-flags #$test-flags + #:tests? #$tests? + #:phases #$(if (pair? phases) + (sexp->gexp phases) + phases) + #:outputs %outputs + #:search-paths '#$(sexp->gexp + (map search-path-specification->sexp + search-paths)) + #:inputs %build-inputs))))) + + + (mlet %store-monad ((guile (package->derivation (or guile (default-guile)) + system #:graft? #f))) + (gexp->derivation name build + #:system system + #:graft? #f ;consistent with 'gnu-build' + #:target #f + #:guile-for-build guile))) + +(define pyproject-build-system + (build-system + (name 'pyproject) + (description "The PEP517-compliant Python build system") + (lower lower))) + +;;; pyproject.scm ends here diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-build-system.scm new file mode 100644 index 0000000000..16a6db9537 --- /dev/null +++ b/guix/build/pyproject-build-system.scm @@ -0,0 +1,367 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2021 Lars-Dominik Braun +;;; Copyright © 2022 Marius Bakke +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix build pyproject-build-system) + #:use-module ((guix build python-build-system) #:prefix python:) + #:use-module (guix build utils) + #:use-module (guix build json) + #:use-module (ice-9 match) + #:use-module (ice-9 ftw) + #:use-module (ice-9 format) + #:use-module (ice-9 rdelim) + #:use-module (ice-9 regex) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) + #:export (%standard-phases + add-installed-pythonpath + site-packages + python-version + pyproject-build)) + +;;; Commentary: +;;; +;;; PEP 517-compatible build system for Python packages. +;;; +;;; PEP 517 mandates the use of a TOML file called pyproject.toml at the +;;; project root, describing build and runtime dependencies, as well as the +;;; build system, which can be different from setuptools. This module uses +;;; that file to extract the build system used and call its wheel-building +;;; entry point build_wheel (see 'build). setuptools’ wheel builder is +;;; used as a fallback if either no pyproject.toml exists or it does not +;;; declare a build-system. It supports config_settings through the +;;; standard #:configure-flags argument. +;;; +;;; This wheel, which is just a ZIP file with a file structure defined +;;; by PEP 427 (https://www.python.org/dev/peps/pep-0427/), is then unpacked +;;; and its contents are moved to the appropriate locations in 'install. +;;; +;;; Then entry points, as defined by the PyPa Entry Point Specification +;;; (https://packaging.python.org/specifications/entry-points/) are read +;;; from a file called entry_points.txt in the package’s site-packages +;;; subdirectory and scripts are written to bin/. These are not part of a +;;; wheel and expected to be created by the installing utility. +;;; TODO: Add support for PEP-621 entry points. +;;; +;;; Caveats: +;;; - There is no support for in-tree build backends. +;;; +;;; Code: +;;; + +;; Re-export these variables from python-build-system as many packages +;; rely on these. +(define python-version python:python-version) +(define site-packages python:site-packages) +(define add-installed-pythonpath python:add-installed-pythonpath) + +;; Base error type. +(define-condition-type &python-build-error &error + python-build-error?) + +;; Raised when 'check cannot find a valid test system in the inputs. +(define-condition-type &test-system-not-found &python-build-error + test-system-not-found?) + +;; Raised when multiple wheels are created by 'build. +(define-condition-type &cannot-extract-multiple-wheels &python-build-error + cannot-extract-multiple-wheels?) + +;; Raised, when no wheel has been built by the build system. +(define-condition-type &no-wheels-built &python-build-error + no-wheels-built?) + +(define* (build #:key outputs build-backend configure-flags #:allow-other-keys) + "Build a given Python package." + + (define (pyproject.toml->build-backend file) + "Look up the build backend in a pyproject.toml file." + (call-with-input-file file + (lambda (in) + (let loop ((line (read-line in 'concat))) + (if (eof-object? line) + #f + (let ((m (string-match "build-backend = [\"'](.+)[\"']" line))) + (if m (match:substring m 1) + (loop (read-line in 'concat))))))))) + + (let* ((wheel-output (assoc-ref outputs "wheel")) + (wheel-dir (if wheel-output wheel-output "dist")) + ;; There is no easy way to get data from Guile into Python via + ;; s-expressions, but we have JSON serialization already, which Python + ;; also supports out-of-the-box. + (config-settings (call-with-output-string (cut write-json configure-flags <>))) + ;; python-setuptools’ default backend supports setup.py *and* + ;; pyproject.toml. Allow overriding this automatic detection via + ;; build-backend. + (auto-build-backend (if (file-exists? "pyproject.toml") + (pyproject.toml->build-backend "pyproject.toml") + #f)) + ;; Use build system detection here and not in importer, because a) we + ;; have alot of legacy packages and b) the importer cannot update arbitrary + ;; fields in case a package switches its build system. + (use-build-backend (or + build-backend + auto-build-backend + "setuptools.build_meta"))) + (format #t "Using '~a' to build wheels, auto-detected '~a', override '~a'.~%" + use-build-backend auto-build-backend build-backend) + (mkdir-p wheel-dir) + ;; Call the PEP 517 build function, which drops a .whl into wheel-dir. + (invoke "python" "-c" "import sys, importlib, json +config_settings = json.loads (sys.argv[3]) +builder = importlib.import_module(sys.argv[1]) +builder.build_wheel(sys.argv[2], config_settings=config_settings)" + use-build-backend wheel-dir config-settings))) + +(define* (check #:key inputs outputs tests? test-backend test-flags #:allow-other-keys) + "Run the test suite of a given Python package." + (if tests? + ;; Unfortunately with PEP 517 there is no common method to specify test + ;; systems. Guess test system based on inputs instead. + (let* ((pytest (which "pytest")) + (nosetests (which "nosetests")) + (nose2 (which "nose2")) + (have-setup-py (file-exists? "setup.py")) + (use-test-backend + (or + test-backend + ;; Prefer pytest + (if pytest 'pytest #f) + (if nosetests 'nose #f) + (if nose2 'nose2 #f) + ;; But fall back to setup.py, which should work for most + ;; packages. XXX: would be nice not to depend on setup.py here? fails + ;; more often than not to find any tests at all. Maybe we can run + ;; `python -m unittest`? + (if have-setup-py 'setup.py #f)))) + (format #t "Using ~a~%" use-test-backend) + (match use-test-backend + ('pytest + (apply invoke (cons pytest (or test-flags '("-vv"))))) + ('nose + (apply invoke (cons nosetests (or test-flags '("-v"))))) + ('nose2 + (apply invoke (cons nose2 (or test-flags '("-v" "--pretty-assert"))))) + ('setup.py + (apply invoke (append '("python" "setup.py") (or test-flags '("test" "-v"))))) + ;; The developer should explicitly disable tests in this case. + (else (raise (condition (&test-system-not-found)))))) + (format #t "test suite not run~%"))) + +(define* (install #:key inputs outputs (configure-flags '()) #:allow-other-keys) + "Install a wheel file according to PEP 427" + ;; See https://www.python.org/dev/peps/pep-0427/#installing-a-wheel-distribution-1-0-py32-none-any-whl + (let* ((site-dir (site-packages inputs outputs)) + (python (assoc-ref inputs "python")) + (out (assoc-ref outputs "out"))) + (define (extract file) + "Extract wheel (ZIP file) into site-packages directory" + ;; Use Python’s zipfile to avoid extra dependency + (invoke "python" "-m" "zipfile" "-e" file site-dir)) + + (define python-hashbang + (string-append "#!" python "/bin/python")) + + (define* (merge-directories source destination #:optional (post-move #f)) + "Move all files in SOURCE into DESTINATION, merging the two directories." + (format #t "Merging directory ~a into ~a~%" source destination) + (for-each + (lambda (file) + (format #t "~a/~a -> ~a/~a~%" source file destination file) + (mkdir-p destination) + (rename-file + (string-append source "/" file) + (string-append destination "/" file)) + (when post-move + (post-move file))) + (scandir source (negate (cut member <> '("." ".."))))) + (rmdir source)) + + (define (expand-data-directory directory) + "Move files from all .data subdirectories to their respective +destinations." + ;; Python’s distutils.command.install defines this mapping from source to + ;; destination mapping. + (let ((source (string-append directory "/scripts")) + (destination (string-append out "/bin"))) + (when (file-exists? source) + (merge-directories + source + destination + (lambda (f) + (let ((dest-path (string-append destination "/" f))) + (chmod dest-path #o755) + (substitute* dest-path (("#!python") python-hashbang))))))) + ;; data can create arbitrary directory structures. Most commonly + ;; it is used for share/. + (let ((source (string-append directory "/data")) + (destination out)) + (when (file-exists? source) + (merge-directories source destination))) + (let* ((distribution (car (string-split (basename directory) #\-))) + (source (string-append directory "/headers")) + (destination (string-append out "/include/python" (python-version python) "/" distribution))) + (when (file-exists? source) + (merge-directories source destination)))) + + (define (list-directories base predicate) + ;; Cannot use find-files here, because it’s recursive. + (scandir + base + (lambda (name) + (let ((stat (lstat (string-append base "/" name)))) + (and + (not (member name '("." ".."))) + (eq? (stat:type stat) 'directory) + (predicate name stat)))))) + + (let* ((wheel-output (assoc-ref outputs "wheel")) + (wheel-dir (if wheel-output wheel-output "dist")) + (wheels (map (cut string-append wheel-dir "/" <>) + (scandir wheel-dir (cut string-suffix? ".whl" <>))))) + (cond + ((> (length wheels) 1) ; This code does not support multiple wheels + ; yet, because their outputs would have to be + ; merged properly. + (raise (condition (&cannot-extract-multiple-wheels)))) + ((= (length wheels) 0) + (raise (condition (&no-wheels-built))))) + (for-each extract wheels)) + (let ((datadirs (map + (cut string-append site-dir "/" <>) + (list-directories site-dir (file-name-predicate "\\.data$"))))) + (for-each (lambda (directory) + (expand-data-directory directory) + (rmdir directory)) + datadirs)))) + +(define* (compile-bytecode #:key inputs outputs (configure-flags '()) #:allow-other-keys) + "Compile installed byte-code in site-packages." + (let* ((site-dir (site-packages inputs outputs)) + (python (assoc-ref inputs "python")) + (major-minor (map string->number + (take (string-split (python-version python) #\.) 2))) + (<3.7? (match major-minor + ((major minor) + (or (< major 3) (and (= major 3) (< minor 7))))))) + (if <3.7? + ;; These versions don’t have the hash invalidation modes and do + ;; not produce reproducible bytecode files. + (format #t "Skipping bytecode compilation for Python version ~a < 3.7~%" + (python-version python)) + (invoke "python" "-m" "compileall" "--invalidation-mode=unchecked-hash" + site-dir)))) + +(define* (create-entrypoints #:key inputs outputs (configure-flags '()) #:allow-other-keys) + "Implement Entry Points Specification +(https://packaging.python.org/specifications/entry-points/) by PyPa, +which creates runnable scripts in bin/ from entry point specification +file entry_points.txt. This is necessary, because wheels do not contain +these binaries and installers are expected to create them." + + (define (entry-points.txt->entry-points file) + "Specialized parser for Python configfile-like files, in particular +entry_points.txt. Returns a list of console_script and gui_scripts +entry points." + (call-with-input-file file + (lambda (in) + (let loop ((line (read-line in)) + (inside #f) + (result '())) + (if (eof-object? line) + result + (let* ((group-match (string-match "^\\[(.+)\\]$" line)) + (group-name (if group-match (match:substring group-match 1) #f)) + (next-inside + (if (not group-name) + inside + (or + (string=? group-name "console_scripts") + (string=? group-name "gui_scripts")))) + (item-match (string-match "^([^ =]+)\\s*=\\s*([^:]+):(.+)$" line))) + (if (and inside item-match) + (loop (read-line in) next-inside (cons (list + (match:substring item-match 1) + (match:substring item-match 2) + (match:substring item-match 3)) + result)) + (loop (read-line in) next-inside result)))))))) + + (define (create-script path name module function) + "Create a Python script from an entry point’s NAME, MODULE and + FUNCTION and return write it to PATH/NAME." + (let ((interpreter (which "python")) + (file-path (string-append path "/" name))) + (format #t "Creating entry point for '~a.~a' at '~a'.~%" module function + file-path) + (call-with-output-file file-path + (lambda (port) + ;; Technically the script could also include search-paths, + ;; but having a generic 'wrap phases also handles manually + ;; written entry point scripts. + (format port "#!~a +# Auto-generated entry point script. +import sys +import ~a as mod +sys.exit (mod.~a ())~%" interpreter module function))) + (chmod file-path #o755))) + + (let* ((site-dir (site-packages inputs outputs)) + (out (assoc-ref outputs "out")) + (bin-dir (string-append out "/bin")) + (entry-point-files (find-files site-dir "^entry_points.txt$"))) + (mkdir-p bin-dir) + (for-each + (lambda (f) + (for-each + (lambda (ep) (apply create-script (cons bin-dir ep))) + (entry-points.txt->entry-points f))) + entry-point-files))) + +(define* (set-SOURCE-DATE-EPOCH #:rest _) + "Set the 'SOURCE_DATE_EPOCH' environment variable. This is used by tools +that incorporate timestamps as a way to tell them to use a fixed timestamp. +See https://reproducible-builds.org/specs/source-date-epoch/." + ;; Use a post-1980 timestamp because the Zip format used in wheels do + ;; not support timestamps before 1980. + (setenv "SOURCE_DATE_EPOCH" "315619200")) + +(define %standard-phases + ;; The build phase only builds C extensions and copies the Python sources, + ;; while the install phase copies then byte-compiles the sources to the + ;; prefix directory. The check phase is moved after the installation phase + ;; to ease testing the built package. + (modify-phases python:%standard-phases + (replace 'set-SOURCE-DATE-EPOCH set-SOURCE-DATE-EPOCH) + (replace 'build build) + (replace 'install install) + (delete 'check) + ;; Must be before tests, so they can use installed packages’ entry points. + (add-before 'wrap 'create-entrypoints create-entrypoints) + (add-after 'wrap 'check check) + (add-before 'check 'compile-bytecode compile-bytecode))) + +(define* (pyproject-build #:key inputs (phases %standard-phases) + #:allow-other-keys #:rest args) + "Build the given Python package, applying all of PHASES in order." + (apply python:python-build #:inputs inputs #:phases phases args)) + +;;; pyproject-build-system.scm ends here From patchwork Sat Oct 22 19:09:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43819 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 A7A2D27BBEA; Sun, 23 Oct 2022 23:34:04 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 97A2E27BBE9 for ; Sun, 23 Oct 2022 23:34:03 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjEn-0007IU-SP for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:14:33 -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 1omJtf-00088Z-BQ for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:03 -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 1omJtf-0004z5-3V for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJte-0003Nc-VJ for guix-patches@gnu.org; Sat, 22 Oct 2022 15:11:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 05/22] news: Add entry for 'pyproject-build-system'. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646582012915 (code B ref 58587); Sat, 22 Oct 2022 19:11:02 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:10:20 +0000 Received: from localhost ([127.0.0.1]:42369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsy-0003ME-11 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:20 -0400 Received: from eggs.gnu.org ([209.51.188.92]:51068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsv-0003M0-QM for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsq-0004kH-L5 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=q3TFdS9NVsEUnBYpsNUaBLfVIyDIzIvWKu5mOHzBhj0=; b=THhh3j7FruME+LLnZutK X7hZAbh2ilkP8p3VQGbtAFFAIUDBQLF9jG4l69xApSNuHDWS7c0iRlavQYNKlEHBNPldtzoFP5NZ2 zPKxfiV32JDBGFHUFSLTDVTNgXR+XVEHju+UNiWp/IglJCHGifM+WbfhYjElF5LuIMaGeO5oxcCJp H/KCPJDMIORUmvBJNW080AIPA9NthKw6K3BxR4lEKLwLQBrFnYRyhylZmXe8XWwzQgwoHAAjSferq x4JWISwXhfgAnqhipwF9tA6Yg/7akkcqfjN9t5iiIjdxu63Kbi/uO/Orku5vlrCZA7/zIdW1+ZuY8 2m9FgJs8BO55nw==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsk-0003jt-2S for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:10:11 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:13 +0200 Message-Id: <20221022190930.13086-5-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022190930.13086-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022190930.13086-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * etc/news.scm: Add entry. --- etc/news.scm | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/etc/news.scm b/etc/news.scm index d9ffa036a2..a19eb9aeac 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -6,7 +6,7 @@ ;; Copyright © 2019, 2020 Konrad Hinsen ;; Copyright © 2019, 2020, 2021 Julien Lepiller ;; Copyright © 2019–2022 Florian Pelz -;; Copyright © 2020 Marius Bakke +;; Copyright © 2020, 2022 Marius Bakke ;; Copyright © 2020, 2021 Mathieu Othacehe ;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;; Copyright © 2020, 2021, 2022 Maxim Cournoyer @@ -26,6 +26,26 @@ (channel-news (version 0) + (entry (commit "80ad0214389ef682a8037833711397be94b33b97") + (title + (en "New build system for Python packages")) + (body + (en "A new @var{pyproject-build-system} has been added. This +is a redesign of @var{python-build-system} with support for @dfn{PEP 517} +and @file{pyproject.toml} files. It also has built-in support for various +test frameworks such as @command{pytest} and @code{nosetests}. + +There is a complementary @code{python-toolchain} package that comes with +updated versions of @command{pip}, @command{setuptools} and others. + +The build system will eventually be merged into @var{python-build-system} +but you are encouraged to use it for packages in the @code{guix} channel. +Third party channels may want to wait until the API is stable (see the +Guix manual for caveats). + +Despite the name, @var{pyproject-build-system} also works with the +``legacy'' @file{setup.py} format."))) + (entry (commit "c7ba5f38b80433b040d3946b8fc0b1e8621ba30a") (title (en "New @option{--emulate-fhs} option for @command{guix shell}") From patchwork Sat Oct 22 22:20:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43827 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 3FAB027BBEA; Mon, 24 Oct 2022 01:08:30 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 3B45D27BBE9 for ; Mon, 24 Oct 2022 01:08:29 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjrQ-00017S-IN for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:54:28 -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 1omMsZ-0004gh-22 for guix-patches@gnu.org; Sat, 22 Oct 2022 18:22:07 -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 1omMsX-0005SZ-Jo for guix-patches@gnu.org; Sat, 22 Oct 2022 18:22:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omMsX-0001zD-FH for guix-patches@gnu.org; Sat, 22 Oct 2022 18:22:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v3 06/22] gnu: python-autopage: Use pyproject-build-system. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 22:22:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.16664773137538 (code B ref 58587); Sat, 22 Oct 2022 22:22:05 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:53 +0000 Received: from localhost ([127.0.0.1]:42553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsK-0001xO-OJ for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsE-0001wP-5t for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMs9-00056T-02 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=gfFD4wcD/C/wzOY4zXb2DoVNnC85oTohumUymid0//0=; b=sIIgN++foDvOMGWfMOap yVNB6Y1e42FY6IMVSkv1NtaR7FDRouC6PQgAdcwl3QBmwGmE+tnaK9dmwQk8JsMz7HXZAYeE1W2XZ 5CjYmNz2HGPQHJMnIY9Ivq5keTIMminEq55BDfltO1d4j4ZyRADYQn5c8Ixl8r8LR9jvBYpy0r6RQ MNuN3T635jYNqa38zeDDjPTbe1Cn2vQVrgNbbQmWD3FIwfad+Uyv+cR1SIqt/9gGachyocAOCuXAp 24RtIp+VwrYWtVSr+Vihz1b2cfmf/OKTQViY823x6HXhuhTuwZmNWR8ucPnKW94UZi73YGCyLXvme rh1DcQ6+VeQvSA==; Received: from [84.214.173.6] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMs3-0001RM-Nn for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:40 -0400 From: Marius Bakke Date: Sun, 23 Oct 2022 00:20:44 +0200 Message-Id: <20221022222100.18103-6-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022222100.18103-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022222100.18103-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-autopage)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. --- gnu/packages/python-xyz.scm | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 1ded6f0384..42935cbaaa 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -259,6 +259,7 @@ (define-module (gnu packages python-xyz) #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system trivial) #:use-module (srfi srfi-1) @@ -6959,33 +6960,16 @@ (define-public python-autopage (sha256 (base32 "169ixll1ncm2a2pcc86665ikjv2lrzs10p6c1w4yj55p3gk3xgh1")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases - ;; Do a manual PEP 517 style build/install procedure until the - ;; python-build-system overhaul is merged. - (replace 'build - (lambda _ - ;; ZIP does not support timestamps before 1980. - (let ((circa-1980 (* 10 366 24 60 60))) - (setenv "SOURCE_DATE_EPOCH" (number->string circa-1980)) - (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))) (add-before 'check 'disable-e2e-tests (lambda _ ;; These tests rely on KeyboardInterrupts which do not ;; work in the build container. - (delete-file "autopage/tests/test_end_to_end.py"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + (delete-file "autopage/tests/test_end_to_end.py")))))) (native-inputs (list python-pypa-build python-setuptools From patchwork Sat Oct 22 22:20:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43822 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 1B74E27BBEA; Mon, 24 Oct 2022 00:29:45 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 0DDFD27BBE9 for ; Mon, 24 Oct 2022 00:29:44 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjuA-0001ya-6C for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:57:18 -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 1omMtT-0004mG-Sl for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:06 -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 1omMtT-00060z-Lg for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omMtT-00024B-Gn for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v3 12/22] gnu: python-ufolib2: Use pyproject-build-system. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 22:23:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.16664773447772 (code B ref 58587); Sat, 22 Oct 2022 22:23:03 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:24 +0000 Received: from localhost ([127.0.0.1]:42591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsq-00021C-3c for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zs-3u for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMsM-0005N0-Pr for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Wim1CTo2dlhV8S/FHj84RmihJYCsrDvHelzNyUpn8vg=; b=eHtw9LibQI2G+2IM2tXQ eMI9hX2vy9lDH4Mo21vjpgS+9e3jHkuO1TNlO3S9IoZH8FEdNU/rn/Icn49VrzVHlzo+AGl3udbzA BCtR0wkqAFnRCfaJdwkXc0eWKSJTP3gvPT1CycC5vlDjSyNiEbVjLT9sRWHX5XD9O9W5ESS6Bxcqn EforRqqry/2zgn0CfMk9ZSQPIFtXSfpPiHbPOS+IgnIj8tSD5KrOT62a5tgG191oTjb7+8GoR7uuH PcwrBoKjHmneTyHqTgS3hfy2i5S6Gs07QPFTLFV3UiEUwjucmOtE26dTSxs0H2n/27SVgofzYI+0G 3J6ZMXNPIMAeMQ==; Received: from [84.214.173.6] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMsM-0001Rq-Bk for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:54 -0400 From: Marius Bakke Date: Sun, 23 Oct 2022 00:20:50 +0200 Message-Id: <20221022222100.18103-12-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022222100.18103-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022222100.18103-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/fontutils.scm (python-ufolib2)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove. [native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL. --- gnu/packages/fontutils.scm | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 5c95f9a427..46fbc2370a 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -1612,31 +1612,9 @@ (define-public python-ufolib2 (uri (pypi-uri "ufoLib2" version)) (sha256 (base32 "0yx4i8q5rfyqhr2fj70a7z1bp1jv7bdlr64ww9z4nv9ycbda4x9j")))) - (build-system python-build-system) - (arguments - (list - #:phases - #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - ;; ZIP does not support timestamps before 1980. - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + (build-system pyproject-build-system) (native-inputs - (list python-pypa-build - python-pytest - python-setuptools-scm - python-wheel)) + (list python-pytest python-setuptools-scm)) (propagated-inputs (list python-attrs python-fonttools-full)) (home-page "https://github.com/fonttools/ufoLib2") (synopsis "Unified Font Object (UFO) font processing library") From patchwork Sat Oct 22 22:20:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43824 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 9546B27BBEA; Mon, 24 Oct 2022 00:58:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 500DA27BBE9 for ; Mon, 24 Oct 2022 00:58:13 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjub-00026v-6a for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:57:45 -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 1omMtU-0004mJ-Me for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:06 -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 1omMtU-00061I-F8 for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omMtU-00024Q-AJ for guix-patches@gnu.org; Sat, 22 Oct 2022 18:23:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v3 16/22] gnu: zabbix-cli: Switch to pyproject-build-system. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 22:23:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.16664773457787 (code B ref 58587); Sat, 22 Oct 2022 22:23:04 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:25 +0000 Received: from localhost ([127.0.0.1]:42595 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsq-00021R-Q8 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zt-3l for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMsU-0005N5-QI for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=cDYf9YQUlAX7t8aPQ9C2NYnsBGR5A1ydMUk/Qt0Gi0M=; b=BYu9LPII4P7fK0/bEcLx KcgrSnf4VIIpC8z6QQ4NJeR9rspU7HDxt4QNfx1VR5inlMMubeJDZc2h2irTrDxp5o356XcRYVtUW XBHjj5W/76/vYE5GczibRA/WV0PeG+KGbX0Qyb7lFU0GRfbfLiWOvvNBNGame3JVFYKJq3xuy6Qu2 YqsPchuRH4oO6hPjexbcH+ihMvQmK7Vsxoomot6HDuQLy3R4pK5xTHdPWf7wAnqxwjf0LGdlek9N/ DbYYnh6b/rwF5OdTzEpfDdPycRd+D7k4qUZrQI0t5OOrcJ4f3BxU9Z+ogAlHEq5SyCQYRxbZTx6zv PNbOeq4tp9JC0Q==; Received: from [84.214.173.6] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omMsT-0001TT-Kz for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:02 -0400 From: Marius Bakke Date: Sun, 23 Oct 2022 00:20:54 +0200 Message-Id: <20221022222100.18103-16-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022222100.18103-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022222100.18103-1-marius@gnu.org> 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" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/monitoring.scm (zabbix-cli)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove check phase. --- gnu/packages/monitoring.scm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gnu/packages/monitoring.scm b/gnu/packages/monitoring.scm index 51ead2fe9b..d2c0a335db 100644 --- a/gnu/packages/monitoring.scm +++ b/gnu/packages/monitoring.scm @@ -37,6 +37,7 @@ (define-module (gnu packages monitoring) #:use-module (guix git-download) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system gnu) #:use-module (guix build-system go) @@ -270,7 +271,7 @@ (define-public zabbix-cli (sha256 (base32 "1p8xkq3mxg476srwrgqax76vjzji0rjx32njmgnpa409vaqrbj5p")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases @@ -295,10 +296,7 @@ (define-public zabbix-cli (string-append #$output "/share/man/man1")) (copy-recursively "docs/_build/singlehtml" (string-append #$output "/share/doc/" - #$name "/html")))) - (replace 'check - (lambda _ - (invoke "pytest" "-vv")))))) + #$name "/html"))))))) (native-inputs (list python-pytest python-sphinx)) (inputs