From unknown Fri Aug 15 17:55:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58587 <58587@debbugs.gnu.org> To: bug#58587 <58587@debbugs.gnu.org> Subject: Status: [PATCH 00/14] Introducing pyproject-build-system. Reply-To: bug#58587 <58587@debbugs.gnu.org> Date: Sat, 16 Aug 2025 00:55:39 +0000 retitle 58587 [PATCH 00/14] Introducing pyproject-build-system. reassign 58587 guix-patches submitter 58587 Marius Bakke severity 58587 normal tag 58587 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:06:31 2022 Received: (at submit) by debbugs.gnu.org; 17 Oct 2022 20:06:31 +0000 Received: from localhost ([127.0.0.1]:50106 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWNb-0007B4-Co for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:06:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:44956) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWNZ-0007Aw-KJ for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:06:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54268) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWNZ-0004kT-6x for guix-patches@gnu.org; Mon, 17 Oct 2022 16:06:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWNY-0001J6-3S; Mon, 17 Oct 2022 16:06:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=DBciv+az864eFTipVXwYBtihBDTy2HnFmxVz7KeK5fM=; b=J70s+0YshutN4/ 2yz8HC0OAny2y7YEj0KXx5/00fSXgjnOGJ0TWqTzITkFXAieS994BRFXx6kuGJvgSXVvfNEDwKElP yYMBZcNGWsDtQL67iWF7Qs0imUcNRJiPD4v9+ngVGBojqbalnRvKsI4fmtKn/Fjw7A+d8Q3FuZ669 gZpxvpKxWlMgcCQlWWfoZ1308ma811IX8TqHhsnNtaBA2x8VY6u+SQxRX2cgKoprF8Gy361bjdNy/ AQ0mep4emjFdTb+W9txbhMU2SRfbMc+rhxCQPS6jrJDuXDl3sXNyFkoB+VP+D4DBIOh6HI7BWGhJ/ d53Me22cYUv96ZV3o85Q==; Received: from [84.211.203.64] (port=56050 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWNX-0004Gq-FG; Mon, 17 Oct 2022 16:06:27 -0400 From: Marius Bakke To: guix-patches@gnu.org Subject: [PATCH 00/14] Introducing pyproject-build-system. Date: Mon, 17 Oct 2022 22:06:24 +0200 Message-Id: <20221017200624.4076-1-marius@gnu.org> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) This is an adaptation of Lars' work in wip-python-pep517 for 'master'. I've implemented it as a separate build system so we can do a slow transition, starting at the leafs. Changes from the original branch: * Renamed to pyproject-build-system. * It inherits some code from python-build-system. * Python 2 and <3.7 support removed. * A (temporary) sanity-check-next.py file is introduced. * A new (hidden) 'python-sans-pip' variable is introduced. * The 'python-toolchain' package includes pip, wheel, setuptools, and pypa-build. The build system logic is unchanged from Lars' branch. I've converted a handful packages that were doing PEP 517 style builds to the new build system with great success. It should help a lot with packaging "modern" Python packages. Please try it for new packages, even those using setup.py, and don't be afraid to report problems! I plan to eventually merge it with python-build-system instead of keeping it separate. Thoughts? Note: documentation is missing. Will work on that next. Lars-Dominik Braun (3): gnu: python-setuptools: Move to python-build. gnu: pypy: Move to separate module. build-system: Add pyproject-build-system. Marius Bakke (11): gnu: python-pip: Move to (gnu packages python-build). gnu: python-autopage: Use pyproject-build-system. gnu: flair: Switch to pyproject-build-system. gnu: python-pydyf: Use pyproject-build-system. gnu: weasyprint: Use pyproject-build-system. gnu: python-glyphslib: Use pyproject-build-system. gnu: python-statmake: Use pyproject-build-system. gnu: python-ufolib2: Use pyproject-build-system. gnu: python-mypy-protobuf: Switch to pyproject-build-system. gnu: python-tempora: Switch to pyproject-build-system. gnu: python-pygmsh: Use pyproject-build-system. Makefile.am | 2 + gnu/local.mk | 2 + .../aux-files/python/sanity-check-next.py | 98 ++++ gnu/packages/bioinformatics.scm | 23 +- gnu/packages/chemistry.scm | 1 + gnu/packages/fontutils.scm | 91 +--- gnu/packages/messaging.scm | 1 + gnu/packages/pdf.scm | 40 +- gnu/packages/protobuf.scm | 15 +- gnu/packages/pypy.scm | 273 +++++++++++ gnu/packages/python-build.scm | 61 +++ gnu/packages/python-commencement.scm | 64 +++ gnu/packages/python-xyz.scm | 110 +---- gnu/packages/python.scm | 180 +------ gnu/packages/sequoia.scm | 2 +- gnu/packages/simulation.scm | 20 +- guix/build-system/pyproject.scm | 148 ++++++ guix/build/pyproject-build-system.scm | 460 ++++++++++++++++++ tests/lint.scm | 2 +- 19 files changed, 1164 insertions(+), 429 deletions(-) create mode 100644 gnu/packages/aux-files/python/sanity-check-next.py create mode 100644 gnu/packages/pypy.scm create mode 100644 gnu/packages/python-commencement.scm create mode 100644 guix/build-system/pyproject.scm create mode 100644 guix/build/pyproject-build-system.scm -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:13 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:13 +0000 Received: from localhost ([127.0.0.1]:50115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWT6-0007K3-9v for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:13 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39130) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWT5-0007Jl-1E for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:11 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51462) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWSz-0002BR-2W; Mon, 17 Oct 2022 16:12:05 -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=VwqjlP4H28xnE7A2J+pl OqKIBau7cqe3O/Vqnp4FvsB8xlF0SSo86P8n7GEFv0DUVs80jQaUF6sJzPYbkAcV4J5bVvCEK++Fa /9SixLoW0XNWF5d21h7Y+woLZEzutojL8Rm3o2r2FfEQpbx8k0011b7x/Os/+6xqT0+fZf0ldPNGj XmeEh1aqmCG9bm7Z3f0M9dTkzur6v1MMUJxQpAcMC0DGpQ23fyDA6lxTjgS3rfnbBx/t7Zt+Cz8I8 vomNAoYANHq+ogdAAI40jEI9Ip5YiSd8anVFgkXzEnexjZLadUqzKN7Zo5fQgOb4Aj8mriI69sgfR PM8m8OBMs8/lIQ==; Received: from [84.211.203.64] (port=45504 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWSy-0004yW-D7; Mon, 17 Oct 2022 16:12:04 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 01/14] gnu: python-setuptools: Move to python-build. Date: Mon, 17 Oct 2022 22:11:48 +0200 Message-Id: <20221017201201.4808-1-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017200624.4076-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:22 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:22 +0000 Received: from localhost ([127.0.0.1]:50119 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTA-0007KR-88 for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:22 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39134) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWT7-0007Jq-F6 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51470) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT2-0002CA-9r for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:08 -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=F7oj3UNTgfTto5fEKW0d v/TD0rBDb6JTFReKa1P4SEWrWycmCG+I8Y3PwEKQVHFeK3xn8IN13XbvbLGmK2DIKB4SONJMjVIyl WCRVqMif6jdRWI0WQP4ILaQUVCj1NsHCWQpy9qix9hgaEf39zGOkUd652Bh0pMI120QVkJKBMC/o7 5UDd0BGBvoM6Rcd4fGCTeRBbMJuPA+DFUOZHljW23MZNOG2Mb+o4wavXxcO7YxAmkqFbTjHj+KnLi ptrvmeSVEUnp5twvG/2C4dz+lLODYmDncOhpqdvE99YIVrOVWTXu6PP0a/UcU9w+8k5Tuhs8GUvP8 dy9izJtGTGYQhg==; Received: from [84.211.203.64] (port=45524 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT1-0004zn-Q5 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:08 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 03/14] gnu: python-pip: Move to (gnu packages python-build). Date: Mon, 17 Oct 2022 22:11:50 +0200 Message-Id: <20221017201201.4808-3-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:24 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:24 +0000 Received: from localhost ([127.0.0.1]:50127 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTG-0007Kd-94 for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39132) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWT5-0007Jn-Ry for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT0-0002Bz-M7; Mon, 17 Oct 2022 16:12: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=M/OxDubfgI4sdCas+OAtAWX3W3HWjW3Vxyq2/441R/k=; b=E3BkAmTCiBswc0Q6wpp7 Y2WaidL6Wz2NnQuaaPn2Kro0aYLdl0WJ5ToyxWPF9lZugZWScWReqlxw6hwXgRhWrdMF3HtxbmgLN SHe1+QtSmEIl8tsaWCR17lbDAsD91+8OyJNH6D6OeQaevfRDUePx3Za9v/ji97V6+9OyjsloG72vg 7RTaQ6syLfVc0A+Cxy5vf56ko6Gw7a+dm/SpE2c5xx1ETORjHLE60olUXKfrycfPtYR1n0/6DZwX+ 9jts1Z0vV+1RBzIos0uJdVSn6uwfu57nlkNpCT0WFX5bvJ+UW3PMuEkwV4LB6DfjVZ7rfE7sdEVrS ZhOHY/qP+CO0JA==; Received: from [84.211.203.64] (port=45518 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT0-0004z3-73; Mon, 17 Oct 2022 16:12:06 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 02/14] gnu: pypy: Move to separate module. Date: Mon, 17 Oct 2022 22:11:49 +0200 Message-Id: <20221017201201.4808-2-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 | 167 ------------------------ 3 files changed, 274 insertions(+), 167 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..b54e393eb4 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -89,7 +89,6 @@ (define-module (gnu packages python) #: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) @@ -736,169 +735,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)) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:24 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:25 +0000 Received: from localhost ([127.0.0.1]:50133 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTI-0007LF-Ga for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTB-0007K4-RQ for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51498) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT6-0002D6-L1 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12: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=gfFD4wcD/C/wzOY4zXb2DoVNnC85oTohumUymid0//0=; b=J7yvHLrWvhpm8ZgYmzNb icMgO+Ay4oFrB8L1zvu3ZTw32hVS9nuWIVP1jnIB6qdYW6/UmQBMMjEEErcoXT8UGC+fqvPthZb5c lwtrwGXnMdWXQiGHW8t8DkxIc+7ZtLVKoM6y//hWYkijJivhP2fePCEjMtgclTrE9u6O0FGozrBVM Z66suY1P5O66IcBCEVJGjREmP0nFXU/2mx9HSYVa47thvJt2sAdcTUQsUb7eg675ScR4crIRSfO4+ rUlFRlJ5sjnN+ubzA3ObFoEBwiFcVJvY/p1zVXf0mdsfl9UOGSLinQXnRKWHshAvjTAz8x0KNmegx YuFQ7monasFL2g==; Received: from [84.211.203.64] (port=33082 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT6-00050D-21 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:12 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 05/14] gnu: python-autopage: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:52 +0200 Message-Id: <20221017201201.4808-5-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:25 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:25 +0000 Received: from localhost ([127.0.0.1]:50135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTI-0007LO-Th for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49518) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTF-0007KS-9O for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:22 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51252) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT8-0002DR-Ja for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:14 -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=GJEyjFVjDOSDLaNg7FYY8NKuh0hVe3tcRl8rQQG5NtQ=; b=L3sg34qs4y8ba07LgNmB Ng0pDE2+0mBD7TVVsXyqnYYtRkRgeb1AEfCzVWi/s9cCAkSlRGif4HPYq99giJDO8+lq1EQ+TKk0Z bTPXttgZhh2xQGpvZzziHw8eUrWABESSIJTQI9gd9P6BHVUbq4GKtkj1odJwhphtmHCsLG03j7l+M oZpyGJT+sYZUmtS6fEubrySk2U2gtA8rfC7XpAKHfqlnYaRbwe4PE3jBMJslEXW7rebCu0cmYCBEw G1NFf6VlyXSuIXAvG9CwVmMA0Ko64kx30BftbkN9KVrkwIM/tAXW1ZaoZsNGhg2Um9IIfK4oKL/00 muAGSXj/1TwsOw==; Received: from [84.211.203.64] (port=33092 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT7-00050Q-OU for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:14 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 06/14] gnu: flair: Switch to pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:53 +0200 Message-Id: <20221017201201.4808-6-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/bioinformatics.scm (flair)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove #:phases. [native-inputs]: Remove. --- gnu/packages/bioinformatics.scm | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index f2de09aa32..3588f4e3fd 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -56,6 +56,7 @@ (define-module (gnu packages bioinformatics) #:use-module (guix build-system meson) #:use-module (guix build-system ocaml) #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix build-system r) @@ -16928,33 +16929,15 @@ (define-public flair (sha256 (base32 "106swb2q7l20ki58fca1hg95q5f79bgp9gjb0clr2243ycrzyxf8")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list - #:tests? #false ;there are none - #:phases - #~(modify-phases %standard-phases - ;; TODO: implement as a feature of python-build-system (PEP-621, - ;; PEP-631, PEP-660) - (replace 'build - (lambda _ - (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) - ;; ZIP does not support timestamps before 1980. - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (apply invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output - (find-files "dist" "\\.whl$"))))))) + (list #:tests? #false)) ;there are none (propagated-inputs (list python-mappy python-ncls python-pybedtools python-pysam python-tqdm)) - (native-inputs - (list python-pypa-build python-setuptools)) (home-page "https://flair.readthedocs.io/en/latest/") (synopsis "Full-length alternative isoform analysis of RNA") (description "This package implements FLAIR (Full-Length Alternative -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:25 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:26 +0000 Received: from localhost ([127.0.0.1]:50139 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTJ-0007LW-Bc for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49520) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTG-0007KU-Rg for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51266) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTB-0002Di-Ly for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:17 -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=kflm8QbXlO5a2zk+j3MCbpwjiqHbJv2OCcaL4iwNSK4=; b=ASVP/u8vvkQe9oT+t2HB kMpp5c2zkeCRY/DagFvy1Xr36LkUr6y0NheDKPMl8sY9FaxE4BjBQm+2yth39uoSxbH9rWnMpa3nU Kc8QI45FVGgWH0vLbE2eXmhfmwOJBTmzEVbzlM3XWdyM+43oME9esXJC1E7CTS7MIwBTLCILFCUqQ epgl5vG1wjO63rcZlnffWRH6Av9SRzgo1+A41eO+KB0n0o3MBSoycAZLqWtn88CKT7tBNCSbsvaVV YvUqgxp3WHe3PaH+K+E4sCTx52E/isO3VQbu3/OQukZwFw9W7WGxgzXs4VDJafkXEMUfUhu1kBOGc E9Ccx52rZpmZ4g==; Received: from [84.211.203.64] (port=33104 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT9-00050d-Qr for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:16 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 07/14] gnu: python-pydyf: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:54 +0200 Message-Id: <20221017201201.4808-7-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/pdf.scm (python-pydyf)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove #:phases. Add #:test-flags. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/pdf.scm | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index b49e5264f9..ec75bca6e3 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -49,6 +49,7 @@ (define-module (gnu packages pdf) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix build-system trivial) @@ -735,28 +736,14 @@ (define-public python-pydyf (uri (pypi-uri "pydyf" version)) (sha256 (base32 "18q43g5d9455msipcgd5fvnh8m4a2rz189slzfg80yycjw66rshs")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-c" "/dev/null"))))))) + #:test-flags #~'("-vv" "-c" "/dev/null"))) (propagated-inputs (list python-pillow)) (native-inputs (list ghostscript python-flit-core - python-pypa-build python-pytest)) (home-page "https://github.com/CourtBouillon/pydyf") (synopsis "Low-level PDF generator") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:36 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:36 +0000 Received: from localhost ([127.0.0.1]:50148 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTR-0007ML-TD for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:35 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39136) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTA-0007Jw-8H for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51486) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT5-0002Cb-2T; Mon, 17 Oct 2022 16:12:11 -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=kvcBYIgshpDeQaAkYkS5TE6V0wR3OW8oHzvoMqXrvDw=; b=Tx9pnCZVvQMWAXS3Yaq3 7IwsNSkngQuUW//ZnNHSI8vSNxqE3zCbhI1OQnXLfwXDo7nA0x38JXGqlg7nO5FkJhlBb3dbbSW5t 3MJO5onyNXzL09kM3+gT1DMc78icLfmICia8OAOgIqPF5ybXaAZuWA1rVQphNna3dnGFONXHM9AQv YqtsHSlgWLRTnvZGE3HZtmAUL7znvTVp24DtCGnLuuXWFWIlHV5XngTRhoiH7Nk5k/69PjTemJvGX 7+kRtFks4590UpAqWbt1cET4Ly3zf90BKVFoqDoRfntfcCvDeuUO85zjZoOPMIYimmUJThBtoVjFz QtKCerrAspn6lA==; Received: from [84.211.203.64] (port=45530 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWT4-0004zz-AT; Mon, 17 Oct 2022 16:12:10 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 04/14] build-system: Add pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:51 +0200 Message-Id: <20221017201201.4808-4-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) From: Lars-Dominik Braun This is an experimental build system based on python-build-system that implements PEP 517-compliant builds. * 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 + gnu/local.mk | 1 + .../aux-files/python/sanity-check-next.py | 98 ++++ gnu/packages/python-commencement.scm | 64 +++ gnu/packages/python.scm | 13 + guix/build-system/pyproject.scm | 148 ++++++ guix/build/pyproject-build-system.scm | 460 ++++++++++++++++++ 7 files changed, 786 insertions(+) create mode 100644 gnu/packages/aux-files/python/sanity-check-next.py create mode 100644 gnu/packages/python-commencement.scm 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/gnu/local.mk b/gnu/local.mk index bf598cec8b..b6e0d262be 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -511,6 +511,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/python-build.scm \ %D%/packages/python-check.scm \ %D%/packages/python-compression.scm \ + %D%/packages/python-commencement.scm \ %D%/packages/python-crypto.scm \ %D%/packages/python-science.scm \ %D%/packages/python-web.scm \ 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-commencement.scm b/gnu/packages/python-commencement.scm new file mode 100644 index 0000000000..011ba2c38d --- /dev/null +++ b/gnu/packages/python-commencement.scm @@ -0,0 +1,64 @@ +;;; 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 (gnu packages python-commencement) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (guix build-system trivial) + #:use-module (gnu packages) + #:use-module (gnu packages python) + #:use-module (gnu packages python-build) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26)) + +(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-pypa-build + python-pip + 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)))) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index b54e393eb4..377fd1c282 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -677,6 +677,19 @@ (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 micropython (package (name "micropython") diff --git a/guix/build-system/pyproject.scm b/guix/build-system/pyproject.scm new file mode 100644 index 0000000000..8e320529cc --- /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-commencement)))) + (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..141d4d849f --- /dev/null +++ b/guix/build/pyproject-build-system.scm @@ -0,0 +1,460 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013, 2015, 2016, 2018, 2019 Ludovic Courtès +;;; Copyright © 2013 Andreas Enge +;;; Copyright © 2013 Nikita Karetnikov +;;; Copyright © 2015, 2018 Mark H Weaver +;;; Copyright © 2016 Hartmut Goebel +;;; Copyright © 2018 Ricardo Wurmus +;;; Copyright © 2018 Arun Isaac +;;; Copyright © 2019, 2020, 2021 Maxim Cournoyer +;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2020 Efraim Flashner +;;; Copyright © 2021 Maxime Devos +;;; +;;; The above copyright is taken from python-build-system. Contributions +;;; made only to this module are listed below: +;;; 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 gnu-build-system) #:prefix gnu:) + #: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. +;; +;; Caveats: +;; - There is no support for in-tree build backends. + +;; 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* (sanity-check #:key tests? inputs outputs #:allow-other-keys) + "Ensure packages depending on this package via setuptools work properly, +their advertised endpoints work and their top level modules are importable +without errors." + (let ((sanity-check.py (assoc-ref inputs "sanity-check.py"))) + ;; Make sure the working directory is empty (i.e. no Python modules in it) + (with-directory-excursion "/tmp" + (invoke "python" sanity-check.py (site-packages inputs outputs))))) + +(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 (python-version python) + (let* ((version (last (string-split python #\-))) + (components (string-split version #\.)) + (major+minor (take components 2))) + (string-join major+minor "."))) + +(define (python-output outputs) + "Return the path of the python output, if there is one, or fall-back to out." + (or (assoc-ref outputs "python") + (assoc-ref outputs "out"))) + +(define (site-packages inputs outputs) + "Return the path of the current output's Python site-package." + (let* ((out (python-output outputs)) + (python (assoc-ref inputs "python"))) + (string-append out "/lib/python" (python-version python) "/site-packages"))) + +(define (add-installed-pythonpath inputs outputs) + "Prepend the site-package of OUTPUT to GUIX_PYTHONPATH. This is useful when +running checks after installing the package." + (setenv "GUIX_PYTHONPATH" (string-append (site-packages inputs outputs) ":" + (getenv "GUIX_PYTHONPATH")))) + +(define* (add-install-to-pythonpath #:key inputs outputs #:allow-other-keys) + "A phase that just wraps the 'add-installed-pythonpath' procedure." + (add-installed-pythonpath inputs outputs)) + +(define* (add-install-to-path #:key outputs #:allow-other-keys) + "Adding Python scripts to PATH is also often useful in tests." + (setenv "PATH" (string-append (assoc-ref outputs "out") + "/bin:" + (getenv "PATH")))) + +(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))) + (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* (wrap #:key inputs outputs search-paths #:allow-other-keys) + (define (list-of-files dir) + (find-files dir (lambda (file stat) + (and (eq? 'regular (stat:type stat)) + (not (wrapped-program? file)))))) + + (define bindirs + (append-map (match-lambda + ((_ . dir) + (list (string-append dir "/bin") + (string-append dir "/sbin")))) + outputs)) + + ;; Do not require "bash" to be present in the package inputs + ;; even when there is nothing to wrap. + ;; Also, calculate (sh) only once to prevent some I/O. + (define %sh (delay (search-input-file inputs "bin/bash"))) + (define (sh) (force %sh)) + + (let* ((var `("GUIX_PYTHONPATH" prefix + ,(search-path-as-string->list + (or (getenv "GUIX_PYTHONPATH") ""))))) + (for-each (lambda (dir) + (let ((files (list-of-files dir))) + (for-each (cut wrap-program <> #:sh (sh) var) + files))) + bindirs))) + +(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* (enable-bytecode-determinism #:rest _) + "Improve determinism of pyc files." + ;; Use deterministic hashes for strings, bytes, and datetime objects. + (setenv "PYTHONHASHSEED" "0") + ;; Prevent Python from creating .pyc files when loading modules (such as + ;; when running a test suite). + (setenv "PYTHONDONTWRITEBYTECODE" "1")) + +(define* (ensure-no-cythonized-files #:rest _) + "Check the source code for @code{.c} files which may have been pre-generated +by Cython." + (for-each + (lambda (file) + (let ((generated-file + (string-append (string-drop-right file 3) "c"))) + (when (file-exists? generated-file) + (format #t "Possible Cythonized file found: ~a~%" generated-file)))) + (find-files "." "\\.pyx$"))) + +(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 gnu:%standard-phases + (add-after 'unpack 'enable-bytecode-determinism + enable-bytecode-determinism) + (add-after 'enable-bytecode-determinism 'ensure-no-cythonized-files + ensure-no-cythonized-files) + (replace 'set-SOURCE-DATE-EPOCH set-SOURCE-DATE-EPOCH) + (delete 'bootstrap) + (delete 'configure) ;not needed + (replace 'build build) + (delete 'check) ;moved after the install phase + (replace 'install install) + (add-after 'install 'add-install-to-pythonpath add-install-to-pythonpath) + (add-after 'add-install-to-pythonpath 'add-install-to-path + add-install-to-path) + (add-after 'add-install-to-path 'wrap wrap) + ;; 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-after 'check 'sanity-check sanity-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 gnu:gnu-build #:inputs inputs #:phases phases args)) + +;;; pyproject-build-system.scm ends here -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:36 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:36 +0000 Received: from localhost ([127.0.0.1]:50150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTU-0007MR-1c for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49522) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTH-0007KW-L8 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:24 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51272) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTC-0002Do-Fr for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:18 -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=3+eQtppnn3nXQOdDQCihD9B0PsifcuOoUb/12XbGaTA=; b=fgaGCq4lvEREAHae74Th Ek1xwAf/UHGLjFx9xHUdGKwT7BxMe5vKi6mId0h9Ob72RzIPm72o+7hOf//NlPMe6dDOrvh2lQysm Neq3gs40D9vEJX7xZZbcjR3xh1kAU08x0jApLSBfJ7RIxIWpeopLDA9q4N4LfpwWBXCK+FsFYNHty yUAJLgjpglZLLgiNxTk+kSbIZJA2kBajc6QwOgoV9Pb0RJm5fK3AccyFReRdZz8B4780wIO7kjaCo R0a/eHUuKic37LcnroJyZTHmFdxead20Ivf2o7BCz3+BcUhNVA/9h418saSL+s1TbCQwBn/LCgInd J5qqxGVsbawqaA==; Received: from [84.211.203.64] (port=33106 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTC-00050p-1J for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:18 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 08/14] gnu: weasyprint: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:55 +0200 Message-Id: <20221017201201.4808-8-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/pdf.scm (weasyprint)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. Add #:test-flags. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/pdf.scm | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index ec75bca6e3..8c871e4341 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -1497,9 +1497,11 @@ (define-public weasyprint (sha256 (base32 "0cn8gpgyic6pmrnhp0540nbgplpsd5aybi7k89anz6m1sshgjzgs")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list + #:test-flags #~(list "-vv" "-c" "/dev/null" + "-n" (number->string (parallel-job-count))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-library-paths @@ -1520,21 +1522,7 @@ (define-public weasyprint (("'pangoft2-1.0-0'") (format #f "~s" (search-input-file inputs - "lib/libpangoft2-1.0.so")))))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-c" "/dev/null" - "-n" (number->string (parallel-job-count)))))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + "lib/libpangoft2-1.0.so"))))))))) (inputs (list fontconfig glib harfbuzz pango)) (propagated-inputs (list gdk-pixbuf @@ -1552,7 +1540,6 @@ (define-public weasyprint (list font-dejavu ;tests depend on it ghostscript python-flit-core - python-pypa-build python-pytest python-pytest-xdist)) (home-page "https://weasyprint.org/") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:36 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:36 +0000 Received: from localhost ([127.0.0.1]:50152 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTU-0007MZ-Cu for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49524) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTJ-0007KY-9i for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51282) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTE-0002E0-4b for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:20 -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=Q/AZitL3qkCOLqYFzL787h9HNn6LxS2iyRJOEc4RO9U=; b=peqUQD6UK8mw3Do6BHEl lOrswGL7MuokCSQV/OTawgelb9jwuxABz5AEGkNB5OKBgemwcmGHiwQ9Mi7BQZNGGqbKlbjHgPEie Uk8bGfoqxWpR/bqwgbW6BkxaVj66siZaLTPFOUM/biAcmFMLmFLwdYwFr8ZgKVYQu2cVAYjlaaFMO 8L/1yg6jbRthOOE8qJnRb/fG3lzqxVdBP4ucjaHmkARF2n74b2vcBiff+NEsspQMpB5Y1nyBvq0yI 2yckv6Yj8F9PEdLj5B4OBk9W7Rd1W2xSYmrPvbOG5KySrpis2cSWxwHneTBrQ/3uhpm2RBkBClsq3 73IrovOHSZwAQw==; Received: from [84.211.203.64] (port=33110 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTD-000512-M9 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:19 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 09/14] gnu: python-glyphslib: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:56 +0200 Message-Id: <20221017201201.4808-9-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/fontutils.scm (python-glyphslib)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Add #:test-flags. Remove #:phases. [native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL. --- gnu/packages/fontutils.scm | 42 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 9b7f1ac879..eefde1d893 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -76,8 +76,9 @@ (define-module (gnu packages fontutils) #:use-module (guix build-system copy) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) - #:use-module (guix build-system python) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) #:use-module (guix utils) #:use-module (srfi srfi-1)) @@ -591,39 +592,18 @@ (define-public python-glyphslib (sha256 (base32 "0mkkwd09g76hvif603ij5aqicxh47zvhgyyd0pjcjmpdy6dr70yw")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (replace 'build - (lambda _ - ;; The Zip format does not support pre-1980 time stamps. - (let ((circa-1980 (* 10 366 24 60 60))) - (setenv "SOURCE_DATE_EPOCH" (number->string circa-1980)) - (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (setenv "GUIX_PYTHONPATH" - (string-append (getcwd) ":" (getenv "GUIX_PYTHONPATH"))) - (invoke "pytest" "-vv" - ;; These fail because the test data has not yet been - ;; updated for newer FontTools: - ;; https://github.com/googlefonts/glyphsLib/issues/787 - ;; Re-enable for versions > 6.0.7. - "--ignore=tests/builder/designspace_gen_test.py" - "--ignore=tests/builder/interpolation_test.py" - ))))))) + #:test-flags #~'("-vv" + ;; These fail because the test data has not yet been + ;; updated for newer FontTools: + ;; https://github.com/googlefonts/glyphsLib/issues/787 + ;; Re-enable for versions > 6.0.7. + "--ignore=tests/builder/designspace_gen_test.py" + "--ignore=tests/builder/interpolation_test.py"))) (native-inputs - (list python-pypa-build - python-setuptools-scm - python-wheel + (list python-setuptools-scm ;; For tests. python-pytest -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:37 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:37 +0000 Received: from localhost ([127.0.0.1]:50154 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTU-0007Mg-Ra for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTL-0007Kb-5b for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51284) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTG-0002E9-0Z for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:22 -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=ceZVkUQjSuYrrM7iupoIDNK7vaP2D8CZPUZV8SYltmA=; b=N6aUtRsOB4xzluADF0a+ tkVMOKl3IAOqK6vUqOdzGUHYGExsFqlYBu5kVCY6qd7pct+dro6emiSbT2k7JixlB7+rwDwuKtUD3 PpEanzxkN+uUbALUzuobCn13iB7zDwvd3V5yrlJ6PflC0cE7QKScM7iPNDtu44SEC9x35BbMs+/Y4 jzNKKXna7OsoSHa7Q29f3PydYRLP8PSPswFQYYRyJb/mP+ojZfKm//zy2RiWwU6MPisUgC17HssR8 ZUl63XAZRC4XjhpndBgtCONoRcGzcpwkrRlprwDQSUNLIPzMKrxSsTF09VPg1C24xYXH3GodBoPq0 xYWMBCK1CtIUlA==; Received: from [84.211.203.64] (port=52326 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTF-00051C-9h for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:21 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 10/14] gnu: python-statmake: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:57 +0200 Message-Id: <20221017201201.4808-10-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/fontutils.scm (python-statmake)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/fontutils.scm | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index eefde1d893..5c95f9a427 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -1561,12 +1561,11 @@ (define-public python-statmake (sha256 (base32 "0qavzspxhwnaayj5mxq6ncjjziggabxj157ls04h2rdrpq167706")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. (add-after 'unpack 'adjust-for-older-attrs ;; Our older attrs package is using the 'attr' rather than 'attrs' ;; namespace. @@ -1583,27 +1582,9 @@ (define-public python-statmake (("@attrs") "@attr") (("\\battrs\\.") - "attr.")))) - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "tests" - ;;"-n" (number->string (parallel-job-count)) - ;; This test requires orjson, which needs the maturin - ;; build system and new Rust dependencies. - ;;"--ignore" "tests/test_preconf.py" - ))))))) + "attr."))))))) (native-inputs (list python-poetry-core - python-pypa-build python-pytest python-ufo2ft)) (propagated-inputs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:37 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:37 +0000 Received: from localhost ([127.0.0.1]:50156 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTV-0007Mn-7z for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:37 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTM-0007L3-Pe for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:29 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:55062) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTH-0002EJ-J0 for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:23 -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=bjkIMtqI/K+LSzaURDsj yXRZNlxHBROk/wyGAU5ZdhlQK59EEBUNB9kOE/uFY2+O3h8CrOwAFzcAGOnknUC/XIIBu+AbRm/Z2 MNnFh+KX3/m3QYQFTQCKrbPkpoagLqvIYJsCR7NPeM+Qi+AuhMAl6eexybFvV76oX+GYeEvs1p1KA qCc/YNdtPAc6W1Wl0r6PyU/ZtVMyImPf1grni4uMI5kr4a4XWeHQRR8mbogPdyYnsuhY5MwJSLQkX VRbJVc3V8L82k5aQl6UMVU2/FbakBcCy5z0hInM21zsM7YSQqWSdBsxvPRLUIivZuO7/c81WejtIK dEgHGuzJtH28zQ==; Received: from [84.211.203.64] (port=52338 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTH-00051O-4n for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:23 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 11/14] gnu: python-ufolib2: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:58 +0200 Message-Id: <20221017201201.4808-11-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:53 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:53 +0000 Received: from localhost ([127.0.0.1]:50170 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTl-0007Ns-Fh for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41406) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTY-0007MP-Iy for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:40 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46736) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTT-0002Ee-DQ for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:35 -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=HuZ8V925BtDB25+n1oiSnJCJH1JcbU0kfQfYzGR+guI=; b=VDb5CjMcs53by2ULYPEL bge8UgF1YgR7MS/h2FMDQIULerTjdP6QIodGFTdPBGBS20srz1vpdB3XfbIzIxW6WlP22LsgY4xXh 3TPxmFrkZ+TTj6DnsvbOS1zXyV4UMYSJZOz2ovVWkdxMGBmZ5v0npgv3tuDXcQgQ8OEb/BAuYosRW s2Uf2S2P4TiLifGO5w+n3GYv7Jjo3lbz00RMlIQli1OlTFfJjUsH6q8vw9qBOGgPhx6DMCGqjJETE C75tNMCp2HaKqFxDOT2DCoWmSM41eDLoM5MhWMkcrPr49yQpnRJMYKbS5pN5kwoQ9ZSOBDAl61Jvk qg/j280mELZLfQ==; Received: from [84.211.203.64] (port=52352 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTI-00051Z-NR for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:28 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 12/14] gnu: python-mypy-protobuf: Switch to pyproject-build-system. Date: Mon, 17 Oct 2022 22:11:59 +0200 Message-Id: <20221017201201.4808-12-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/protobuf.scm (python-mypy-protobuf)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/protobuf.scm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm index a61d9d7492..e90e0ad3fa 100644 --- a/gnu/packages/protobuf.scm +++ b/gnu/packages/protobuf.scm @@ -31,6 +31,7 @@ (define-module (gnu packages protobuf) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system emacs) #:use-module (guix build-system ruby) @@ -285,22 +286,11 @@ (define-public python-mypy-protobuf (sha256 (base32 "0z03h9k68qvnlyhpk0ndwp01bdx77vrjr6mybxq4ldilkkbksklk")))) - (build-system python-build-system) + (build-system pyproject-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 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) (add-before 'check 'generate-protos-for-tests (lambda _ ;; Generate Python sources. @@ -324,7 +314,6 @@ (define-public python-mypy-protobuf (native-inputs (list python-grpc-stubs python-grpcio-tools - python-pypa-build python-pytest python-typing-extensions-next)) (propagated-inputs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:12:54 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:12:54 +0000 Received: from localhost ([127.0.0.1]:50172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTl-0007Ny-Sh for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTb-0007NN-Mg for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:43 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTW-0002Fr-Hw for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:38 -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=kz/i97HvqaiTyvuymkZ2Fixm3hr/OdiR/vl4HJtFCUw=; b=Q57rJfDQ+t8r8xyR5ZuG 3XWxLMAc4mENBdx3qajoQ9F8OpuCDnL2ac2yZ8mRGjAVCEW1NYg2vc0457KDA21lj2RopPRR937h1 P5ykv6+3AznHBJTvWOCA5z0kFqHkoA5WuejS2NoRlsMn4WPCavQ/I3WHYwLuCkyYTqCWwfsk3D0I+ +HqDSIJF5VhOAfpn3MvkISfRa5wdQBc8zSl/Y0tJ/+9PoDy/naMDnxOHrSB4gy4J77Fv/WUp8bV5+ Sla+DKDCySzPGMGGoTHhzzQxFgPGtJbs8BlEt5gzyHz9CaqPSP8BV7c7gtGRc15EWT4BgNoXoNNKm P6I8XG81jGzUSg==; Received: from [84.211.203.64] (port=56516 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTS-000526-0v for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:38 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 13/14] gnu: python-tempora: Switch to pyproject-build-system. Date: Mon, 17 Oct 2022 22:12:00 +0200 Message-Id: <20221017201201.4808-13-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-tempora)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Add #:test-flags. Remove #:phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/python-xyz.scm | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 42935cbaaa..f4113ca351 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -21199,30 +21199,13 @@ (define-public python-tempora (uri (pypi-uri "tempora" version)) (sha256 (base32 "09wirlk5vmxlhl9rnxp7g5qz2nsd6b0gnzk5fczbz0s8lsbz386b")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list - #:phases - #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Do not test the myproject.toml build as it tries to pull - ;; dependencies from the Internet. - (invoke "pytest" "-k" "not project"))))))) + ;; Do not test the myproject.toml build as it tries to pull + ;; dependencies from the Internet. + (list #:test-flags #~'("-vv" "-k" "not project"))) (native-inputs - (list python-pypa-build - python-freezegun + (list python-freezegun python-pytest python-pytest-black python-pytest-checkdocs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 17 16:13:01 2022 Received: (at 58587) by debbugs.gnu.org; 17 Oct 2022 20:13:01 +0000 Received: from localhost ([127.0.0.1]:50174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTm-0007O2-6V for submit@debbugs.gnu.org; Mon, 17 Oct 2022 16:13:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41410) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okWTe-0007NV-CB for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTZ-0002G5-4v for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12: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=is+XVJWlcy+CkXHy/QKMEkdG4Lfzm53VoWzYi8rHSIo=; b=UranploytYoi8ZFtwAUK 6nnlOH6sHhBAY0RvDB6pPMpOhLHvf01k1ymatvooI0sPmvYft8Y6luiC2C+gYDqzMmTQWBo3OaHQd TniARN4mrsJZzl3rsgfXyockr2SXA23KKGFfJa3tJC+jII5mluYwm3/NMPuO5bR0En/g8wk25bxa3 hFiAmFMcIqPYDnjWvBAtWIk62ZnTMhYMjXSV6YQzXBP0Aj9TLkng6eB7H++E/6yVyOSMf6VQavSs1 HpYOxUr1uS3E6GN8j4rHskuvQeyeuehZN4IwcdAatRXCbHgDCfN3Dl4nz3TIR+ot9c9j1ZY21Gy7b +Kre2RiyWmFOYg==; Received: from [84.211.203.64] (port=56524 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okWTX-00053i-LY for 58587@debbugs.gnu.org; Mon, 17 Oct 2022 16:12:40 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH 14/14] gnu: python-pygmsh: Use pyproject-build-system. Date: Mon, 17 Oct 2022 22:12:01 +0200 Message-Id: <20221017201201.4808-14-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/simulation.scm (python-pygmsh)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/simulation.scm | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index 39b5620822..57a7882765 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -57,6 +57,7 @@ (define-module (gnu packages simulation) #:use-module (guix svn-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) @@ -828,7 +829,7 @@ (define-public python-pygmsh (sha256 (base32 "11flp2c4ynk1fhanf4mqyzrpd0gjbnv6afrwwc7xi3mb6ms69lr0")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases @@ -838,21 +839,8 @@ (define-public python-pygmsh ;; Due to lack of metadata, the gmsh Python package is not ;; detected although importable. (substitute* "pyproject.toml" - (("\"gmsh\",") "")))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-v" "tests")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) - (native-inputs (list python-pypa-build python-flit-core python-pytest)) + (("\"gmsh\",") ""))))))) + (native-inputs (list python-flit-core python-pytest)) (propagated-inputs (list gmsh python-meshio python-numpy)) (home-page "https://github.com/nschloe/pygmsh") (synopsis "Python frontend for Gmsh") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 18 06:24:05 2022 Received: (at 58587) by debbugs.gnu.org; 18 Oct 2022 10:24:05 +0000 Received: from localhost ([127.0.0.1]:51295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okjlU-00015P-PC for submit@debbugs.gnu.org; Tue, 18 Oct 2022 06:24:05 -0400 Received: from mail-wr1-f49.google.com ([209.85.221.49]:42855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okjlS-00014F-VG for 58587@debbugs.gnu.org; Tue, 18 Oct 2022 06:24:03 -0400 Received: by mail-wr1-f49.google.com with SMTP id bp11so22700769wrb.9 for <58587@debbugs.gnu.org>; Tue, 18 Oct 2022 03:24:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=hPeRoVNy5k/7JLraTWKnypAPjMKJ/rbaR9qggrTMceY=; b=KESCFKIiqrov26lxNTAaA1w94SOtfT9he7wnL7CB00LQ3cjht9znhhn5ea+E+Vvym/ 3zZlkxzV9dovu7aJKE1pcnJgo3rBczlmHqUFdOOFHWjUExMhRiZnw9e+YHIcVlCo+Obh reWb6cGwlkRvdo/p3KRkDM4lVb5QujKFUA5UimsPZlVw0PcISdJsAst2ndUy56VaG23y DkVs9lU55NYborKhtnA7zyQD36g+pbj0H7ghZ4qROdmPlSSFf7TuCKOVuPGTo3i6NKiG seGdjS8YqVuR2vJxs/6m52r+fjR4kU0Vv9cIFuY8ges/gB0ZI8r5XxnJP2VwEuvssEpW ldYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hPeRoVNy5k/7JLraTWKnypAPjMKJ/rbaR9qggrTMceY=; b=uU1bT5/bnz4EVnV6GtAm8JJlhcwYajdzt0JkXIypUu3Jkqxo6lWrwpAfPVQ3pQQrh5 b3zid/lQWQoqE7XsTmOP9VwXF1HiJ9DnWA1R1LE+woA92tS1gTWcCIaaM2mZu3Ds228E iRy4O4vw6GxjN0NCJYL45jikRj1jvxMaCwbEHl1NNubLgh+9M8uDZd3ugvD67m8cqyAc 8QVFVmuhbz0trD2YQLpy5Phr8mprWDMzVVqtof1Dm+tvs9jTPHqr8/PxLXMs/2x9SOWX Dx0LVPc+NTH9Qzd5xzLiUU7UiiLq2uu0xXX8P9XDuukdPZ1JYurRH4Myz9U92wY9JXeh tIgA== X-Gm-Message-State: ACrzQf2FNNRo/xRlktYzNLxlFekZPuZf21OHcPSDIKNxyvVBZ6W/MRHz cveceS/qxhaW92jhml2LglA= X-Google-Smtp-Source: AMsMyM48dibbhy/PIZFi3hE/xgAe/OrZPnVIdfKf6msqjNbAM+kNz9kQw7W4nX0gFBhCpwIt0Q6ibw== X-Received: by 2002:a05:6000:1f97:b0:22e:6224:1e7b with SMTP id bw23-20020a0560001f9700b0022e62241e7bmr1388770wrb.502.1666088637071; Tue, 18 Oct 2022 03:23:57 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id j16-20020adfea50000000b00228d6bc8450sm12631511wrn.108.2022.10.18.03.23.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 03:23:56 -0700 (PDT) From: zimoun To: Marius Bakke , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <20221017200624.4076-1-marius@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> Date: Tue, 18 Oct 2022 11:33:00 +0200 Message-ID: <86sfjlzdbn.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Marius, On Mon, 17 Oct 2022 at 22:06, Marius Bakke wrote: > This is an adaptation of Lars' work in wip-python-pep517 for 'master'. Cool! > I've implemented it as a separate build system so we can do a slow > transition, starting at the leafs. [...] > I plan to eventually merge it with python-build-system instead of > keeping it separate. Thoughts? I would suggest to have a clear plan about this transition strategy. :-) I mean, if we go to two separated Python build-systems and then merge them, we have to write down the various steps; otherwise it could be quickly a mess. For example, 1. advertise about this new Python build-system 2. recommend only this new 3. only include package using this new 4. convert from old to new 5. remove old / rename old to new or whatever else. My concern is to have two build systems to maintain on the long term. Once something lands to master and the API, it is then hard to modify. Therefore, it appears to me better to draw beforehand the large lines of this transition plan. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 18 17:52:00 2022 Received: (at 58587) by debbugs.gnu.org; 18 Oct 2022 21:52:00 +0000 Received: from localhost ([127.0.0.1]:54999 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okuVD-0006rH-Vf for submit@debbugs.gnu.org; Tue, 18 Oct 2022 17:52:00 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okuVB-0006r4-Du for 58587@debbugs.gnu.org; Tue, 18 Oct 2022 17:51:58 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33516) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okuV5-0002fE-Gy; Tue, 18 Oct 2022 17:51: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:Date:References:In-Reply-To:Subject:To: From; bh=k196b6ln5keGDMuTlLRySoQmzAeWWsJOxoPqtxdsjEc=; b=VrFHVXhDBeq3laaX2fOx ityF2N32i6Yjs/x79I7xabob44Xowv/Xrw3tkErRJPbdsjYLGznG1o0/9xKuJR96pP4zBJ6jNwW6B 0+FkvEOm24Tkm0sAlriCso92NNB7YDGKxSItgpiiRY960CMgKnW4Y92SxwVHmP5AB0Y1cn2QDN2Xw FYyv2lXd0bsK0MzjKj6DBrE0DBXzb5DEhm250emRu04Q7H6oBasV2xs34PCeevIJRc/SvzkRUHeqZ QwPuuwI1WEnWlh59exx2bUwPCCYGb4eiMvoRmqpdm9uKX8Ox1jQHzrjRDaAU9IsrTfmziPEdF52BS VV5Uxndmdhg6Vw==; Received: from [84.211.203.64] (port=44944 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okuV5-0001ZL-1e; Tue, 18 Oct 2022 17:51:51 -0400 From: Marius Bakke To: zimoun , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <86sfjlzdbn.fsf@gmail.com> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> Date: Tue, 18 Oct 2022 23:51:47 +0200 Message-ID: <877d0wvlzg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain zimoun skriver: > Hi Marius, > > On Mon, 17 Oct 2022 at 22:06, Marius Bakke wrote: > >> I plan to eventually merge it with python-build-system instead of >> keeping it separate. Thoughts? > > I would suggest to have a clear plan about this transition strategy. :-) > I mean, if we go to two separated Python build-systems and then merge > them, we have to write down the various steps; otherwise it could be > quickly a mess. > > For example, > > 1. advertise about this new Python build-system > 2. recommend only this new > 3. only include package using this new > 4. convert from old to new > 5. remove old / rename old to new > > or whatever else. My concern is to have two build systems to maintain > on the long term. > > Once something lands to master and the API, it is then hard to modify. > Therefore, it appears to me better to draw beforehand the large lines of > this transition plan. I tried to address this in the attached documentation patch. The idea is to: * Recommend it for new packages in the 'guix' channel, mostly during patch review. * Once we are confident in the implementation, remove the "experimental" status and recommend it in the documentation. * Merge pieces of it into python-build-system as we go, such as sanity check changes, using python-toolchain, etc. * When we "know" that there won't be any major regressions, swap out python-build-system with pyproject-build-system entirely and mark the latter as deprecated. Thoughts? --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-doc-Document-pyproject-build-system.patch Content-Transfer-Encoding: quoted-printable From=20628944b6f4267c4eeb5884074298b82c8d17548c Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Tue, 18 Oct 2022 23:38:39 +0200 Subject: [PATCH] doc: Document pyproject-build-system. * doc/guix.texi (Build Systems): Add pyproject-build-system section. * doc/contributing.texi (Python Modules): Mention pyproject.toml and the PYTHON-TOOLCHAIN package. =2D-- doc/contributing.texi | 21 +++++++++++++-------- doc/guix.texi | 14 ++++++++++++++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/doc/contributing.texi b/doc/contributing.texi index 4b1eed1cb1..b9260267fa 100644 =2D-- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -791,7 +791,9 @@ described above. =20 Dependency information for Python packages is usually available in the package source tree, with varying degrees of accuracy: in the =2D@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). =20 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 +804,12 @@ following check list to determine which dependency go= es where. @itemize =20 @item =2DWe currently package Python 2 with @code{setuptools} and @code{pip} =2Dinstalled like Python 3.4 has per default. Thus you don't need to =2Dspecify either of these as an input. @command{guix lint} will warn you =2Dif 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. =20 @item Python dependencies required at run time go into @@ -814,9 +818,10 @@ Python dependencies required at run time go into @file{requirements.txt} file. =20 @item =2DPython packages required only at build time---e.g., those listed with =2Dthe @code{setup_requires} keyword in @file{setup.py}---or only for =2Dtesting---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 i= nto @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..145aa16afd 100644 =2D-- a/doc/guix.texi +++ b/doc/guix.texi @@ -9311,7 +9311,21 @@ 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 a reimplementation of @code{python-build-system} designed around +@file{pyproject.toml} and @url{https://peps.python.org/pep-0517/, PEP 517}, +and supports a variety of build backends and test frameworks. + +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}) and there should not +be any breaking changes. =20 +Eventually this build system will be deprecated and merged back into +@code{python-build-system}, probably some time in 2024. @end defvr =20 @defvr {Scheme Variable} perl-build-system =2D-=20 2.38.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY08f9A8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHdbjAEAsngTxsrGPAMsILaCgxcGbvrHt8q0Dc6Yd0Dn LyloOtIBAPZZ6cVfnFp/tIsOAs+gKYM6/R4Vfcxo8J7qZ4VNT2AD =DATx -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 06:15:49 2022 Received: (at 58587) by debbugs.gnu.org; 19 Oct 2022 10:15:49 +0000 Received: from localhost ([127.0.0.1]:55890 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol672-0003R0-NQ for submit@debbugs.gnu.org; Wed, 19 Oct 2022 06:15:49 -0400 Received: from mail-wm1-f51.google.com ([209.85.128.51]:53184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ol66v-0003Q7-N2 for 58587@debbugs.gnu.org; Wed, 19 Oct 2022 06:15:46 -0400 Received: by mail-wm1-f51.google.com with SMTP id l32so12600449wms.2 for <58587@debbugs.gnu.org>; Wed, 19 Oct 2022 03:15:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=CrBTcGEucohhwIaAdYRdST//f2L2StQzwhdiYJ9PbOQ=; b=Wq7OiTedTEpDo7r+LW07YqQpWu15f+EBIoBnFAqvcJbvl9u9jXQvMbxBG2ivLVi6hJ n3AHy5ZSd1Ju+4ojiqOB5BrpKy0ye3VLJBMxyOSfrXJU8VIKsnoyW37ZbM/BTWWQNoA4 AphJHAy7uHLPSevlTACaFUR6wCuQn4np8Y3XQqfitCyFDE+UKZ0ZhoPMkQ3H8MTMHXWC YcHuxQ6EKNV5/4fM8b0USUmuCu1I9wrzo4/d2wtiQivYaPcpKhVeR47f9NFjBXKp6ist Kp6vOYJSSrWMd9KyA2jaoWt3gnSM8uzvvFbXzpKjkkjxn4sj7OkvM+niI3DIY13q3MYN p6Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CrBTcGEucohhwIaAdYRdST//f2L2StQzwhdiYJ9PbOQ=; b=hoN5N5JkqLLZTxmlvOr6gCjnf8FPrfwIklnzv68cUzu2Wzvg47DoDs91/kmbsdcmR1 i2gLbGjsGCNnGNvGFDuMkqPzseNvMQyb76Ts+vVAXb74s4JObdG2P8VJ4BLsra3zTGOn w7rPhjLDe+bGXZsYR1yABjN5shB+SjpflKaTaK8vThShhEJZb3na7Q+jQL1itKqKlAo1 GepQrQHicTxqNkprOgSfWShpi2p0TuGnbCaIIKCDAs/QWfq6yPNjuH6cnxhlpnFslIlP /MxdZFd9K7ldSsyLOOPd/6TgfU8IsyPvN4RraygcIbgdRhJfQCxGzvfuPOeZ1enhUdc4 kXnw== X-Gm-Message-State: ACrzQf1vZl+YMR1vPimzj92zc0jhIutS30LSoU4i3lf3YMDyNJIrDybc ZkLoTF9ygaBavk1Je6qAZGj7XZduw/k= X-Google-Smtp-Source: AMsMyM5Tffot+nr7OTUJAc6Ysqp/RfmXNRkzj2TGgvfEKQuyinYoA5ITrewHlZ1oyIi5LJJ9iFb8lg== X-Received: by 2002:a05:600c:5488:b0:3b5:634:731 with SMTP id iv8-20020a05600c548800b003b506340731mr24607339wmb.188.1666174536134; Wed, 19 Oct 2022 03:15:36 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id h5-20020adfe985000000b002322bff5b3bsm16078000wrm.54.2022.10.19.03.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Oct 2022 03:15:35 -0700 (PDT) From: zimoun To: Marius Bakke , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <877d0wvlzg.fsf@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> Date: Wed, 19 Oct 2022 11:49:14 +0200 Message-ID: <86ilkgp2hx.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Hi Marius, On Tue, 18 Oct 2022 at 23:51, Marius Bakke wrote: > I tried to address this in the attached documentation patch. Neat! > The idea is to: > > * Recommend it for new packages in the 'guix' channel, mostly during > patch review. > * Once we are confident in the implementation, remove the "experimental" > status and recommend it in the documentation. > * Merge pieces of it into python-build-system as we go, such as sanity > check changes, using python-toolchain, etc. > * When we "know" that there won't be any major regressions, swap out > python-build-system with pyproject-build-system entirely and mark the > latter as deprecated. I would add a note, for instance, something like that: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=p.patch Content-Description: patch diff --git a/doc/contributing.texi b/doc/contributing.texi index 4b1eed1cb1..17dd4ec7a9 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -786,6 +786,24 @@ 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 +Instead of the default Python build system @var{python-build-system} +(@pxref{Build Systems}), we are encouraging to try the ``experimental'' +@var{pyproject-build-system} exported by @code{guix build-system +pyproject}. It is a reimplementation of @var{python-build-system} +designed around @file{pyproject.toml} and +@url{https://peps.python.org/pep-0517/, PEP 517}, and it supports a +variety of build backends and test frameworks. + +It is considered ``experimental'' in that the implementation details are +not set in stone yet. However, there should not be any breaking +changes, so please report any failure for new Python packages (even +those using @file{setup.py}). + +Eventually this @var{pyproject-build-system} will be deprecated and +merged back into @var{python-build-system}, probably some time in 2024. +@end quotation + @subsubsection Specifying Dependencies @cindex inputs, for Python packages --=-=-= Content-Type: text/plain > From 628944b6f4267c4eeb5884074298b82c8d17548c Mon Sep 17 00:00:00 2001 > From: Marius Bakke > Date: Tue, 18 Oct 2022 23:38:39 +0200 > Subject: [PATCH] doc: Document pyproject-build-system. > > * doc/guix.texi (Build Systems): Add pyproject-build-system section. > * doc/contributing.texi (Python Modules): Mention pyproject.toml and the > PYTHON-TOOLCHAIN package. LGTM. > --- > doc/contributing.texi | 21 +++++++++++++-------- > doc/guix.texi | 14 ++++++++++++++ > 2 files changed, 27 insertions(+), 8 deletions(-) > > diff --git a/doc/contributing.texi b/doc/contributing.texi > index 4b1eed1cb1..b9260267fa 100644 > --- a/doc/contributing.texi > +++ b/doc/contributing.texi [...] > +@defvr {Scheme Variable} pyproject-build-system > +This is a variable exported by @code{guix build-system pyproject}. It > +is a reimplementation of @code{python-build-system} designed around ^ s/code/var > +@file{pyproject.toml} and @url{https://peps.python.org/pep-0517/, PEP 517}, > +and supports a variety of build backends and test frameworks. > + > +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}) and there should not > +be any breaking changes. > > +Eventually this build system will be deprecated and merged back into > +@code{python-build-system}, probably some time in 2024. Idem Cheers, simon --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 19:12:06 2022 Received: (at 58587) by debbugs.gnu.org; 19 Oct 2022 23:12:07 +0000 Received: from localhost ([127.0.0.1]:60401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olIEH-0008K8-JC for submit@debbugs.gnu.org; Wed, 19 Oct 2022 19:12:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:38080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olIEB-0008Ja-S4 for 58587@debbugs.gnu.org; Wed, 19 Oct 2022 19:12:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39354) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olIE5-0002lp-VE; Wed, 19 Oct 2022 19:11:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=dHOIYMWInZbHm9YxJV+V4vJYNE3x6nwO5E90wLSn93U=; b=M88OY2kwdU8YSEfxTteA fVH+OmPYW3YGmsnx8buuyLDqP6dmxLivgW4S/BsOlbpze20OVH1Y5mLrChq6il6r69W2RmiKyhXYt VCsYrZxYbqQfPjFX7duWVKG92kYgXa20+AThFEdSc709SQ3MtGpgbGPg2zURwTuOmgipZVAfyYQed OBbuztBqMxiJPm6X+TXMhamiOQCOTbbIV8pJ4XU0jWHz61sSRTJmKwAHmgvSwsTmMqzoww9AxoVBZ Wutz9wd6nbuBOr+XGPCtlWWMQYWZDvz17gdb7sbLwuja5Ha//qATo+JzfiiDvk5TeLumYugMmAXfE iwlcl2iJbO4dMA==; Received: from [84.211.203.64] (port=49444 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olIE5-0006vQ-9a; Wed, 19 Oct 2022 19:11:53 -0400 From: Marius Bakke To: zimoun , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <86ilkgp2hx.fsf@gmail.com> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> <86ilkgp2hx.fsf@gmail.com> Date: Thu, 20 Oct 2022 01:11:49 +0200 Message-ID: <871qr3v26i.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain zimoun skriver: > I would add a note, for instance, something like that: [...] Good idea, although I don't like to duplicate so much information from the build system description. Here is my attempt: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/doc/contributing.texi b/doc/contributing.texi index b9260267fa..d12daa7ec3 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -786,6 +786,21 @@ 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 Pythons +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 --=-=-= Content-Type: text/plain >> +@defvr {Scheme Variable} pyproject-build-system >> +This is a variable exported by @code{guix build-system pyproject}. It >> +is a reimplementation of @code{python-build-system} designed around > ^ > s/code/var Fixed both instances, thanks. :-) I also made some substantial changes to the build system: * Moved 'python-toolchain' into python.scm which seems to work fine. * Inherit from python-build-system where possible. * Hint about deprecating 'add-installed-pythonpath', which has always annoyed me :-) I think a 'with-installed-pythonpath' would be much more ergonomic and plan to submit that later. * Most importantly, use three ;;; for module commentary. Patch below: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-fixup-pyproject.patch Content-Transfer-Encoding: quoted-printable From=20e765fbe232ddc57dd8ac2622a30736c5483bbf54 Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Wed, 19 Oct 2022 23:10:24 +0200 Subject: [PATCH] fixup pyproject =2D-- gnu/local.mk | 1 - gnu/packages/python-commencement.scm | 64 --------- gnu/packages/python.scm | 39 +++++- guix/build-system/pyproject.scm | 2 +- guix/build/pyproject-build-system.scm | 180 ++++++++------------------ 5 files changed, 95 insertions(+), 191 deletions(-) delete mode 100644 gnu/packages/python-commencement.scm diff --git a/gnu/local.mk b/gnu/local.mk index b6e0d262be..bf598cec8b 100644 =2D-- a/gnu/local.mk +++ b/gnu/local.mk @@ -511,7 +511,6 @@ GNU_SYSTEM_MODULES =3D \ %D%/packages/python-build.scm \ %D%/packages/python-check.scm \ %D%/packages/python-compression.scm \ =2D %D%/packages/python-commencement.scm \ %D%/packages/python-crypto.scm \ %D%/packages/python-science.scm \ %D%/packages/python-web.scm \ diff --git a/gnu/packages/python-commencement.scm b/gnu/packages/python-com= mencement.scm deleted file mode 100644 index 011ba2c38d..0000000000 =2D-- a/gnu/packages/python-commencement.scm +++ /dev/null @@ -1,64 +0,0 @@ =2D;;; GNU Guix --- Functional package management for GNU =2D;;; Copyright =C2=A9 2021 Lars-Dominik Braun =2D;;; Copyright =C2=A9 2022 Marius Bakke =2D;;; =2D;;; This file is part of GNU Guix. =2D;;; =2D;;; GNU Guix is free software; you can redistribute it and/or modify it =2D;;; under the terms of the GNU General Public License as published by =2D;;; the Free Software Foundation; either version 3 of the License, or (at =2D;;; your option) any later version. =2D;;; =2D;;; GNU Guix is distributed in the hope that it will be useful, but =2D;;; WITHOUT ANY WARRANTY; without even the implied warranty of =2D;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the =2D;;; GNU General Public License for more details. =2D;;; =2D;;; You should have received a copy of the GNU General Public License =2D;;; along with GNU Guix. If not, see . =2D =2D(define-module (gnu packages python-commencement) =2D #:use-module ((guix licenses) #:prefix license:) =2D #:use-module (guix packages) =2D #:use-module (guix gexp) =2D #:use-module (guix build-system trivial) =2D #:use-module (gnu packages) =2D #:use-module (gnu packages python) =2D #:use-module (gnu packages python-build) =2D #:use-module (srfi srfi-1) =2D #:use-module (srfi srfi-26)) =2D =2D(define-public python-toolchain =2D (package =2D (name "python-toolchain") =2D (version (package-version python)) =2D (source #f) =2D (build-system trivial-build-system) =2D (arguments =2D (list #:modules '((guix build union)) =2D #:builder =2D #~(begin =2D (use-modules (ice-9 match) =2D (srfi srfi-1) =2D (guix build union)) =2D (union-build #$output =2D (filter-map (match-lambda =2D ((_ . directory) directory)) =2D %build-inputs))))) =2D (inputs =2D (list python-sans-pip-wrapper =2D python-pypa-build =2D python-pip =2D python-setuptools =2D python-wheel)) =2D (native-search-paths =2D (package-native-search-paths python)) =2D (search-paths =2D (package-search-paths python)) =2D (license (package-license python)) =2D (synopsis "Python toolchain") =2D (description =2D "Python toolchain including Python itself, setuptools and pip. Use= this =2Dpackage if you need a minimal Python toolchain instead of just the =2Dinterpreter.") =2D (home-page (package-home-page python)))) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 953044f55f..f55e5a16da 100644 =2D-- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -26,7 +26,7 @@ ;;; Copyright =C2=A9 2016, 2017 Nikita ;;; Copyright =C2=A9 2016 Dylan Jeffers ;;; Copyright =C2=A9 2016 David Craven =2D;;; Copyright =C2=A9 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke +;;; Copyright =C2=A9 2016-2022 Marius Bakke ;;; Copyright =C2=A9 2016, 2017 Stefan Reich=C3=B6r ;;; Copyright =C2=A9 2016, 2017 Alex Vong ;;; Copyright =C2=A9 2016, 2017, 2018 Arun Isaac @@ -60,6 +60,7 @@ ;;; Copyright =C2=A9 2020, 2021 Greg Hogan ;;; Copyright =C2=A9 2022 Philip McGrath ;;; Copyright =C2=A9 2022 jgart +;;; Copyright =C2=A9 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) @@ -687,6 +689,41 @@ (define-public python-sans-pip (define-public python-sans-pip-wrapper (wrap-python3 python-sans-pip)) =20 +(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 t= his +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 index 8e320529cc..d6b727ab5d 100644 =2D-- a/guix/build-system/pyproject.scm +++ b/guix/build-system/pyproject.scm @@ -56,7 +56,7 @@ (define %pyproject-build-system-modules (define (default-python) "Return the default Python package." ;; Lazily resolve the binding to avoid a circular dependency. =2D (let ((python (resolve-interface '(gnu packages python-commencement)))) + (let ((python (resolve-interface '(gnu packages python)))) (module-ref python 'python-toolchain))) =20 (define sanity-check.py diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject-b= uild-system.scm index 141d4d849f..db317e10e5 100644 =2D-- a/guix/build/pyproject-build-system.scm +++ b/guix/build/pyproject-build-system.scm @@ -32,7 +32,7 @@ ;;; along with GNU Guix. If not, see . =20 (define-module (guix build pyproject-build-system) =2D #:use-module ((guix build gnu-build-system) #:prefix gnu:) + #:use-module ((guix build python-build-system) #:prefix python:) #:use-module (guix build utils) #:use-module (guix build json) #:use-module (ice-9 match) @@ -50,31 +50,42 @@ (define-module (guix build pyproject-build-system) python-version pyproject-build)) =20 =2D;; Commentary: =2D;; =2D;; PEP 517-compatible build system for Python packages. =2D;; =2D;; PEP 517 mandates the use of a TOML file called pyproject.toml at the =2D;; project root, describing build and runtime dependencies, as well as t= he =2D;; build system, which can be different from setuptools. This module uses =2D;; that file to extract the build system used and call its wheel-building =2D;; entry point build_wheel (see 'build). setuptools=E2=80=99 wheel build= er is =2D;; used as a fallback if either no pyproject.toml exists or it does not =2D;; declare a build-system. It supports config_settings through the =2D;; standard #:configure-flags argument. =2D;; =2D;; This wheel, which is just a ZIP file with a file structure defined =2D;; by PEP 427 (https://www.python.org/dev/peps/pep-0427/), is then unpac= ked =2D;; and its contents are moved to the appropriate locations in 'install. =2D;; =2D;; Then entry points, as defined by the PyPa Entry Point Specification =2D;; (https://packaging.python.org/specifications/entry-points/) are read =2D;; from a file called entry_points.txt in the package=E2=80=99s site-pac= kages =2D;; subdirectory and scripts are written to bin/. These are not part of a =2D;; wheel and expected to be created by the installing utility. =2D;; =2D;; Caveats: =2D;; - There is no support for in-tree build backends. +;;; 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=E2=80=99 wheel builde= r 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 unpack= ed +;;; 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=E2=80=99s site-pack= ages +;;; subdirectory and scripts are written to bin/. These are not part of a +;;; wheel and expected to be created by the installing utility. +;;; +;;; 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) +;; XXX: This procedure is not very functional, now might be a good time +;; to deprecate it. +(define add-installed-pythonpath python:add-installed-pythonpath) =20 ;; Base error type. (define-condition-type &python-build-error &error @@ -179,39 +190,6 @@ (define* (check #:key inputs outputs tests? test-backe= nd test-flags #:allow-othe (else (raise (condition (&test-system-not-found)))))) (format #t "test suite not run~%"))) =20 =2D(define (python-version python) =2D (let* ((version (last (string-split python #\-))) =2D (components (string-split version #\.)) =2D (major+minor (take components 2))) =2D (string-join major+minor "."))) =2D =2D(define (python-output outputs) =2D "Return the path of the python output, if there is one, or fall-back t= o out." =2D (or (assoc-ref outputs "python") =2D (assoc-ref outputs "out"))) =2D =2D(define (site-packages inputs outputs) =2D "Return the path of the current output's Python site-package." =2D (let* ((out (python-output outputs)) =2D (python (assoc-ref inputs "python"))) =2D (string-append out "/lib/python" (python-version python) "/site-pack= ages"))) =2D =2D(define (add-installed-pythonpath inputs outputs) =2D "Prepend the site-package of OUTPUT to GUIX_PYTHONPATH. This is usefu= l when =2Drunning checks after installing the package." =2D (setenv "GUIX_PYTHONPATH" (string-append (site-packages inputs outputs= ) ":" =2D (getenv "GUIX_PYTHONPATH")))) =2D =2D(define* (add-install-to-pythonpath #:key inputs outputs #:allow-other-k= eys) =2D "A phase that just wraps the 'add-installed-pythonpath' procedure." =2D (add-installed-pythonpath inputs outputs)) =2D =2D(define* (add-install-to-path #:key outputs #:allow-other-keys) =2D "Adding Python scripts to PATH is also often useful in tests." =2D (setenv "PATH" (string-append (assoc-ref outputs "out") =2D "/bin:" =2D (getenv "PATH")))) =2D (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-dist= ribution-1-0-py32-none-any-whl @@ -301,9 +279,20 @@ (define (list-directories base predicate) =20 (define* (compile-bytecode #:key inputs outputs (configure-flags '()) #:al= low-other-keys) "Compile installed byte-code in site-packages." =2D (let ((site-dir (site-packages inputs outputs))) =2D (invoke "python" "-m" "compileall" "--invalidation-mode=3Dunchecked-= hash" =2D site-dir))) + (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 (=3D major 3) (< minor 7))))))) + (if <3.7? + ;; These versions don=E2=80=99t have the hash invalidation modes a= nd 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=3Dunchecke= d-hash" + site-dir)))) =20 (define* (create-entrypoints #:key inputs outputs (configure-flags '()) #:= allow-other-keys) "Implement Entry Points Specification @@ -371,34 +360,6 @@ (define (create-script path name module function) (entry-points.txt->entry-points f))) entry-point-files))) =20 =2D(define* (wrap #:key inputs outputs search-paths #:allow-other-keys) =2D (define (list-of-files dir) =2D (find-files dir (lambda (file stat) =2D (and (eq? 'regular (stat:type stat)) =2D (not (wrapped-program? file)))))) =2D =2D (define bindirs =2D (append-map (match-lambda =2D ((_ . dir) =2D (list (string-append dir "/bin") =2D (string-append dir "/sbin")))) =2D outputs)) =2D =2D ;; Do not require "bash" to be present in the package inputs =2D ;; even when there is nothing to wrap. =2D ;; Also, calculate (sh) only once to prevent some I/O. =2D (define %sh (delay (search-input-file inputs "bin/bash"))) =2D (define (sh) (force %sh)) =2D =2D (let* ((var `("GUIX_PYTHONPATH" prefix =2D ,(search-path-as-string->list =2D (or (getenv "GUIX_PYTHONPATH") ""))))) =2D (for-each (lambda (dir) =2D (let ((files (list-of-files dir))) =2D (for-each (cut wrap-program <> #:sh (sh) var) =2D files))) =2D bindirs))) =2D (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. @@ -407,54 +368,25 @@ (define* (set-SOURCE-DATE-EPOCH #:rest _) ;; not support timestamps before 1980. (setenv "SOURCE_DATE_EPOCH" "315619200")) =20 =2D(define* (enable-bytecode-determinism #:rest _) =2D "Improve determinism of pyc files." =2D ;; Use deterministic hashes for strings, bytes, and datetime objects. =2D (setenv "PYTHONHASHSEED" "0") =2D ;; Prevent Python from creating .pyc files when loading modules (such = as =2D ;; when running a test suite). =2D (setenv "PYTHONDONTWRITEBYTECODE" "1")) =2D =2D(define* (ensure-no-cythonized-files #:rest _) =2D "Check the source code for @code{.c} files which may have been pre-gen= erated =2Dby Cython." =2D (for-each =2D (lambda (file) =2D (let ((generated-file =2D (string-append (string-drop-right file 3) "c"))) =2D (when (file-exists? generated-file) =2D (format #t "Possible Cythonized file found: ~a~%" generated-fi= le)))) =2D (find-files "." "\\.pyx$"))) =2D (define %standard-phases ;; The build phase only builds C extensions and copies the Python source= s, ;; while the install phase copies then byte-compiles the sources to the ;; prefix directory. The check phase is moved after the installation ph= ase ;; to ease testing the built package. =2D (modify-phases gnu:%standard-phases =2D (add-after 'unpack 'enable-bytecode-determinism =2D enable-bytecode-determinism) =2D (add-after 'enable-bytecode-determinism 'ensure-no-cythonized-files =2D ensure-no-cythonized-files) + (modify-phases python:%standard-phases (replace 'set-SOURCE-DATE-EPOCH set-SOURCE-DATE-EPOCH) =2D (delete 'bootstrap) =2D (delete 'configure) ;not needed (replace 'build build) =2D (delete 'check) ;moved after the install phase (replace 'install install) =2D (add-after 'install 'add-install-to-pythonpath add-install-to-python= path) =2D (add-after 'add-install-to-pythonpath 'add-install-to-path =2D add-install-to-path) =2D (add-after 'add-install-to-path 'wrap wrap) =2D ;; must be before tests, so they can use installed packages=E2=80=99= entry points. + (delete 'check) + ;; Must be before tests, so they can use installed packages=E2=80=99 e= ntry points. (add-before 'wrap 'create-entrypoints create-entrypoints) (add-after 'wrap 'check check) =2D (add-after 'check 'sanity-check sanity-check) + (replace 'sanity-check sanity-check) (add-before 'check 'compile-bytecode compile-bytecode))) =20 (define* (pyproject-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) "Build the given Python package, applying all of PHASES in order." =2D (apply gnu:gnu-build #:inputs inputs #:phases phases args)) + (apply python:python-build #:inputs inputs #:phases phases args)) =20 ;;; pyproject-build-system.scm ends here =2D-=20 2.38.0 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1CENQ8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHf8gQD8DY121u0V6gzcSqLgo6atwR9Cpi01rG3jgHph EO85aFkBAL19JRv/R5qQLp+BxvqlBan/NRqZpWHYEtM6yBWCr7gG =Y0F9 -----END PGP SIGNATURE----- --==-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 19 19:17:36 2022 Received: (at 58587) by debbugs.gnu.org; 19 Oct 2022 23:17:36 +0000 Received: from localhost ([127.0.0.1]:60416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olIJc-0008TW-Bt for submit@debbugs.gnu.org; Wed, 19 Oct 2022 19:17:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olIJa-0008TJ-Ia for 58587@debbugs.gnu.org; Wed, 19 Oct 2022 19:17:34 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40908) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olIJT-0003Y4-Jo; Wed, 19 Oct 2022 19:17:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=UR4qIp/mxs2rT/ntQhnzZyEQCPRWV9fFWAs8424dKb8=; b=DvuB2k2/5cphIbYRDdS0 1vrw2nL75TW0AaCnMe6ijfnqL0TaabjZD5KiIopif1grClwsc+mvJkFTOKvsbQa22tSeo4sZp7ymK d418PbjaHYxXHmzyklbB72D5+5zsxrA+Ez2omhEImO4vULQNTD2i0H/mAY4QcFPoD87C2mOLZLQu1 ePmygSDSaFz6K9Jj6fhji7x7cNVPY7YPo5hOeUrtdb/YXeKyy+0Xorkz6rE/C4P6ciqPSsXj4sSUH YtM4oQTxHeGyveVUvz/1Rt1c6FuIywGLoVdiVAKc3tw5p3GkLidt6yzwMjFXVO/39P/HGjgK5zmiD s6rYXH3BWisMqQ==; Received: from [84.211.203.64] (port=48562 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1olIJS-0007P5-08; Wed, 19 Oct 2022 19:17:26 -0400 From: Marius Bakke To: zimoun , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <871qr3v26i.fsf@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> <86ilkgp2hx.fsf@gmail.com> <871qr3v26i.fsf@gnu.org> Date: Thu, 20 Oct 2022 01:17:22 +0200 Message-ID: <87y1tbtnct.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Marius Bakke skriver: > I also made some substantial changes to the build system: > > * Moved 'python-toolchain' into python.scm which seems to work fine. > * Inherit from python-build-system where possible. > * Hint about deprecating 'add-installed-pythonpath', which has always > annoyed me :-) I think a 'with-installed-pythonpath' would be much > more ergonomic and plan to submit that later. > * Most importantly, use three ;;; for module commentary. Also reinstated support for Python < 3.7, which I realized will be necessary when merging back into python-build-system. I'll squash the last patch before merging the series if that was not obvious from the commit message. :-) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1CFgg8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHcjwQD+LEQgZuzdZ5NBuATKnFQuk51ll8SSq8e1k7s7 zueTgC8BANiWo1iFi3N+Xb8ZC2/mC/QuUplNOffEqjGg6oeKmtMI =2jZ9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 20 04:56:57 2022 Received: (at 58587) by debbugs.gnu.org; 20 Oct 2022 08:56:57 +0000 Received: from localhost ([127.0.0.1]:32937 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olRMG-0006Yl-V6 for submit@debbugs.gnu.org; Thu, 20 Oct 2022 04:56:57 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:44826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1olRM9-0006Xu-Qn for 58587@debbugs.gnu.org; Thu, 20 Oct 2022 04:56:51 -0400 Received: by mail-wr1-f46.google.com with SMTP id v1so3987736wrt.11 for <58587@debbugs.gnu.org>; Thu, 20 Oct 2022 01:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=G75X43p+HExSTIM87JUzZaxCwcCWhiXOlbDSGgfWGkA=; b=coXjy20vY4y8g6NR8GELB6L5Kx9yS/9dIwNKtqYkCNzdSR92Iv1AKnOTvr6vgI/41N 0dIKQgz0dyJ+gNFpCOpBgbvVnhSqw4d/S3o5HEN61v+Kw261nK51whtQCrCSPzOGBDUc E36hW5oHQDhKQmoOkNJ8Rj2JcnnDYRIZhhZhaKfIA5deQWR3tgjG+t73zve0PN+7+BAn bsG0EGB4WLoeGc8aRm7jrx5fS46YddqJFyqi1F16bz4dNFFVCORbNWQJ6JuMfY8Pj5fO sAUcar5FIn91tn43hE6uJJRS8Tg/GJQBsQVCw043xJ83hb0JNFzz9e2P28bOFq21kvm8 /ZWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=G75X43p+HExSTIM87JUzZaxCwcCWhiXOlbDSGgfWGkA=; b=z8zPFFyMjQYIJcfiwHkVhH2s1kOfVaVA28BixP3wSMDhccp3xbSEb2enhkxDF6WQG9 KDjDyupP0QKkbPQChP2ldB3wAfRWOT+DDPfIZ8eObmkeIBPNJyXNix79y/bbb9fWALuk qCDxBrdaoOUq5+94B0z5acKnHVFsmvBABoWvbmBQOjOYAug2vZYEF6CKy6vgpiQ8KE9w 3mRW9yJHoOobRg5zJe02p7wgYYAqh3Mvi8EW3LyZzhgE/0yzKuxN6XHg7XCrEKUWkJtp 5C8M2SEXgR40cwE9h7/Mace+MMz1+zxf2bQ2i9+jb50jAkoFZ27eJHseV+QiGT45p/eY QSow== X-Gm-Message-State: ACrzQf1fQ5tpigZT1EiXSkC3X2qcaD9iZz4pvXoFbxwdPgjmh0GHwVKm gSL1ZZdfF3utk/9zo42gAKjb1wmq84g= X-Google-Smtp-Source: AMsMyM6WLLYOPd7kVGMifJp+n+hAYjuoGQBExSsAHnZEXo7zFfG05hpKunl7eOymVa/OxVgIVx6C6g== X-Received: by 2002:a5d:6d86:0:b0:22e:4049:441f with SMTP id l6-20020a5d6d86000000b0022e4049441fmr7860954wrs.198.1666256204329; Thu, 20 Oct 2022 01:56:44 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id c7-20020a05600c0ac700b003c6fb525b4csm2238278wmr.38.2022.10.20.01.56.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 01:56:44 -0700 (PDT) From: zimoun To: Marius Bakke , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <871qr3v26i.fsf@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> <86ilkgp2hx.fsf@gmail.com> <871qr3v26i.fsf@gnu.org> Date: Thu, 20 Oct 2022 10:08:35 +0200 Message-ID: <87v8oekjcs.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Marius, On jeu., 20 oct. 2022 at 01:11, Marius Bakke wrote: > Good idea, although I don't like to duplicate so much information from > the build system description. Here is my attempt: Cool! > diff --git a/doc/contributing.texi b/doc/contributing.texi > index b9260267fa..d12daa7ec3 100644 > --- a/doc/contributing.texi > +++ b/doc/contributing.texi > @@ -786,6 +786,21 @@ 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 Pythons ^ typo? > +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 LTGM. For the rest of the series, I have not yet given a look. Cheers, simon From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:06:44 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:06:44 +0000 Received: from localhost ([127.0.0.1]:42342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJpT-0003FM-Oe for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:06:44 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33194) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJpQ-0003F8-G7 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:06:42 -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 1omJpK-0002OU-3a; Sat, 22 Oct 2022 15:06:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=X5KeGVsJzSaFdMmvLEQArVCvxICfv4MnSvyaBImMXLg=; b=lZpT5y5aCQBlt8uPdltB wmP451B++pBjEhcC5hkYwuYwYkbKQi0sxYZjHM8VMadK68dgaBz+NAnCsu86hPEta1A1+8Y3/pg7a naLAWcrddzERhxiPxoVxwslacDzhKyM5EkYw2QfpEweCbCTZDbfJd7DCYE0xXt0mqOakyRlfjO6jv BbBQhutA0UD7txKixXKG/6WBUbIUX8F3p8KJyzm/SPn823dKkRj4QaSxzyUIlpmwC1RHNURYQ+tDw iwXz4VJayaZ1sSM/Z/Ijcl51o4mOTUi0XxUIETL611HDXjZzmqxNAOYQ3bo/QXAdtH3/wF2FFa4Ed l9xSsKJ4w8gVgQ==; 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 1omJpJ-0003Yf-8y; Sat, 22 Oct 2022 15:06:33 -0400 From: Marius Bakke To: zimoun , 58587@debbugs.gnu.org Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. In-Reply-To: <87v8oekjcs.fsf@gmail.com> References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> <86ilkgp2hx.fsf@gmail.com> <871qr3v26i.fsf@gnu.org> <87v8oekjcs.fsf@gmail.com> Date: Sat, 22 Oct 2022 21:06:25 +0200 Message-ID: <87eduzu18u.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun , Maxim Cournoyer X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable zimoun skriver: > Hi Marius, > > On jeu., 20 oct. 2022 at 01:11, Marius Bakke wrote: > >> diff --git a/doc/contributing.texi b/doc/contributing.texi >> index b9260267fa..d12daa7ec3 100644 >> --- a/doc/contributing.texi >> +++ b/doc/contributing.texi >> @@ -786,6 +786,21 @@ for instance, the module python-dateutil is package= d under the names >> starts with @code{py} (e.g.@: @code{pytz}), we keep it and prefix it as >> described above. >>=20=20 >> +@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 Pythons > ^ > typo? Right, I've adjusted it! >> +success, but was difficult to build tooling around. As a result, a host >> +of alternative build systems emerged and the community eventually settl= ed 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 su= pport >> +all the various PEP-517 @emph{build backends}, but you are encouraged t= o try >> +it for new Python packages and report any problems. It will eventually= be >> +deprecated and merged into @var{python-build-system}. >> +@end quotation > > LTGM.=20=20 Thanks for checking. I've now added a section in the manual about API changes and stability, and removed more duplicate code from pyproject-build-system. I also added a news entry. I think this is now ready for merge, but have some concerns: * The python-toolchain package is a union that includes setuptools, wheel and others. Packages that pick up a reference to the build-time Python will needlessly include those other packages. It could be worked around by propagating instead of using a union. * Overriding #:test-flags means having to add back the implicit defaults for verbose output. We could add them even when #:test-flags is present so users don't need to add "-vv" manually. Thoughts? I will merge this in a few days if there are no further comments. It can still be tweaked directly on 'master' if necessary. Updated patches follow shortly. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1Q/MQ8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHfQ4wEAhu39WBo+JB2Z0JklcriZDXP9csXYK0peReOL g7REZ8EBAJtHa0KzEs0dub7SsrCVt2VceUE4ci0cu26iVw8OzTsM =ahPo -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:09:46 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v2 01/22] gnu: python-setuptools: Move to python-build. 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:09:53 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v2 02/22] gnu: pypy: Move to separate module. 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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)) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:09:58 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v2 03/22] gnu: python-pip: Move to (gnu packages python-build). 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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:10:10 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v2 04/22] build-system: Add pyproject-build-system. 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 15:10:20 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v2 05/22] news: Add entry for 'pyproject-build-system'. 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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}") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:35 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:35 +0000 Received: from localhost ([127.0.0.1]:42523 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs2-0001vZ-Cs for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42314) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMry-0001vG-Iy for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:32 -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 1omMrs-00054G-FJ; Sat, 22 Oct 2022 18:21:24 -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=kNRe6WXfm6bTFTHey/Vw T+sygJHEfYDLCAUUC8dWxz/91bTTgnqhuQ2rHwLvVmyDvMMrxbpHFj2nAF8j5/Cc3ledNpZcmVjr+ plJA8r3gMVE6zd8K+mdShgT771gZhxRk0ip2pK7oP40ROKL4rNKrnxuivRwFQp0riKXE8n7qdxtXb aOWo2S684dlTobWPg8G8RSjImTP5Iqo1E4Zw3b92am7Rl3kwwkml6EDKd8ztrZ3Pc1cHHGPjDSOUM t+TM4L1VwizAGQagCbaI/7ycVD3L0822BLJRb89uT1CkvYtQNp1upEZiX2oRbGvvFsRcdrDK/nI/H uxbqOQX9E+ndBA==; 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 1omMrW-0001Ky-U4; Sat, 22 Oct 2022 18:21:19 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 01/22] gnu: python-setuptools: Move to python-build. Date: Sun, 23 Oct 2022 00:20:39 +0200 Message-Id: <20221022222100.18103-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:40 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:40 +0000 Received: from localhost ([127.0.0.1]:42535 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs7-0001w4-SO for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:40 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs4-0001vP-MF for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:37 -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 1omMrz-00055f-Gg for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:31 -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=cbS4DXdIvtAlBfVyH9Co lOs1uO4vwtmUL3RwVV3MV5dIy6pMqe/YNZ1detJYYvCVTUW8es67Yp983UpuIrvRCqMZlSB5VPm77 lW+Ola8YFQP4kXySLdr2FLTTWx7rRjDdhJXDzLtdCTLBQbBQ+JIwm5s2UP2d6X7ocDlizH6hokkPb lwAwSdfTbPDrpoTqCWCnH5EBVi3auaue/UmRj22eTpSohNeDpyUcYLT6OUd4dPqNxofXlin3cZomS gpW8muRdeboyma3CQy7hSVXi7xDqck43WZSBUOsJACgywBRuEt5Fo3G326UK5paysHbxOLB48/VXj qRBSh4HtHBMlbg==; 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 1omMry-0001R6-TK for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:31 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 03/22] gnu: python-pip: Move to (gnu packages python-build). Date: Sun, 23 Oct 2022 00:20:41 +0200 Message-Id: <20221022222100.18103-3-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:49 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:49 +0000 Received: from localhost ([127.0.0.1]:42541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsF-0001wk-Qq for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs3-0001vN-EB for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:38 -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 1omMrx-00055Y-Qv; Sat, 22 Oct 2022 18:21:29 -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=Umfmr5KUtTCptCfztQF5 04c7grQ2so8ScHx50rVqjitrlmnzoPp0jjbMCQHDAGzv55UaXAROSmeUB89EfLt6KCzdjPIfccwHP 8e710C+VL7aQ1hKGkBQltRVnIO09d4nYY1DIAO/+liwc80pUDDnrWscTiW5e/u5PBoxyFXCW/hZv0 UHZ92jhSHSsUulr1z/PgFucwZLRq0yC1kh5rWHK2GmOXLIdZchtYNPOn+N6/wpyZhmGNei+DcXWZF jRD5elxZlJZ6l+lv2nPBFdFVHNbfa/MOJ9CNsEmZjTybcZYv5JS9+iyb6SxGpWlwr/3tbK+7GDNaW nD7yklm6qed3Zw==; 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 1omMrt-0001Pq-VH; Sat, 22 Oct 2022 18:21:29 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 02/22] gnu: pypy: Move to separate module. Date: Sun, 23 Oct 2022 00:20:40 +0200 Message-Id: <20221022222100.18103-2-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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)) -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:52 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:52 +0000 Received: from localhost ([127.0.0.1]:42545 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsH-0001wv-K0 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42320) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs6-0001vX-4Y for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:40 -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 1omMs0-00055r-UR; Sat, 22 Oct 2022 18:21:32 -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=eWQPcmJocZl3NMY92nG3C0gNYXSfQIsEJAlkGooTdpU=; b=L2PxTcMZDaDYETQKZwkY HJ0FJleVnkOqHV07O49z9ydOBiKZG1SDGTGeETH73ote7PlxKMWeKkxZL1NsB265yisTY7JExN4R8 zbLaT0xk0Iu+VRVeuBz4bj6cHlsu4KLtlJhrfyY0/zb5xZpS/9xf3G3Su5jXg0V1qYWJRXpNiAeBR y+1DklsIw3iVA2Olm6FuSO64bwP34VbbfLLAH6+bloOrs4JjO0Earbs6H51qoffK4SSr3M09v3KKb UgoDltSBHIC2K22lP2Smh4oUSyEUk3z6Lwm6isvRDum2sslb5dlvxozqCAYogZiPoscvo2RPe+iH4 ZGdKktoqD3NNtA==; 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 1omMs0-0001RB-DO; Sat, 22 Oct 2022 18:21:32 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 04/22] build-system: Add pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:42 +0200 Message-Id: <20221022222100.18103-4-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 | 147 +++++++ guix/build/pyproject-build-system.scm | 367 ++++++++++++++++++ 7 files changed, 722 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..1e365d4f21 --- /dev/null +++ b/guix/build-system/pyproject.scm @@ -0,0 +1,147 @@ +;;; 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)) + +(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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:52 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:21:52 +0000 Received: from localhost ([127.0.0.1]:42549 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsK-0001xE-1X for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:52 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMs7-0001vb-P1 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:42 -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 1omMs2-000568-Ih for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:34 -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=67GeqkP3hGjHSt5+tzXANr2lznv7u8X8n4ipIOh1pZ4=; b=qNvlvmtv0fZIYpIXDF3k Mj64plz6sWImsgz1MbeRGEW5vfqC2VZwRLJbVBtrQE5xERrHyYUVXqi7whnG25gio227e7cXCSBR/ By81r7W10C4XSQ//VHOhaDvSzTcAvXoMQofFABxpEdo7PMyUBNMQF0XBQpL1JAt9TkLWSTUQ3NEnX RZPcGKa6sHaRIEyPv1ONucV/8JTiz/uvSsGQ0k93oIErGhr4zToeGFG3uYsfAfx+kCYGIALRbuRx+ 2RwSQ8zZ2jA9BPczUyOKAuLe+powViw983MZlGzTvd3ipJDK8NvU2za6BLvivP93wFCz//IUkKwLJ uTMe8mxq/PLz+g==; 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 1omMs2-0001RH-3H for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:34 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 05/22] news: Add entry for 'pyproject-build-system'. Date: Sun, 23 Oct 2022 00:20:43 +0200 Message-Id: <20221022222100.18103-5-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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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..c2ac842947 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 "3f82a8b2d075f5980ffa8cdd9c49a5a8586e5b1b") + (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}") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:21:53 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v3 06/22] gnu: python-autopage: Use pyproject-build-system. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:03 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:03 +0000 Received: from localhost ([127.0.0.1]:42558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsV-0001yN-CX for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:03 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34038) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsF-0001wR-Lt for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:48 -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 1omMsA-00056Z-Gf for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:42 -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=GJEyjFVjDOSDLaNg7FYY8NKuh0hVe3tcRl8rQQG5NtQ=; b=KNTlgVbHs8SBdQSi6pKf 7Yl3Fk9jNCkmlKsYYDFbUJ1cq45qnQu/mSan3bixiwc7peBj2QYJyGRtrswG7oM+VTPd/B/yy678s vyUCzQKXyK4u9VWrZfP2vthbv3bFdOonyxaiEULtg+vkjZp5kZ0JLnybb5LNBEEJnoeqmoAMo4k+B 8madAez0jShH+XjRxTyW4EoZfzINRNi9yPkQcyXWfrg2aFcg/Zz5ZpyebizMPNOPoWPFWOHGcMsYd Fis2aauytana7xrsFMNZMQ2OWEYj15fYQqoewGI1l2qSmeADJwR2XTL0BE/OOus0mUzlZ624Zihra FvIRDuxczHXyJw==; 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 1omMsA-0001RR-2g for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:42 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 07/22] gnu: flair: Switch to pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:45 +0200 Message-Id: <20221022222100.18103-7-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/bioinformatics.scm (flair)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove #:phases. [native-inputs]: Remove. --- gnu/packages/bioinformatics.scm | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm index f2de09aa32..3588f4e3fd 100644 --- a/gnu/packages/bioinformatics.scm +++ b/gnu/packages/bioinformatics.scm @@ -56,6 +56,7 @@ (define-module (gnu packages bioinformatics) #:use-module (guix build-system meson) #:use-module (guix build-system ocaml) #:use-module (guix build-system perl) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix build-system r) @@ -16928,33 +16929,15 @@ (define-public flair (sha256 (base32 "106swb2q7l20ki58fca1hg95q5f79bgp9gjb0clr2243ycrzyxf8")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list - #:tests? #false ;there are none - #:phases - #~(modify-phases %standard-phases - ;; TODO: implement as a feature of python-build-system (PEP-621, - ;; PEP-631, PEP-660) - (replace 'build - (lambda _ - (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) - ;; ZIP does not support timestamps before 1980. - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (apply invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output - (find-files "dist" "\\.whl$"))))))) + (list #:tests? #false)) ;there are none (propagated-inputs (list python-mappy python-ncls python-pybedtools python-pysam python-tqdm)) - (native-inputs - (list python-pypa-build python-setuptools)) (home-page "https://flair.readthedocs.io/en/latest/") (synopsis "Full-length alternative isoform analysis of RNA") (description "This package implements FLAIR (Full-Length Alternative -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:04 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:04 +0000 Received: from localhost ([127.0.0.1]:42561 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsV-0001yV-QX for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:34040) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsH-0001wY-8g for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:49 -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 1omMsC-00056f-2k for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21: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=kflm8QbXlO5a2zk+j3MCbpwjiqHbJv2OCcaL4iwNSK4=; b=qrzqQrsXC/m+8XKSdfx0 H1bLxVmwHVVWQesbzLGZWEXzEcwbpw9Phoy8KngJu6nlPzIqRkv0CapWl7MlooapHv5CbcRRYT/FO Qg/liCHqatbg1tcxcp5drkRmMIOpXi1zdDjKU5Bwiwmn99m5C/0l/3rtk278i05CzaMuhbtUBtBzB PxDaXrhIT7+FeQqwmGJPGm5TXsJEFCOVsVHvyLXEtioC5Rf1Jx+yUuZGnZUaCb+v2fRRdjXO9YbTI ndpARqg81zw3p7hvtn9z4kqt5KauIQ1pOfW9viswQngsLrRIvyQJ7i6EouA31g01pFSNOt4Z/01Qe JfFRwhSgneMEbg==; 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 1omMsB-0001RW-J0 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:43 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 08/22] gnu: python-pydyf: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:46 +0200 Message-Id: <20221022222100.18103-8-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/pdf.scm (python-pydyf)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove #:phases. Add #:test-flags. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/pdf.scm | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index b49e5264f9..ec75bca6e3 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -49,6 +49,7 @@ (define-module (gnu packages pdf) #:use-module (guix build-system gnu) #:use-module (guix build-system cmake) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system qt) #:use-module (guix build-system trivial) @@ -735,28 +736,14 @@ (define-public python-pydyf (uri (pypi-uri "pydyf" version)) (sha256 (base32 "18q43g5d9455msipcgd5fvnh8m4a2rz189slzfg80yycjw66rshs")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-c" "/dev/null"))))))) + #:test-flags #~'("-vv" "-c" "/dev/null"))) (propagated-inputs (list python-pillow)) (native-inputs (list ghostscript python-flit-core - python-pypa-build python-pytest)) (home-page "https://github.com/CourtBouillon/pydyf") (synopsis "Low-level PDF generator") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:04 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:04 +0000 Received: from localhost ([127.0.0.1]:42564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsW-0001yf-51 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49280) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsI-0001wb-OK for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21: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 1omMsD-00056j-Iy for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:45 -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=3+eQtppnn3nXQOdDQCihD9B0PsifcuOoUb/12XbGaTA=; b=bZbjnCAwjFSjGRfq39oR 2hlXMmP9cFyz6Qa2I08wikW0OTn74oeD7vFxE+Yl2q8i4MIb/6XiBmGd3S+macL5ELal7iTEFEzwp x7b7hvuiotUubqY9Hy+HTT9a+Si78bhIcQHYIMtNufXcr83YnwX+B63whjoTgIUTeXp7EHiIPz/GW Ce73zz3eDtQYONwFp/whDoz42IYmciiTVraeGzTvaOIRMngNFSRZVuyp/pdMX6YOvvkE149OWvMMg bkFtoFEDyp+wPzDdlak8iz6zeB8UpxYCq0vaXcMOkiwqMRLOdYFRfJS1QyW8cxF67Q5MuXBqpjEvb DTG9ws3xyW+Nzg==; 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 1omMsD-0001Rb-51 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:45 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 09/22] gnu: weasyprint: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:47 +0200 Message-Id: <20221022222100.18103-9-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/pdf.scm (weasyprint)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. Add #:test-flags. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/pdf.scm | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/gnu/packages/pdf.scm b/gnu/packages/pdf.scm index ec75bca6e3..8c871e4341 100644 --- a/gnu/packages/pdf.scm +++ b/gnu/packages/pdf.scm @@ -1497,9 +1497,11 @@ (define-public weasyprint (sha256 (base32 "0cn8gpgyic6pmrnhp0540nbgplpsd5aybi7k89anz6m1sshgjzgs")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list + #:test-flags #~(list "-vv" "-c" "/dev/null" + "-n" (number->string (parallel-job-count))) #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-library-paths @@ -1520,21 +1522,7 @@ (define-public weasyprint (("'pangoft2-1.0-0'") (format #f "~s" (search-input-file inputs - "lib/libpangoft2-1.0.so")))))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-c" "/dev/null" - "-n" (number->string (parallel-job-count)))))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + "lib/libpangoft2-1.0.so"))))))))) (inputs (list fontconfig glib harfbuzz pango)) (propagated-inputs (list gdk-pixbuf @@ -1552,7 +1540,6 @@ (define-public weasyprint (list font-dejavu ;tests depend on it ghostscript python-flit-core - python-pypa-build python-pytest python-pytest-xdist)) (home-page "https://weasyprint.org/") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:05 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:05 +0000 Received: from localhost ([127.0.0.1]:42567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsW-0001yv-Om for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49282) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsK-0001wi-82 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:52 -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 1omMsF-00056r-2v for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:47 -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=Q/AZitL3qkCOLqYFzL787h9HNn6LxS2iyRJOEc4RO9U=; b=kdIx4k+MAmAnkjeBGwhu gkWAPLOafDGhQ78jTwVDIdYpgMPWNjAj9euB6MyjIZr5GsJv+lyoxQDAsbr7uBUgk9b1ajfcNa4WU ccxwIVF4vfhN0n07aeT5zXVbMTap7SKenaWaeINWf+KnTaTOUSF0GJqSH6zBB/W8sjk7+ncTRklhl 0IwMY7g9Ol+EexGKoR+tZ1YkolxitzLX2J0V+FKDE4K/sguZGGULm1qkGZZdg/tiZHFjbb1LRyOdT eqJZanBipg++E4lNZEc8BJ3z+VITmVOlhs0zrXVbC/w+4YY6Xo4pBtHzmqdTzm5gGhF5YPKyI5pXL xPjw0O8Rhbr2QA==; 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 1omMsE-0001Rg-LT for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:46 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 10/22] gnu: python-glyphslib: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:48 +0200 Message-Id: <20221022222100.18103-10-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/fontutils.scm (python-glyphslib)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Add #:test-flags. Remove #:phases. [native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL. --- gnu/packages/fontutils.scm | 42 ++++++++++---------------------------- 1 file changed, 11 insertions(+), 31 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index 9b7f1ac879..eefde1d893 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -76,8 +76,9 @@ (define-module (gnu packages fontutils) #:use-module (guix build-system copy) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) - #:use-module (guix build-system python) #:use-module (guix build-system meson) + #:use-module (guix build-system pyproject) + #:use-module (guix build-system python) #:use-module (guix utils) #:use-module (srfi srfi-1)) @@ -591,39 +592,18 @@ (define-public python-glyphslib (sha256 (base32 "0mkkwd09g76hvif603ij5aqicxh47zvhgyyd0pjcjmpdy6dr70yw")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (replace 'build - (lambda _ - ;; The Zip format does not support pre-1980 time stamps. - (let ((circa-1980 (* 10 366 24 60 60))) - (setenv "SOURCE_DATE_EPOCH" (number->string circa-1980)) - (invoke "python" "-m" "build" "--wheel" "--no-isolation" ".")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (setenv "GUIX_PYTHONPATH" - (string-append (getcwd) ":" (getenv "GUIX_PYTHONPATH"))) - (invoke "pytest" "-vv" - ;; These fail because the test data has not yet been - ;; updated for newer FontTools: - ;; https://github.com/googlefonts/glyphsLib/issues/787 - ;; Re-enable for versions > 6.0.7. - "--ignore=tests/builder/designspace_gen_test.py" - "--ignore=tests/builder/interpolation_test.py" - ))))))) + #:test-flags #~'("-vv" + ;; These fail because the test data has not yet been + ;; updated for newer FontTools: + ;; https://github.com/googlefonts/glyphsLib/issues/787 + ;; Re-enable for versions > 6.0.7. + "--ignore=tests/builder/designspace_gen_test.py" + "--ignore=tests/builder/interpolation_test.py"))) (native-inputs - (list python-pypa-build - python-setuptools-scm - python-wheel + (list python-setuptools-scm ;; For tests. python-pytest -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:23 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:23 +0000 Received: from localhost ([127.0.0.1]:42587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsp-000212-EB for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:23 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zo-1n for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:12 -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 1omMsQ-0005N2-S6 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=kz/i97HvqaiTyvuymkZ2Fixm3hr/OdiR/vl4HJtFCUw=; b=Ksslb68n4kR/Y8fiPa1C Yve5ZTkTDvWsnOjkAlNT5s2dBAsmJprglHo1IwZ5DWypsRsJKu7c1PuziX5VouPKJc6zp8MzRKjvH hX7DBx6LLKwrWQGNvi2iT+3bNwhls9wnAysqZ1tFadB/2Bmoqnvb3DCuTBx320f8ifQtR4OVJ8SpY 5TNxZuiUz33RbKolcgNQUimSTeXSf31h/nVt17klr+BOJDkZRmicRK01uEfObR6A+d7fYAr+zj+l4 gQ3vS9xGa6rKCO190QTFEzDjvx/xynviebJC8p7CAiWJ79fA+ih3hheJaS/MEe5CMYK5gsAvA6SNE v+i95RHV2IF0fw==; 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 1omMsQ-0001TL-EO for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:58 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 14/22] gnu: python-tempora: Switch to pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:52 +0200 Message-Id: <20221022222100.18103-14-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-tempora)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Add #:test-flags. Remove #:phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/python-xyz.scm | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 42935cbaaa..f4113ca351 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -21199,30 +21199,13 @@ (define-public python-tempora (uri (pypi-uri "tempora" version)) (sha256 (base32 "09wirlk5vmxlhl9rnxp7g5qz2nsd6b0gnzk5fczbz0s8lsbz386b")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list - #:phases - #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Do not test the myproject.toml build as it tries to pull - ;; dependencies from the Internet. - (invoke "pytest" "-k" "not project"))))))) + ;; Do not test the myproject.toml build as it tries to pull + ;; dependencies from the Internet. + (list #:test-flags #~'("-vv" "-k" "not project"))) (native-inputs - (list python-pypa-build - python-freezegun + (list python-freezegun python-pytest python-pytest-black python-pytest-checkdocs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:24 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:24 +0000 Received: from localhost ([127.0.0.1]:42589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsp-000215-Pr for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zl-11 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:12 -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 1omMsS-0005N3-Fe 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=is+XVJWlcy+CkXHy/QKMEkdG4Lfzm53VoWzYi8rHSIo=; b=Z7ly49Sa5mOZ1Z/QL19M zWQJM4JGekH/3wnrOaR1XL6aFgKHzPVH1pX/meX5k4mMwAxpF+uIuKDqOPB184IMLwk5pfUAa1fof u/9bqPBvzz27ykIgQPHTG6UxhPoPtG3KtZTiOaokDw1xaftRMUgkN1ly6Rh4jEunQv6W01ddsCpKQ ArHUOabcOb8mq7Zn7ar9SccEGFhGQ52Qx8MCyl2QSLa9pgwjMdqZUZyXy/2d+XAMsqevw1O70AfKv lumtbxKZR1Y3xupXfkxf/f6UHw13AjChflsMBwA7hi+TWKSgnlNW/HqyNazmqBjml4oZnzhg/1Q3f ZxaozH98SEcVJw==; 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 1omMsS-0001TP-1O for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:00 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 15/22] gnu: python-pygmsh: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:53 +0200 Message-Id: <20221022222100.18103-15-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/simulation.scm (python-pygmsh)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/simulation.scm | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gnu/packages/simulation.scm b/gnu/packages/simulation.scm index 39b5620822..57a7882765 100644 --- a/gnu/packages/simulation.scm +++ b/gnu/packages/simulation.scm @@ -57,6 +57,7 @@ (define-module (gnu packages simulation) #:use-module (guix svn-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) @@ -828,7 +829,7 @@ (define-public python-pygmsh (sha256 (base32 "11flp2c4ynk1fhanf4mqyzrpd0gjbnv6afrwwc7xi3mb6ms69lr0")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases @@ -838,21 +839,8 @@ (define-public python-pygmsh ;; Due to lack of metadata, the gmsh Python package is not ;; detected although importable. (substitute* "pyproject.toml" - (("\"gmsh\",") "")))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-v" "tests")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) - (native-inputs (list python-pypa-build python-flit-core python-pytest)) + (("\"gmsh\",") ""))))))) + (native-inputs (list python-flit-core python-pytest)) (propagated-inputs (list gmsh python-meshio python-numpy)) (home-page "https://github.com/nschloe/pygmsh") (synopsis "Python frontend for Gmsh") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:24 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v3 12/22] gnu: python-ufolib2: Use pyproject-build-system. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:24 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:24 +0000 Received: from localhost ([127.0.0.1]:42593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsq-00021J-Dr for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zq-3A 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 1omMsP-0005N1-CU 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=HuZ8V925BtDB25+n1oiSnJCJH1JcbU0kfQfYzGR+guI=; b=OfkSwrXP827JUdLMDCio tb383eS7yRuJuGDe1AoHc4bM3ZWxRvPBqHS6z19WGRyaCkflaMAAEkdcoTAbNBiYXGnix7hR4wzVl J+8t0kRPSsBriNud6fqpPqNZ1qFeMT6I5CAf11+ONAcHqixeqIZBI+voacQiBfvWBAp6OghWLktOI 6NyAaMLHF91vonfF+BHMjlHPHm6PK6jgeHnhfbLsgjNyWi6yFFpSBSh2y7NhfsvwO48Cc94KRjYRY udcZJrtFM3GYhDdCWFTDG1AFxEWpMzZB4XlN45L2/jzGs/wJe9fysk/TjFpJeDFNPXuB9xd47QEiD mL2CQmeLFu7ajA==; 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 1omMsN-0001Rw-Sc for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:57 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 13/22] gnu: python-mypy-protobuf: Switch to pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:51 +0200 Message-Id: <20221022222100.18103-13-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/protobuf.scm (python-mypy-protobuf)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/protobuf.scm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm index a61d9d7492..e90e0ad3fa 100644 --- a/gnu/packages/protobuf.scm +++ b/gnu/packages/protobuf.scm @@ -31,6 +31,7 @@ (define-module (gnu packages protobuf) #:use-module (guix git-download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix build-system emacs) #:use-module (guix build-system ruby) @@ -285,22 +286,11 @@ (define-public python-mypy-protobuf (sha256 (base32 "0z03h9k68qvnlyhpk0ndwp01bdx77vrjr6mybxq4ldilkkbksklk")))) - (build-system python-build-system) + (build-system pyproject-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 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) (add-before 'check 'generate-protos-for-tests (lambda _ ;; Generate Python sources. @@ -324,7 +314,6 @@ (define-public python-mypy-protobuf (native-inputs (list python-grpc-stubs python-grpcio-tools - python-pypa-build python-pytest python-typing-extensions-next)) (propagated-inputs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:25 2022 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 To: 58587@debbugs.gnu.org Subject: [PATCH v3 16/22] gnu: zabbix-cli: Switch to pyproject-build-system. 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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * 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 -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:25 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:25 +0000 Received: from localhost ([127.0.0.1]:42597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsr-00021Y-3a for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40682) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMse-0001zr-3D 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 1omMsL-0005Mw-5p 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=ceZVkUQjSuYrrM7iupoIDNK7vaP2D8CZPUZV8SYltmA=; b=DbeOCj0ud678a5K5D0Ac aJRtiosuiGBBq72qOZO847q4n680q4RljLrdDlzTcGiIaxSAt26V3BjICQjFqEecx96Sdk+VnCy+G dJcSWB3juyJKeurOkJqIUa1TqlNa1XToB8Cs/6ONr27P349E5uhMqMA+koOAt5bYGnFPcaKWhmAqb rDc1MqFvW602UGvUhQPVKEihge/FC8eFGeKChtrm8V5KCqogOjqrpSPvwv7IxHRymGYJC4jqHMqi3 cJYPEkCAZamk4xx87fD3XR/5l8L/9uxEZyIJV3nT+UykN6s2L+HB2xG/fz00euM5EvH3zQwxu/KoV Q2u7azIh/KwFtg==; 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 1omMsG-0001Rl-7q for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:21:52 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 11/22] gnu: python-statmake: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:49 +0200 Message-Id: <20221022222100.18103-11-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/fontutils.scm (python-statmake)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/fontutils.scm | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm index eefde1d893..5c95f9a427 100644 --- a/gnu/packages/fontutils.scm +++ b/gnu/packages/fontutils.scm @@ -1561,12 +1561,11 @@ (define-public python-statmake (sha256 (base32 "0qavzspxhwnaayj5mxq6ncjjziggabxj157ls04h2rdrpq167706")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. (add-after 'unpack 'adjust-for-older-attrs ;; Our older attrs package is using the 'attr' rather than 'attrs' ;; namespace. @@ -1583,27 +1582,9 @@ (define-public python-statmake (("@attrs") "@attr") (("\\battrs\\.") - "attr.")))) - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "tests" - ;;"-n" (number->string (parallel-job-count)) - ;; This test requires orjson, which needs the maturin - ;; build system and new Rust dependencies. - ;;"--ignore" "tests/test_preconf.py" - ))))))) + "attr."))))))) (native-inputs (list python-poetry-core - python-pypa-build python-pytest python-ufo2ft)) (propagated-inputs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:50 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:50 +0000 Received: from localhost ([127.0.0.1]:42611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtF-00022j-J3 for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57902) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsw-00021e-EJ for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:30 -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 1omMsq-0005kt-Vg for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:25 -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=N+f17xuQ3s0gSLStY0xmF+2pS+hRppQgrOqxs0SPO4c=; b=j9iMVqJ/QOEaLzG0icft hZRgBOHf5lYrflBrQP49fqpOrDwmH8eorW2GjidLYJnqms/U9iSYkEtvILyJWFAwYlgijI7FJEoOI OZtaFsxl6hi2qbitUlc54eOLUdxiVh405f94Dplm5e1KchpaKY4aFOtPXmE/Mr9ai8hlKXUlDvvZ3 b+lfSbIRxtn8DP2haGK0AWzN9BBTecsbcD5vbXONl1f0x9PYIvLOwRauTc+yjChH8FmdCk77lW5BE VTdRnltRalBOglSg7CYCtcYlYU5AmpR0Q/OvCOD5V2eICYds+FbE/AVZBVXW9JBShdnC+4+Onzuu6 djaL0PbXVcP/ow==; 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 1omMsY-0001Tr-Nl for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:14 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 17/22] gnu: python-openapi-schema-validator: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:55 +0200 Message-Id: <20221022222100.18103-17-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-web.scm (python-openapi-schema-validator)[build-system]: Set to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove redundant phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/python-web.scm | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index f5625cc305..370245de3a 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -79,6 +79,7 @@ (define-module (gnu packages python-web) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system copy) + #:use-module (guix build-system pyproject) #:use-module (guix build-system python) #:use-module (guix gexp) #:use-module (guix utils) @@ -1601,7 +1602,7 @@ (define-public python-openapi-schema-validator (sha256 (base32 "1swm8h74nhg63nxk347blwq9f1qn6iiq3zisndcvm7axkq3pc2df")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases @@ -1609,21 +1610,8 @@ (define-public python-openapi-schema-validator (add-after 'unpack 'remove-coverage-pytest-options (lambda _ (substitute* "pyproject.toml" - (("^--cov.*") "")))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) - (native-inputs (list python-poetry-core python-pypa-build python-pytest)) + (("^--cov.*") ""))))))) + (native-inputs (list python-poetry-core python-pytest)) (propagated-inputs (list python-isodate python-jsonschema -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:50 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:50 +0000 Received: from localhost ([127.0.0.1]:42613 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtG-00022l-0P for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMsy-00021o-Au for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:32 -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 1omMss-0005vp-MR for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:27 -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=t890YTqTGXWI5CZ+gSgkW/OnCT6TiIFvfkvPiDSWrpw=; b=MpDTmkzvJU9bNCyQrNJy pUTqkUhxtR8BxM/dVmPeIs4TEgMQU5McXkXsvCGFzhJNYSMvhWsoJIc/TZ9Ril6dcpTjY5AoaERlH aSDv6/rDS0wAj/5auSja5PdBy7MJI9ikkcrX7q9nwkyrPPaTz/5sADyWpZ9f8Oede4H6lsw41a6Eb GABKVNoUyv48nKkefZ7fHeK//uTO9ujNIxcK9IyEVE4J7W3x/FUFpBN9R8aYJ6ILARgq4EGRc8T7I XYwmJYc8wZX/qoLnxBpkWSjyCG14JFNVyMSoi5z4GF2vOt9C0u+J+7o0FTVEmW0xUxwwPv8sE/XC1 ttH1WBuvQqyUqA==; 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 1omMss-0001Ut-8G for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:26 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 18/22] gnu: python-openapi-spec-validator: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:56 +0200 Message-Id: <20221022222100.18103-18-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-web.scm (python-openapi-spec-validator)[build-system]: Set to PYPROJECT-BUILD-SYSTEM. [arguments]: Add #:test-flags. Remove obsolete phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/python-web.scm | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/gnu/packages/python-web.scm b/gnu/packages/python-web.scm index 370245de3a..cbc515fc64 100644 --- a/gnu/packages/python-web.scm +++ b/gnu/packages/python-web.scm @@ -1643,33 +1643,19 @@ (define-public python-openapi-spec-validator (sha256 (base32 "1q09sjh4hsc0c8yqbd97h5mp6rwh427y6zyn8kv8wljk6sa0fs4q")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list + ;; The example tests attempt to fetch resources from the Internet + ;; (see: https://github.com/p1c2u/openapi-spec-validator/issues/151). + #:test-flags #~'("-vv" "-k" "not Example and not Exampe") #:phases #~(modify-phases %standard-phases (add-after 'unpack 'remove-coverage-pytest-options (lambda _ (substitute* "pyproject.toml" - (("^--cov.*") "")))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" - ;; The example tests attempt to fetch resources from - ;; the Internet (see: - ;; https://github.com/p1c2u/openapi-spec-validator/issues/151). - "-k" "not Example and not Exampe")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) - (native-inputs (list python-poetry-core python-pypa-build python-pytest)) + (("^--cov.*") ""))))))) + (native-inputs (list python-poetry-core python-pytest)) (propagated-inputs (list python-jsonschema python-openapi-schema-validator -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:50 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:50 +0000 Received: from localhost ([127.0.0.1]:42615 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtG-00022u-Dd for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:50 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMt0-00021r-C9 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:34 -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-0005xq-6v for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:29 -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=ugtHkPMJnvHz4KtofKeJaYV1q2f3vogpmpFCaTmbtLs=; b=q4MT7vIpsSx6AJEYb4B5 Kr0KpAA2gvIP6FplLONvlVmbp6VzlukHKuIFRxDYOqsaTSY4b2BLNeeEvFIpxjmXUZ3/cMC2fggzj Nn/Ize3xeEY1PhymElGYC0NvXlyLOYzuETz/L3N8+yWYGR8wmWHcG2jpKYYBLfl3a9Vr7kt4bvWHA hmGn0aNs7Yd4jF19qM005befsd3cu6E8Jr18KmH9QbWV/gdyrbwYgDexX2rJTJ0Zc3cm7bhVlfA09 +alUsdqx8bU+e5kjn5F1DUBAtub7VmWHkIjcTxKnG070iDrtu67WNzaxODUvYQ4giNn75LY/QjJRM o8X3CyfWu0Uc0A==; 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-0001Uz-P1 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:27 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 19/22] gnu: python-path: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:57 +0200 Message-Id: <20221022222100.18103-19-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-path-bootstrap)[build-system]: Switch to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove #:phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. (python-path): Remove #:phases. Add #:test-flags. --- gnu/packages/python-xyz.scm | 42 +++++++++++-------------------------- 1 file changed, 12 insertions(+), 30 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index f4113ca351..72a516e6fb 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -12548,25 +12548,10 @@ (define-public python-path-bootstrap (uri (pypi-uri "path" version)) (sha256 (base32 "0lig13gxnfv98v790db1smvsbd3mnj7y8rwyiwhfi6xiqibygwms")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list - #:tests? #f - #:phases - #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build/install procedures 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 'install - (lambda* (#:key outputs #:allow-other-keys) - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) - (native-inputs (list python-pypa-build python-setuptools-scm)) + (list #:tests? #f)) + (native-inputs (list python-setuptools-scm)) (home-page "https://github.com/jaraco/path") (synopsis "Object-oriented file system path manipulation library") (description "@code{path} (formerly @code{path.py}) implements path @@ -12582,18 +12567,15 @@ (define-public python-path (package-arguments python-path-bootstrap) ((#:tests? _ #f) (not (%current-target-system))) - ((#:phases phases #~%standard-phases) - #~(modify-phases #$phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Do not test the myproject.toml build as it tries to pull - ;; dependencies from the Internet. - (invoke "pytest" "-vv" "-k" - (string-append - "not project " - ;; This tests assumes a root user exists. - "and not test_get_owner"))))))))) + ((#:test-flags flags #~'()) + #~(append (list "-vv" "-k" + (string-append + ;; Do not test the myproject.toml build as it tries + ;; to pull dependencies from the Internet. + "not project " + ;; This tests assumes a root user exists. + "and not test_get_owner")) + #$flags)))) (native-inputs (modify-inputs (package-native-inputs python-path-bootstrap) (append python-appdirs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:51 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:51 +0000 Received: from localhost ([127.0.0.1]:42617 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtG-000231-Qc for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54066) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMt2-00021y-B7 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:36 -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 1omMsv-0005y1-TW for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:30 -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=UjL68gIV6gQLzYbnz0lGlj0zIVraZa4yOndzx28/gkQ=; b=HffuxuLrqw79k0UscnOW gFtygy21F4Tyv0//jVYDvLdxF4VI4vmE7nbb+WqxbDxck8pw0HxvkJLBIjQBHna8oqzldiQAubtUY 9zV0pfBZx1Y119/lHu7sOkTv0BynRizN73YwtWwajwiky4E8vEhuqX+un1w/9Qah1ywpdsgCF+Zid q1N0gp1nbwdGsFubpKVtm6AMckepMBoPKmUz0b17JhI55COCau6A/MWTJ6t53vMe5cwYrMVjOpVRI UKhTxqa+08NQrd5Om9vW7/tfAkF2joUb0QyNXreSvVmQlyEP0JybqhqzNF0tnBZeIXL7HVGyRN/31 RwuLkMmcxUG2lw==; 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 1omMsv-0001V4-EV for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:29 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 20/22] gnu: python-cattrs: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:58 +0200 Message-Id: <20221022222100.18103-20-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-cattrs)[build-system]: Set to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove obsolete phases. [native-inputs]: Remove PYTHON-PYPA-BUILD. --- gnu/packages/python-xyz.scm | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 72a516e6fb..a8b94b0acb 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -17028,12 +17028,11 @@ (define-public python-cattrs (sha256 (base32 "1n0h25gj6zd02kqyl040xpdvg4hpy1j92716sz0rg019xjqqijqb")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases - ;; XXX: PEP 517 manual build copied from python-isort. (add-after 'unpack 'adjust-for-older-attrs ;; Our older attrs package is using the 'attr' rather than 'attrs' ;; namespace. @@ -17042,14 +17041,6 @@ (define-public python-cattrs (substitute* (find-files "." "\\.py$") (("from attrs\\b") "from attr")))) - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl)))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -17067,7 +17058,6 @@ (define-public python-cattrs python-msgpack python-poetry-core python-pymongo ;for the bson module - python-pypa-build python-pytest python-pytest-xdist)) (propagated-inputs -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:51 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:51 +0000 Received: from localhost ([127.0.0.1]:42619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtH-000238-5x for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMt4-000226-8K for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:38 -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 1omMsx-0005yB-Hb for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:32 -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=kNQL5z8dECvUJ5FQlPznZtDUBezkD1whnMwh8TzuNVc=; b=YTHoWU1jvIpnv/mhfbmV PN9eSuwDjtuJI0PfyXHNAAL1Xn7Tr4+kuMVxENxYBZ7YZuO04h3qhIF9PlpqPESkF00saLdlkSIxT toDQ3UGSRzCVsKg4maYpYLQEjtqTd3S3eLrDXpAonz8kItrqWIyW0af7rt9yf8TfJSmLLBNHxy3mU ANetwge7RKaoA3t7Yp++Phu7I61hTP+B/6M7A/uIkGKcwhAIDTzydffBBLSbqRMxNRlmVAy+s0GnU e5C2jLsV0tI7VQ4RR/peE+ToM1jHDS5UXUweCpAQ3kQCMlZ5H9MqgK7a6aEcZWuoBa2m/3qxMyoY9 Jk1cXgrHrwlAlQ==; 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 1omMsx-0001V9-3F for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:31 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 21/22] gnu: python-scikit-build: Switch to pyproject-build-system. Date: Sun, 23 Oct 2022 00:20:59 +0200 Message-Id: <20221022222100.18103-21-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-scikit-build)[build-system]: Set to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove obsolete phases. [native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL. --- gnu/packages/python-xyz.scm | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index a8b94b0acb..bae4c385c0 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -27859,7 +27859,7 @@ (define-public python-scikit-build (uri (pypi-uri "scikit-build" version)) (sha256 (base32 "1wx1m9vnxnnz59lyaisgyxldp313kciyd4af8lf112vb8vbjy9yk")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases @@ -27870,11 +27870,6 @@ (define-public python-scikit-build (("^(CMAKE_DEFAULT_EXECUTABLE = ).*" _ head) (format #f "~a ~s~%" head (search-input-file inputs "bin/cmake")))))) - ;; XXX: PEP 517 manual build copied from python-isort. - (replace 'build - (lambda _ - (setenv "SOURCE_DATE_EPOCH" "315532800") - (invoke "python" "-m" "build" "--wheel" "--no-isolation" "."))) (replace 'check (lambda* (#:key tests? #:allow-other-keys) (when tests? @@ -27900,12 +27895,7 @@ (define-public python-scikit-build ;; nondeterministically (see: ;; https://github.com/scikit-build/scikit-build/issues/711). "and not test_generator_cleanup " - "and not test_generator_selection "))))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + "and not test_generator_selection ")))))))) (native-inputs (list cmake-minimal gfortran @@ -27916,15 +27906,13 @@ (define-public python-scikit-build python-mock python-packaging python-path - python-pypa-build python-pytest python-pytest-cov python-pytest-mock python-pytest-virtualenv python-pytest-xdist python-requests - python-setuptools-scm - python-wheel)) + python-setuptools-scm)) (propagated-inputs (list python-distro python-packaging python-wheel)) (home-page "https://github.com/scikit-build/scikit-build") -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 22 18:22:51 2022 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 22:22:52 +0000 Received: from localhost ([127.0.0.1]:42621 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMtH-00023G-IF for submit@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:51 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omMt6-00022E-5B for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:40 -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 1omMsz-0005yC-5z for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:33 -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=uiBkeueu3Qh/G7xorWIYa4lSOEtMYQyNbytVOdcNxOM=; b=bCiCm5mTqWKVYnvhO9EA LgNN1FURPoRrp4QLhEf1wNmagdyh1p0GJX80rxqbet5d/sP46G+BkQYPVKFPXyiNPJhEZPaSGuRGi LYhdQOH4nmqmWVKQeTFReEYFwKT6ZnNVrG6Uguw62EeE7os9k5AtvbXQPklEfW1nu6mdfP8l4m7uO EFCyf2RCDqZ3OPzOJTOG7vpgwg1vasjRwqZ6iIX9ek8U6q5DgRY5ImdyTi0CM3Y2nhhrMeGMCJ9H5 jqIZeFkkH8PJ30hT2Fwtj3HQ+lbDoxCEE8sddQcKVcMHKUVbiha3UpT+Igy+nTxNsct2CHL2ILmNH 2ErGNlPlSYOcKw==; 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 1omMsy-0001VE-K7 for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 18:22:32 -0400 From: Marius Bakke To: 58587@debbugs.gnu.org Subject: [PATCH v3 22/22] gnu: python-deepmerge: Use pyproject-build-system. Date: Sun, 23 Oct 2022 00:21:00 +0200 Message-Id: <20221022222100.18103-22-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 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) * gnu/packages/python-xyz.scm (python-deepmerge)[build-system]: Set to PYPROJECT-BUILD-SYSTEM. [arguments]: Remove obsolete phases. [native-inputs]: Remove PYTHON-PYPA-BUILD and PYTHON-WHEEL. --- gnu/packages/python-xyz.scm | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index bae4c385c0..cddd525b0c 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -30259,34 +30259,17 @@ (define-public python-deepmerge (uri (pypi-uri "deepmerge" version)) (sha256 (base32 "06hagzg8ccmjzqvszdxb52jgx5il8a1jdz41n4dpkyyjsfg7fi2b")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list #:phases #~(modify-phases %standard-phases (add-before 'build 'set-version (lambda _ - (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version) - ;; ZIP does not support timestamps before 1980. - (setenv "SOURCE_DATE_EPOCH" "315532800"))) - (replace 'build - (lambda _ - (invoke "python" "-m" "build" "--wheel" - "--no-isolation" "."))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest")))) - (replace 'install - (lambda _ - (let ((whl (car (find-files "dist" "\\.whl$")))) - (invoke "pip" "--no-cache-dir" "--no-input" - "install" "--no-deps" "--prefix" #$output whl))))))) + (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))))) (native-inputs - (list python-pypa-build - python-setuptools-scm - python-pytest - python-wheel)) + (list python-setuptools-scm + python-pytest)) (home-page "https://deepmerge.readthedocs.io/en/latest/") (synopsis "Merge nested data structures") (description -- 2.38.0 From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 12:37:05 2022 Received: (at 58587) by debbugs.gnu.org; 24 Oct 2022 16:37:05 +0000 Received: from localhost ([127.0.0.1]:49350 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on0Rl-0003KF-7Z for submit@debbugs.gnu.org; Mon, 24 Oct 2022 12:37:05 -0400 Received: from relay.yourmailgateway.de ([188.68.63.102]:45177) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on0Rh-0003Jn-VJ for 58587@debbugs.gnu.org; Mon, 24 Oct 2022 12:37:04 -0400 Received: from mors-relay-2502.netcup.net (localhost [127.0.0.1]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4Mx11m4NV2z5w34; Mon, 24 Oct 2022 18:37:00 +0200 (CEST) Authentication-Results: mors-relay-2502.netcup.net; dkim=permerror (bad message/signature format) Received: from policy02-mors.netcup.net (unknown [46.38.225.35]) by mors-relay-2502.netcup.net (Postfix) with ESMTPS id 4Mx11m3f3Sz4xFw; Mon, 24 Oct 2022 18:37:00 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at policy02-mors.netcup.net X-Spam-Flag: NO X-Spam-Score: -2.899 X-Spam-Level: X-Spam-Status: No, score=-2.899 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no Received: from mxe217.netcup.net (unknown [10.243.12.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by policy02-mors.netcup.net (Postfix) with ESMTPS id 4Mx11l3zstz8sbC; Mon, 24 Oct 2022 18:36:59 +0200 (CEST) Received: from florianrock64 (ip5b402b13.dynamic.kabel-deutschland.de [91.64.43.19]) by mxe217.netcup.net (Postfix) with ESMTPSA id BAEC29E7B0; Mon, 24 Oct 2022 18:36:57 +0200 (CEST) From: "pelzflorian (Florian Pelz)" To: Marius Bakke Subject: Re: [bug#58587] [PATCH v3 05/22] news: Add entry for 'pyproject-build-system'. References: <87eduzu18u.fsf@gnu.org> <20221022222100.18103-1-marius@gnu.org> <20221022222100.18103-5-marius@gnu.org> Date: Mon, 24 Oct 2022 18:36:56 +0200 In-Reply-To: <20221022222100.18103-5-marius@gnu.org> (Marius Bakke's message of "Sun, 23 Oct 2022 00:20:43 +0200") Message-ID: <87czahb2l3.fsf@pelzflorian.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: BAEC29E7B0 X-Rspamd-Server: rspamd-worker-8404 X-NC-CID: GLuKvUjimuULE/sATPoBB4W3BR1PiQOSAbE43T/we88Ct+0/9lnXBtwr X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Thank you for improving build systems. Could you add a German translation of the news: Marius Bakke writes: > + (entry (commit "3f82a8b2d075f5980ffa8cdd9c49a5a8586e5b1b") > + (title > + (en "New build system for Python packages")) (de "Neues Erstellungssystem f=C3=BCr Python-Pakete")) > + (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 vario= us > +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."))) ``legacy'' @file{setup.py} format.") (de "Ein neues Erstellungssystem @var{pyproject-build-system} ist verf=C3=BCgbar. Es ist eine Neuauflage des @var{python-build-system}, die @dfn{PEP 517} und @file{pyproject.toml}-Dateien unterst=C3=BCtzt. Auch wur= de Unterst=C3=BCtzung f=C3=BCr Testrahmen wie @command{pytest} und @code{noset= ests} eingebaut. Erg=C3=A4nzend gibt es ein Paket @code{python-toolchain} mit aktualisierten= Versionen von @command{pip}, @command{setuptools} und mehr. Das Erstellungssystem wird in Zukunft Teil von @var{python-build-system} we= rden, aber wir w=C3=BCrden es begr=C3=BC=C3=9Fen, wenn Sie es f=C3=BCr Pakete auf= dem @code{guix}-Kanal verwenden w=C3=BCrden. Drittanbieterkan=C3=A4le warten vielleicht lieber a= uf eine stabile Programmierschnittstelle (siehe die im Guix-Handbuch genannten Einschr=C3=A4nkungen). Trotz dem Namen funktioniert @var{pyproject-build-system} auch mit dem =E2= =80=9Ealten=E2=80=9C @file{setup.py}-Format."))) =3D=3D Regards, Florian From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 24 14:01:17 2022 Received: (at 58587) by debbugs.gnu.org; 24 Oct 2022 18:01:17 +0000 Received: from localhost ([127.0.0.1]:49465 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on1lE-0005jy-QP for submit@debbugs.gnu.org; Mon, 24 Oct 2022 14:01:17 -0400 Received: from lepiller.eu ([89.234.186.109]:48930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1on1lB-0005jh-Pz for 58587@debbugs.gnu.org; Mon, 24 Oct 2022 14:01:16 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id c9c6e8bd; Mon, 24 Oct 2022 18:01:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:in-reply-to:references:message-id:mime-version :content-type:content-transfer-encoding; s=dkim; bh=j25QLuNKEEF9 ImD+5624x4XC9ol6NSjVR4kUlPPauVQ=; b=gMcKvVQoxHkkZY7dF8PpIItBNz+1 RB3uGtv/P5jmRhWbFFQME0/OrScf0eeH9aE47RQT2pxXEEJ6iO6b0QVM0TOtZLyv MTyAo9M3JigiZ8HLjYns+n75/4mJc+ScpHuofhE/e7Ih1DGaFp5PjuxYzM9HOUfY +HsbiebP3txk7ncAwcORVlxXHfR6pjtwqdf5/do6K00eWdcvm63uhIWwJpaGs9xh svGTgvuaTZigoDUR4BkFmPqPZxziONhLFetbQZO/y877tmOeBaHtwqsBvd/IKevP GzL7QCNQfBxxyhoowuMdn+/sqt6t1Tr+g5YAjB7Q0+Hc4SQdHYS6SXT0Cg== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 1a3350cb (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 24 Oct 2022 18:01:10 +0000 (UTC) Date: Mon, 24 Oct 2022 20:01:01 +0200 From: Julien Lepiller To: guix-patches@gnu.org, "pelzflorian (Florian Pelz)" , Marius Bakke Subject: =?US-ASCII?Q?Re=3A_=5Bbug=2358587=5D_=5BPATCH_v3_05/22=5D_news=3A_?= =?US-ASCII?Q?Add_entry_for_=27pyproject-build-system=27=2E?= User-Agent: K-9 Mail for Android In-Reply-To: <87czahb2l3.fsf@pelzflorian.de> References: <87eduzu18u.fsf@gnu.org> <20221022222100.18103-1-marius@gnu.org> <20221022222100.18103-5-marius@gnu.org> <87czahb2l3.fsf@pelzflorian.de> Message-ID: <154EDF23-A8A4-4FFB-98DA-814B806EA66D@lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=----7D4GUGGNKMN1UGDOT0OUVA66PLXTMP Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) ------7D4GUGGNKMN1UGDOT0OUVA66PLXTMP Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable And here's the French version: (fr "Nouveau syst=C3=A8me de construction pour les paquets Python") (fr "Un nouveau syst=C3=A8me de construction, @var{pyproject-build-system}= , a =C3=A9t=C3=A9 ajout=C3=A9=2E Il s'agit d'une refonte du @var{python-bu= ild-system} qui rajoute la prise en charge de @dfn{PEP 517} et des fichiers= @file{pyproject=2Etoml}=2E Il int=C3=A8gre aussi la prise en charge de div= ers cadriciels de test comme @command{pytest} ou @code{nosetests}=2E Un paquet suppl=C3=A9mentaire @code{python-toolchain} fournit des versions= =C3=A0 jour de @command{pip}, @command{setuptools} et autres=2E Le syst=C3=A8me de construction finira par =C3=AAtre int=C3=A9gr=C3=A9 au = @var{python-build-system} mais nous vous encourageons =C3=A0 l'utiliser pou= r les paquets du canal @code{guix}=2E Les canaux tiers devraient attendre q= ue l'API se stabilise (voir le manuel de Guix pour les mises en garde)=2E Contrairement =C3=A0 ce qu'indique son nom, @var{pyproject-build-system} f= onctionne aussi avec =C2=AB l'ancien =C2=BB format @file{setup=2Epy}=2E") Le 24 octobre 2022 18:36:56 GMT+02:00, "pelzflorian (Florian Pelz)" a =C3=A9crit=C2=A0: >Thank you for improving build systems=2E Could you add a German >translation of the news: > >Marius Bakke writes: >> + (entry (commit "3f82a8b2d075f5980ffa8cdd9c49a5a8586e5b1b") >> + (title >> + (en "New build system for Python packages")) > >(de "Neues Erstellungssystem f=C3=BCr Python-Pakete")) > >> + (body >> + (en "A new @var{pyproject-build-system} has been added=2E Th= is >> +is a redesign of @var{python-build-system} with support for @dfn{PEP 5= 17} >> +and @file{pyproject=2Etoml} files=2E It also has built-in support for= various >> +test frameworks such as @command{pytest} and @code{nosetests}=2E >> + >> +There is a complementary @code{python-toolchain} package that comes wi= th >> +updated versions of @command{pip}, @command{setuptools} and others=2E >> + >> +The build system will eventually be merged into @var{python-build-syst= em} >> +but you are encouraged to use it for packages in the @code{guix} chann= el=2E >> +Third party channels may want to wait until the API is stable (see the >> +Guix manual for caveats)=2E >> + >> +Despite the name, @var{pyproject-build-system} also works with the >> +``legacy'' @file{setup=2Epy} format=2E"))) >``legacy'' @file{setup=2Epy} format=2E") > (de "Ein neues Erstellungssystem @var{pyproject-build-system} is= t >verf=C3=BCgbar=2E Es ist eine Neuauflage des @var{python-build-system}, = die >@dfn{PEP 517} und @file{pyproject=2Etoml}-Dateien unterst=C3=BCtzt=2E Au= ch wurde >Unterst=C3=BCtzung f=C3=BCr Testrahmen wie @command{pytest} und @code{nos= etests} >eingebaut=2E > >Erg=C3=A4nzend gibt es ein Paket @code{python-toolchain} mit aktualisiert= en Versionen >von @command{pip}, @command{setuptools} und mehr=2E > >Das Erstellungssystem wird in Zukunft Teil von @var{python-build-system} = werden, >aber wir w=C3=BCrden es begr=C3=BC=C3=9Fen, wenn Sie es f=C3=BCr Pakete a= uf dem @code{guix}-Kanal >verwenden w=C3=BCrden=2E Drittanbieterkan=C3=A4le warten vielleicht lieb= er auf eine >stabile Programmierschnittstelle (siehe die im Guix-Handbuch genannten >Einschr=C3=A4nkungen)=2E > >Trotz dem Namen funktioniert @var{pyproject-build-system} auch mit dem = =E2=80=9Ealten=E2=80=9C >@file{setup=2Epy}-Format=2E"))) > >=3D=3D > >Regards, >Florian > > > ------7D4GUGGNKMN1UGDOT0OUVA66PLXTMP Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable And here's the French version:

(fr "Nouveau= syst=C3=A8me de construction pour les paquets Python")

(fr "Un nouv= eau syst=C3=A8me de construction, @var{pyproject-build-system}, a =C3=A9t= =C3=A9 ajout=C3=A9=2E Il s'agit d'une refonte du @var{python-build-system}= qui rajoute la prise en charge de @dfn{PEP 517} et des fichiers @file{pypr= oject=2Etoml}=2E Il int=C3=A8gre aussi la prise en charge de divers cadrici= els de test comme @command{pytest} ou @code{nosetests}=2E

Un paquet = suppl=C3=A9mentaire @code{python-toolchain} fournit des versions =C3=A0 jou= r de @command{pip}, @command{setuptools} et autres=2E

Le syst=C3=A8m= e de construction finira par =C3=AAtre int=C3=A9gr=C3=A9 au @var{python-bui= ld-system} mais nous vous encourageons =C3=A0 l'utiliser pour les paquets d= u canal @code{guix}=2E Les canaux tiers devraient attendre que l'API se sta= bilise (voir le manuel de Guix pour les mises en garde)=2E

Contraire= ment =C3=A0 ce qu'indique son nom, @var{pyproject-build-system} fonctionne = aussi avec =C2=AB l'ancien =C2=BB format @file{setup=2Epy}=2E")


=
Le 24 octobre 2022 18:36:56 GMT+02:00, "pelzflor= ian (Florian Pelz)" <pelzflorian@pelzflorian=2Ede> a =C3=A9crit=C2=A0= :
Thank you for improving build systems=
=2E  Could you add a German
translation of the news:

Marius Bakke= <marius@gnu=2Eorg> writes:
+ (entry (commit "3f82a8b2d075f5980ffa8cdd9c49a5a8586e5b1b")
= + (title
+ (en "New build system for Python packages"))

(de "Neues Erstellungssystem f=C3=BCr Python-Pakete"))
+ (body
+ = (en "A new @var{pyproject-build-system} has been added=2E This
= +is a redesign of @var{python-build-system} with support for @dfn{PEP 517}<= br>+and @file{pyproject=2Etoml} files=2E It also has built-in support for = various
+test frameworks such as @command{pytest} and @code{nosetests}= =2E
+
+There is a complementary @code{python-toolchain} package that = comes with
+updated versions of @command{pip}, @command{setuptools} and = others=2E
+
+The build system will eventually be merged into @var{pyt= hon-build-system}
+but you are encouraged to use it for packages in the = @code{guix} channel=2E
+Third party channels may want to wait until the = API is stable (see the
+Guix manual for caveats)=2E
+
+Despite the= name, @var{pyproject-build-system} also works with the
+``legacy'' @fil= e{setup=2Epy} format=2E")))
``legacy'' @file{setup=2Epy} fo= rmat=2E")
(de "Ein neues Erstellungssystem @var{pyproject-build= -system} ist
verf=C3=BCgbar=2E Es ist eine Neuauflage des @var{python-b= uild-system}, die
@dfn{PEP 517} und @file{pyproject=2Etoml}-Dateien unte= rst=C3=BCtzt=2E Auch wurde
Unterst=C3=BCtzung f=C3=BCr Testrahmen wie @= command{pytest} und @code{nosetests}
eingebaut=2E

Erg=C3=A4nzend = gibt es ein Paket @code{python-toolchain} mit aktualisierten Versionen
v= on @command{pip}, @command{setuptools} und mehr=2E

Das Erstellungssy= stem wird in Zukunft Teil von @var{python-build-system} werden,
aber wir= w=C3=BCrden es begr=C3=BC=C3=9Fen, wenn Sie es f=C3=BCr Pakete auf dem @co= de{guix}-Kanal
verwenden w=C3=BCrden=2E Drittanbieterkan=C3=A4le warten= vielleicht lieber auf eine
stabile Programmierschnittstelle (siehe die = im Guix-Handbuch genannten
Einschr=C3=A4nkungen)=2E

Trotz dem Nam= en funktioniert @var{pyproject-build-system} auch mit dem =E2=80=9Ealten=E2= =80=9C
@file{setup=2Epy}-Format=2E")))

=3D=3D

Regards,
= Florian



------7D4GUGGNKMN1UGDOT0OUVA66PLXTMP-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 09:10:35 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 13:10:35 +0000 Received: from localhost ([127.0.0.1]:56399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2eZ-0002Ab-5j for submit@debbugs.gnu.org; Thu, 27 Oct 2022 09:10:35 -0400 Received: from mail-qt1-f175.google.com ([209.85.160.175]:42766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2eY-0002AP-3k for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 09:10:34 -0400 Received: by mail-qt1-f175.google.com with SMTP id w29so1019085qtv.9 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 06:10:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=fMpmVE89M8o+KFlZqBJfLvvg5Y0U0gYGkTGc1QzGrzQ=; b=bSvw7wzXIApjCZXx5H1lckw6RjQ8kgYoqnK+rASbntBUwCsE+NfPKWDxaLr90onqv3 OydczjHpAkLLuQQNVmmcqm+Fd6L7ee6e8XdKn2+kAQ8B4jsrSBJ8iqi0oBAQDccT3Yu4 12OqcfGKMvypX1DMnqITgh0fas5fcDV3zYFwmMFWys6mpO3eHOCSvpNM1AEnCaEzjqfe XRAa11SWeX9ByMQjjvoQrQFard+5kM85Bsbx61oSrl0h/Fcxu4/UGzBIcT4MOmHzKrak wqSaOZC3OhaoqW1j8xDxUCeuCMKG6PDQlHD0+RLksYto6Hokbj9vgK3dDSZWgpqKhz7m Zn0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fMpmVE89M8o+KFlZqBJfLvvg5Y0U0gYGkTGc1QzGrzQ=; b=ji8B+yonsa1a3SYBhHlAONqUFz/vOPxytCzyS2YFiCKXuF90xyyfVFyufkR/shB5Q4 XlpdbK2Qot7nzFKNVqRxMjkG+pLkQg96KlBXehi9Bo8pVKlMegPV9V0+2cn0dIBOuhHb CpxKVvRSL67fgJ9VrL0bo0D3g2Hza1FUdzyL5+jMvnHgQKqOG6xjQYiieTHHB7gClEHx VR6z9v4frqCynZHRwu9O4AwAwT9FPW5vWDbfYM79H8CxW1kjJDhZMvs710YdIU7uYCe1 KNNYRGt8ahUI3GnEu3+pbypyC3cIDB+zkspFApNUBDz9525PktAQp22TITxdu5uCQVsj 4yyQ== X-Gm-Message-State: ACrzQf3uoxP4T7Cq8Fusuwd2V+v08/7Y+TZPwecUog8gRN622DrQzpBX EuDPj1Zt4NE7X5seUha6+bU= X-Google-Smtp-Source: AMsMyM7a+W/QSAw+KJAdb4DRSFdKEGCBUwMl6FMOuanQnI+148HXQXRGnnAiSG8dE3s7nB+dJnjvkg== X-Received: by 2002:ac8:5b56:0:b0:39c:db95:ac4 with SMTP id n22-20020ac85b56000000b0039cdb950ac4mr40700283qtw.299.1666876228411; Thu, 27 Oct 2022 06:10:28 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id m3-20020a05620a24c300b006b953a7929csm940606qkn.73.2022.10.27.06.10.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 06:10:27 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <86sfjlzdbn.fsf@gmail.com> <877d0wvlzg.fsf@gnu.org> <86ilkgp2hx.fsf@gmail.com> <871qr3v26i.fsf@gnu.org> <87v8oekjcs.fsf@gmail.com> <87eduzu18u.fsf@gnu.org> Date: Thu, 27 Oct 2022 09:10:26 -0400 In-Reply-To: <87eduzu18u.fsf@gnu.org> (Marius Bakke's message of "Sat, 22 Oct 2022 21:06:25 +0200") Message-ID: <8735b9qunx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun , zimoun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Marius, I've yet to delve into the actual patches (I intend to do so shortly), but here's a quick reply to your last message. [...] > I've now added a section in the manual about API changes and stability, > and removed more duplicate code from pyproject-build-system. I also > added a news entry. > > I think this is now ready for merge, but have some concerns: > > * The python-toolchain package is a union that includes setuptools, > wheel and others. Packages that pick up a reference to the build-time > Python will needlessly include those other packages. It could be > worked around by propagating instead of using a union. That could be better, yes. They may still be picked up in wrap phases, but that's a Guix-wide problem (can't tell between native vs regular inputs on the build side when native compiling). > * Overriding #:test-flags means having to add back the implicit defaults > for verbose output. We could add them even when #:test-flags is > present so users don't need to add "-vv" manually. This is handled for Emacs packages by having a %default-test-flags or similar that users can cons to... but it's still very too easy to forget. Perhaps we should gradually move to most arguments "extending" the defaults rather than completely overriding them; such an idea was discussed for example for the #:modules and #:imported-modules arguments recently. > > I will merge this in a few days if there are no further comments. It > can still be tweaked directly on 'master' if necessary. > > Updated patches follow shortly. I'll try to have a quick look now, as I see this hasn't landed yet. Thank you for picking up this series! -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 09:26:02 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 13:26:02 +0000 Received: from localhost ([127.0.0.1]:56471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2tV-0002br-Ka for submit@debbugs.gnu.org; Thu, 27 Oct 2022 09:26:02 -0400 Received: from mail-qv1-f53.google.com ([209.85.219.53]:35582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2tT-0002bY-N4 for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 09:26:00 -0400 Received: by mail-qv1-f53.google.com with SMTP id i12so1245098qvs.2 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 06:25:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=lXZUGEB4vddghl/XwdYOJ8G6NWYf16wJz+Nlm7grWkc=; b=ko+RZyulrurlFnhqaR5L+tukE0bB5tf61C4Vsi2YA5m0aKfjdX1AswDG9RQiSRd31S FK4apcwGAqoqoN099kIudoDBQUExIcq8YTK4xtutjAldlmFwBVAnP61N2as+aGNHkTUK uwdsjDpYmV37uFJJaajWmAqV9HEAmddnTKcJ6IR7OjSf9+W36C7esNvW340A0zDGTdw8 u8MmaNXs8/kxpKIjViMLsMQ1RBHTSKr+OKuTNK8cUyaBRFWpl2lu5lB0WJ4/UgrEbMd9 7DnqZekRths3AJA2ZMWUV5SvLiTe9oqjadDqhjy/UjxAbp2YWeKDYTGTwrvqU0j3vtf3 ZCEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lXZUGEB4vddghl/XwdYOJ8G6NWYf16wJz+Nlm7grWkc=; b=bJhrn2oFjNI70VLSm5Vvywb+6Oo0fPqpHZueD7NO467RQJIgHhYkXIu/GylAG66pKW wrKX+oKJm3kho0Sj7dIf9MOn8OZswmQgnSYF8Y8kzqmI/nqzV737+nH6kDYuSSDfrf4h w0yyTo6/EQBpSOv7r2v6l/NOST2UaRkwdWmrX35ha3/p3/ePhaBGFwZw2ZfwNpshU56s xS6VvVwO8n1ZTMgid1TKr76gc/tsC+AgAf7EOGrKUXxKhiJE2zX3k+MB4NXQK2bIEWf/ w0iiA7h0/onKOh56BsDYQu86fw2dIDsqYzOVemEl4/XuLn+wTIi61P+HpdeQwTExg1m/ oo3A== X-Gm-Message-State: ACrzQf3exdw9qUQSTfc27ph8jf+JhT4txMomRuDj6eURVnuHTWNBNEn0 Cb+LvdX3wkZshtF9ZLBdPlA= X-Google-Smtp-Source: AMsMyM45TPTA6LooCloUUjYdV1ACkzgKoJ/+jlbA5ljVPVQl+lMdwVM0UDfUyfN3qCjzm3xNxxPI7w== X-Received: by 2002:a05:6214:d6b:b0:4b9:8b40:1126 with SMTP id 11-20020a0562140d6b00b004b98b401126mr30361922qvs.101.1666877154154; Thu, 27 Oct 2022 06:25:54 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id r12-20020ae9d60c000000b006f9f3c0c63csm816423qkk.32.2022.10.27.06.25.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 06:25:53 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 01/14] gnu: python-setuptools: Move to python-build. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> Date: Thu, 27 Oct 2022 09:25:52 -0400 In-Reply-To: <20221017201201.4808-1-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:11:48 +0200") Message-ID: <87czadl7of.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Marius Bakke writes: > From: Lars-Dominik Braun > > * gnu/packages/python-xyz.scm (python-setuptools): Move=E2=80=A6 > * gnu/packages/python-build.scm: =E2=80=A6here. > * gnu/packages/chemistry.scm, > gnu/packages/messaging.scm, > gnu/packages/sequoia.scm, > tests/lint.scm: Adjust module imports accordingly. > > Co-authored-by: Marius Bakke [...] > +(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-extract= ing > + ;; installers for Windows. > + ;; TODO: Find some way to build them ourself so we can include t= hem. I don't think we need a TODO to fix installers for Windows. > + '(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 designe= d 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? A better place for this TODO would be next to the snippet in the origin, perhaps? -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 09:28:49 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 13:28:49 +0000 Received: from localhost ([127.0.0.1]:56486 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2wB-0002fu-TU for submit@debbugs.gnu.org; Thu, 27 Oct 2022 09:28:49 -0400 Received: from mail-qv1-f45.google.com ([209.85.219.45]:43844) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2w8-0002fd-NG for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 09:28:45 -0400 Received: by mail-qv1-f45.google.com with SMTP id c8so1226037qvn.10 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 06:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=4ycem6qJ12CyIjhiun094zPMWcpeU8bndr98zqXLWwc=; b=RiMuaUNQ+mHbNl1fCTRSVvIc5nqHpnbZ/qr3E+Hb+l6D3DapT3NC4MPsViQ5rtjFi0 IGaq4GAiNmj1ygv7locA2cmrOMYLuGBUM1N1htJ8CWReJ7z0fxPyyfSnI2A4YxKFEDl2 uOZbtbQVJPAqz1dcobKT2IBvJybL7E2uuI8YkLIeD9oqGqzTsb82Ri2/UpuIWW9cj+Jw AQNljsm7So1X91/mr5Mxt1phw0j7WA5/md7Y9UlLPcDRL4BblxnduZw8sJrGDgMrXRer mBPEBGQFbytY9pv12pEtOQ/RuK5+EArx3FNDMdXImo8sKK8Fzfz2RRPbvi4/WFVXYlPi iwFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=4ycem6qJ12CyIjhiun094zPMWcpeU8bndr98zqXLWwc=; b=WYvNzc4xPM8LNxJKyIUcDdgaTenvFklyd9P1K8DB8vLOM+zOVySZEizyDgKdEGhOED voUs24XwkdoyomRPW/4E8mewXuwdV9sBjhCVAZ45VnFkAsQgq2PRQBBLYxtyGIrr+yIh FbATq3VSv0dmf2qs0ADiQS4W14cTvSbr6PxVv3qGx/wOAGAhXU+ptwUWghq1WCES1Fgv h0po/hcTLKjsBX6NK5xvo0dDUfIbGbEJpKSsOMVicMSrwSJHs/Q9lZGF10PWAL+PTjGk KE52LNtJ6JmHhhiqytf+rTNGeeaIFPqfWr8hXBzi738I0GrIaFWCOS61556nwT8onwQP Aeag== X-Gm-Message-State: ACrzQf2FFmmm4a0is1gcFBmFWK4pZF3r1L3QR6lJHVzqskFhdwWZL1VB l3KDUlIvjxBbYlS9SFOR5TW8cp1hZlLIQw== X-Google-Smtp-Source: AMsMyM6wMyiuhSkfJCZ5ciDDoE0v7DvJqmoL0dlSQdskN0BqHE4oE3Y4V9Zwa/ZZv7xfQpM6wkyxxQ== X-Received: by 2002:ad4:5945:0:b0:4bb:7357:d0ce with SMTP id eo5-20020ad45945000000b004bb7357d0cemr17895156qvb.74.1666877319139; Thu, 27 Oct 2022 06:28:39 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id v12-20020a05620a440c00b006eed47a1a1esm928559qkp.134.2022.10.27.06.28.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 06:28:38 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 02/14] gnu: pypy: Move to separate module. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-2-marius@gnu.org> Date: Thu, 27 Oct 2022 09:28:37 -0400 In-Reply-To: <20221017201201.4808-2-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:11:49 +0200") Message-ID: <878rl1l7ju.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Marius Bakke writes: > 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=E2=80=A6 > * gnu/packages/pypy.scm (pypy): =E2=80=A6here > * gnu/local.mk: Register new file. > > Co-authored-by: Marius Bakke > --- > gnu/local.mk | 1 + > gnu/packages/pypy.scm | 273 ++++++++++++++++++++++++++++++++++++++++ > gnu/packages/python.scm | 167 ------------------------ > 3 files changed, 274 insertions(+), 167 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 =3D \ > %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 =C2=A9 2013 Nikita Karetnikov > +;;; Copyright =C2=A9 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Co= urt=C3=A8s > +;;; Copyright =C2=A9 2013, 2014, 2015, 2016 Andreas Enge > +;;; Copyright =C2=A9 2014, 2015 Mark H Weaver > +;;; Copyright =C2=A9 2014, 2017, 2019 Eric Bavier > +;;; Copyright =C2=A9 2014, 2015 Federico Beffa > +;;; Copyright =C2=A9 2015 Omar Radwan > +;;; Copyright =C2=A9 2015 Pierre-Antoine Rault > +;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus > +;;; Copyright =C2=A9 2015, 2016 Christine Lemmer-Webber > +;;; Copyright =C2=A9 2015 Eric Dvorsak > +;;; Copyright =C2=A9 2015, 2016 David Thompson > +;;; Copyright =C2=A9 2015, 2016, 2017, 2021 Leo Famulari > +;;; Copyright =C2=A9 2015, 2017 Ben Woodcroft > +;;; Copyright =C2=A9 2015, 2016 Erik Edrosa > +;;; Copyright =C2=A9 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner = > +;;; Copyright =C2=A9 2015, 2017 Kyle Meyer > +;;; Copyright =C2=A9 2015, 2016 Chris Marusich > +;;; Copyright =C2=A9 2016 Danny Milosavljevic > +;;; Copyright =C2=A9 2016 Lukas Gradl > +;;; Copyright =C2=A9 2016, 2018 Hartmut Goebel > +;;; Copyright =C2=A9 2016 Daniel Pimentel > +;;; Copyright =C2=A9 2016 Sou Bunnbu > +;;; Copyright =C2=A9 2016, 2017 Troy Sankey > +;;; Copyright =C2=A9 2016, 2017 Nikita > +;;; Copyright =C2=A9 2016 Dylan Jeffers > +;;; Copyright =C2=A9 2016 David Craven > +;;; Copyright =C2=A9 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke > +;;; Copyright =C2=A9 2016, 2017 Stefan Reich=C3=B6r > +;;; Copyright =C2=A9 2016 Dylan Jeffers > +;;; Copyright =C2=A9 2016, 2017 Alex Vong > +;;; Copyright =C2=A9 2016, 2017, 2018 Arun Isaac > +;;; Copyright =C2=A9 2016=E2=80=932018, 2021 Tobias Geerinckx-Rice > +;;; Copyright =C2=A9 2016, 2017, 2018, 2021 Julien Lepiller > +;;; Copyright =C2=A9 2016, 2017 Thomas Danckaert > +;;; Copyright =C2=A9 2017 Carlo Zancanaro > +;;; Copyright =C2=A9 2017 Frederick M. Muriithi > +;;; Copyright =C2=A9 2017, 2018 Adriano Peluso > +;;; Copyright =C2=A9 2017 Ben Sturmfels > +;;; Copyright =C2=A9 2017, 2018, 2019 Mathieu Othacehe > +;;; Copyright =C2=A9 2017 Jos=C3=A9 Miguel S=C3=A1nchez Garc=C3=ADa > +;;; Copyright =C2=A9 2017 Roel Janssen > +;;; Copyright =C2=A9 2017, 2018 Kei Kebreau > +;;; Copyright =C2=A9 2017 Rutger Helling > +;;; Copyright =C2=A9 2017 Muriithi Frederick Muriuki > +;;; Copyright =C2=A9 2017 Brendan Tildesley > +;;; Copyright =C2=A9 2018 Ethan R. Jones +;;; Copyright =C2=A9 2018 Fis Trivial > +;;; Copyright =C2=A9 2018 Vijayalakshmi Vedantham > +;;; Copyright =C2=A9 2018 Mathieu Lirzin > +;;; Copyright =C2=A9 2018 Adam Massmann > +;;; Copyright =C2=A9 2016, 2018 Tom=C3=A1=C5=A1 =C4=8Cech > +;;; Copyright =C2=A9 2018 Nicolas Goaziou > +;;; Copyright =C2=A9 2018 Oleg Pykhalov > +;;; Copyright =C2=A9 2018 Cl=C3=A9ment Lassieur > +;;; Copyright =C2=A9 2018, 2019, 2020, 2021 Maxim Cournoyer > +;;; Copyright =C2=A9 2018 Luther Thompson > +;;; Copyright =C2=A9 2018 Vagrant Cascadian > +;;; Copyright =C2=A9 2019 Tanguy Le Carrour > +;;; Copyright =C2=A9 2020 Jan (janneke) Nieuwenhuizen > +;;; Copyright =C2=A9 2020, 2021 Greg Hogan I really doubt all these individuals have contributed to *pypy*. The rest of this patch LGTM. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 09:29:30 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 13:29:30 +0000 Received: from localhost ([127.0.0.1]:56490 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2ws-0002h3-98 for submit@debbugs.gnu.org; Thu, 27 Oct 2022 09:29:30 -0400 Received: from mail-qt1-f181.google.com ([209.85.160.181]:38873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo2wr-0002gp-2h for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 09:29:29 -0400 Received: by mail-qt1-f181.google.com with SMTP id z6so1071348qtv.5 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 06:29:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wSk59Y9zi1lsJXtnj4aE1TflV9jw2ipaEYSQ3SUc9ac=; b=SHR9zV7oonF5c0qsLLA16G6N9w4d8zOvCn0MW4ROd1BydGHsBqRP41UVC8IS57Rqd+ 2NQ+g2j22uEgasAHdngBGpMAinLdimOrNA9fNSH956q5ha7v6VatOoLvYTVp+XFJNd+y 5Cg9tb1F2xzeLpqM9yuXUfHTvApv8DdrXV3NVByuxI2t72+2RYjnUNNtZjVvsC4uxNXK LQdgFzkUmVJGy6K6Xnay8MLhaK2mTcrW1MAFhyP+Cczbj65cK/bpI/uX8zyQwhLQiWeO HOrj7mSCxkyk4AatnAtpgkluQ50ZOBx9mc6shQvkyxxns6xR1bzXJFGFjN3NJBx0SuiZ A7yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wSk59Y9zi1lsJXtnj4aE1TflV9jw2ipaEYSQ3SUc9ac=; b=aNA7Sto8Ys1/77rfIJeiBIAYI+bgnZoUGoARbmprkgn2TSWuvdKoG8MDlSNTwNb+Bj 3g31jwtBw4BT3lZXIHLXp/OcnEb91WouI40hox1lbTrqhsX7wKbCJv3uNSeWf4ccZQEo Ec0aUAJfBcj7h595jMyZpysm5Ut6t2KpqmzlLxiz1y6L143i29JbsmVZld48DggQ3fxn o2Pbbkm5vagEvUmMVpMvOJk2BqApK1z6M9lahClq8p/9Q1hgb9PA7smf3LYPuxY1eE2s nRoYFgCk//JNBlZdRrMUsFri9PmkCwOoQXwqr7GLi1IALWcTl72/YA8osU5PBvnRylPl mxGw== X-Gm-Message-State: ACrzQf1WW3MVmwYP51lf64xFQndTht5hSgbVxJ+YirugJL9VmqQg7REa 609J0nouVoak9124Ao/02owJZYxJgT31zg== X-Google-Smtp-Source: AMsMyM5MJq9hhsFAlVNpvf+/KKY4dj4dEvapvnOVGntc0iV42NMBF8LmGiqdNWUIpTh/L6jea8/0Hg== X-Received: by 2002:a05:622a:1389:b0:39c:c847:f384 with SMTP id o9-20020a05622a138900b0039cc847f384mr41958472qtk.301.1666877363259; Thu, 27 Oct 2022 06:29:23 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id l20-20020a05620a28d400b006ce813bb306sm948979qkp.125.2022.10.27.06.29.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 06:29:22 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 03/14] gnu: python-pip: Move to (gnu packages python-build). References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-3-marius@gnu.org> Date: Thu, 27 Oct 2022 09:29:21 -0400 In-Reply-To: <20221017201201.4808-3-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:11:50 +0200") Message-ID: <874jvpl7im.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Marius Bakke writes: > * gnu/packages/python-xyz.scm (python-pip): Move from here ... > * gnu/packages/python-build.scm (python-pip): ... to here. LGTM. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 10:08:32 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 14:08:32 +0000 Received: from localhost ([127.0.0.1]:58746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3Yd-0004LM-Qp for submit@debbugs.gnu.org; Thu, 27 Oct 2022 10:08:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53562) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3Ya-0004L8-QE for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 10:08:30 -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 1oo3YU-0006BN-Bh; Thu, 27 Oct 2022 10:08:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=UNLhJoeyqaXzWOHTb4tZgglW/ASm6oOEhFXx87mswW4=; b=AVw3GMxOU9Bf4Xg67MD2 BnrGRIoHNCwswAOpuZxRPuSoU+S3C217JN13VrYAYuh7/glQTMtzu+0KkhjTG5Ruzp5DJosKh0SNu JvNGyrHihJwaPHpD7LKN4xlNv78wxhjUc9ENw2bTQ5axEVD4xP7oMJnFawgr84/L65k7PiyxfQUA9 PPHq3T8m9scBBnUqwS1WBoFCHIwmJnZ9UPdlh1jp04iW00w14b9gayBRutTs06qFCBO67lvFUU3Bg I6z7HDZ5ezh4bHl93RVBFS8/kAZ+kmdKWTfMnkNotFJ7StvuHLUMl8pRCg/S6w+OZo89h8On80bbn OGpBbPrExdbShQ==; 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 1oo3YO-00046c-Hp; Thu, 27 Oct 2022 10:08:20 -0400 From: Marius Bakke To: Maxim Cournoyer Subject: Re: [bug#58587] [PATCH 01/14] gnu: python-setuptools: Move to python-build. In-Reply-To: <87czadl7of.fsf@gmail.com> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <87czadl7of.fsf@gmail.com> Date: Thu, 27 Oct 2022 16:08:12 +0200 Message-ID: <874jvptl4j.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Maxim Cournoyer skriver: >> +(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. > > I don't think we need a TODO to fix installers for Windows. I concur. >> + '(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? > > A better place for this TODO would be next to the snippet in the origin, > perhaps? The comments were taken verbatim from the current package definition. I'll submit a follow-up commit with these changes. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1qQzQ8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHclyQD/fXoNGvA7mAUavN3lsVXLFJBwt+oI62/aiLRU wOLlCuUA/RpdJmNxbkGB6ntGZDYwriL4pbjKI2e5mEahlcsPJtgK =4dly -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 10:23:12 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 14:23:12 +0000 Received: from localhost ([127.0.0.1]:58821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3mo-0004kd-FU for submit@debbugs.gnu.org; Thu, 27 Oct 2022 10:23:11 -0400 Received: from mail-qt1-f182.google.com ([209.85.160.182]:35654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3ml-0004kL-NL for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 10:23:09 -0400 Received: by mail-qt1-f182.google.com with SMTP id g16so1208931qtu.2 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 07:23:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=fDLNen/fy2ZA8q4rAIonUJ7cAa4/CkRxcCeawP2WZ/0=; b=kNYxMTePWhMB4YxIFkrgzKCq5nw7prWulA60RhSFlWT3e8Innnipe1g7w6BtNAXaGl YedL0TP8bGQzwo0fnaqJAolvpDQR+G4HKcp5wB5k/NSHHYbdH90wsujjjHhrZnwweC8a 64VXGwVAlTaPhz24LAV1rynaVtJTlMRwJQ638mDX2js7aXcm0pChAg5+YE3EBA585HFN IsrUCn6Ihm+DMGs+IHx0jW4IeRyrTIc/6QNcmUmCfDZISJUUhWJ4e1C0k1Ikf1k6dFK1 GYnf4X6AQHyI4gMP5XrJ7OoxXH9SFEvVCKEuNF8Ske1UYYdSLQsgtyapOfZCgweyw7iJ Eqpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=fDLNen/fy2ZA8q4rAIonUJ7cAa4/CkRxcCeawP2WZ/0=; b=utjom3CPsfJ0JvM3f7vdL0Z7uKoFCK9fl/EbUCh0VCYi//z8ygkoDgGd0On0RmB1mp InY4YCKjb0C3dYNBErY3PynWmd4QRtbgpygXkg3V2JkcDJwtQQPnpXhO6m7vVBHCMBIs fVlqXHZEndla9syD1Q+QDfji/zuVhpg3gqtxN53a1U/pWKtXLIeP6D2X4ThV7SWHdRNa gABAh3QdaD/FLt1+FcjjxaEdY2rEBdVMJF6m2UECiUQ2sBaz78YulOW/SdfYLZbKFtl9 3boc8gp7SLmNmgDZrJrTtUBIqdJAxasWfJ0LnjIMrh5WAWoQL3n5J19MPHZxkYk+G+IN 6qyQ== X-Gm-Message-State: ACrzQf0rpVrC+0hLQh9yOemmJOCx10gXRs5JpOU3X0g40p8vsUMJMJug 8qE1n3yR0x3z3QXXVCREDBA0WfT/JGYeOA== X-Google-Smtp-Source: AMsMyM7U58hz4FZq0XVrj0qdDoJuEV8pNYTgaGIZgFSL4otDtNFNQfdqQWHX1/Ufm7n3LB6ufOU8Cw== X-Received: by 2002:ac8:5b10:0:b0:39c:d63a:d88 with SMTP id m16-20020ac85b10000000b0039cd63a0d88mr40925250qtw.682.1666880581798; Thu, 27 Oct 2022 07:23:01 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id t10-20020a05622a01ca00b0035d432f5ba3sm961127qtw.17.2022.10.27.07.23.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 07:23:01 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> Date: Thu, 27 Oct 2022 10:23:00 -0400 In-Reply-To: <20221017201201.4808-4-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:11:51 +0200") Message-ID: <87zgdhjqgr.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Marius Bakke writes: > From: Lars-Dominik Braun > > This is an experimental build system based on python-build-system > that implements PEP 517-compliant builds. > > * guix/build-system/pyproject.scm, > guix/build/pyproject-build-system.scm, > gnu/packages/aux-files/python/sanity-check-next.py, I know this file is temporary, but I'd keep the copyright/license notices header anyway, less it may be forgotten in the future. > 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. Seems this could be merged into gnu/packages/python-build.scm instead of creating a new module. [...] > diff --git a/guix/build/pyproject-build-system.scm b/guix/build/pyproject= -build-system.scm > new file mode 100644 > index 0000000000..141d4d849f > --- /dev/null > +++ b/guix/build/pyproject-build-system.scm > @@ -0,0 +1,460 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2013, 2015, 2016, 2018, 2019 Ludovic Court=C3=A8s <= ludo@gnu.org> > +;;; Copyright =C2=A9 2013 Andreas Enge > +;;; Copyright =C2=A9 2013 Nikita Karetnikov > +;;; Copyright =C2=A9 2015, 2018 Mark H Weaver > +;;; Copyright =C2=A9 2016 Hartmut Goebel > +;;; Copyright =C2=A9 2018 Ricardo Wurmus > +;;; Copyright =C2=A9 2018 Arun Isaac > +;;; Copyright =C2=A9 2019, 2020, 2021 Maxim Cournoyer > +;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka > +;;; Copyright =C2=A9 2020 Efraim Flashner > +;;; Copyright =C2=A9 2021 Maxime Devos > +;;; > +;;; The above copyright is taken from python-build-system. Contributions > +;;; made only to this module are listed below: > +;;; Copyright =C2=A9 2021 Lars-Dominik Braun > +;;; Copyright =C2=A9 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 gnu-build-system) #:prefix gnu:) > + #: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 t= he > +;; 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=E2=80=99 wheel build= er 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 unpac= ked > +;; 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=E2=80=99s site-pac= kages > +;; subdirectory and scripts are written to bin/. These are not part of a > +;; wheel and expected to be created by the installing utility. > +;; > +;; Caveats: > +;; - There is no support for in-tree build backends. > + > +;; 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-err= or > + 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* (sanity-check #:key tests? inputs outputs #:allow-other-keys) > + "Ensure packages depending on this package via setuptools work properl= y, > +their advertised endpoints work and their top level modules are importab= le > +without errors." > + (let ((sanity-check.py (assoc-ref inputs "sanity-check.py"))) > + ;; Make sure the working directory is empty (i.e. no Python modules = in it) > + (with-directory-excursion "/tmp" > + (invoke "python" sanity-check.py (site-packages inputs outputs))))) > + > +(define* (build #:key outputs build-backend configure-flags #:allow-othe= r-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 =3D [\"'](.+)[\"']" = 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 confi= gure-flags <>))) > + ;; python-setuptools=E2=80=99 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 upda= te arbitrary > + ;; fields in case a package switches its build system. > + (use-build-backend (or > + build-backend > + auto-build-backend > + "setuptools.build_meta"))) Odd indentation; I'd re-indent it as (or build-backend auto-build-backend ...) =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > + (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-di= r. > + (invoke "python" "-c" "import sys, importlib, json > +config_settings =3D json.loads (sys.argv[3]) > +builder =3D importlib.import_module(sys.argv[1]) > +builder.build_wheel(sys.argv[2], config_settings=3Dconfig_settings)" > + use-build-backend wheel-dir config-settings))) > + > +(define* (check #:key inputs outputs tests? test-backend test-flags #:al= low-other-keys) > + "Run the test suite of a given Python package." > + (if tests? s/if/when/ > + ;; Unfortunately with PEP 517 there is no common method to specify t= est > + ;; systems. Guess test system based on inputs instead. Use two spaces between sentences. > + (let* ((pytest (which "pytest")) > + (nosetests (which "nosetests")) > + (nose2 (which "nose2")) > + (have-setup-py (file-exists? "setup.py")) > + (use-test-backend > + (or > + test-backend Odd indentation, same comment as above. > + ;; 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-ass= ert"))))) I think I'd leave the defaults in and document it that way. > + ('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 (python-version python) > + (let* ((version (last (string-split python #\-))) > + (components (string-split version #\.)) > + (major+minor (take components 2))) > + (string-join major+minor "."))) > + > +(define (python-output outputs) > + "Return the path of the python output, if there is one, or fall-back t= o out." > + (or (assoc-ref outputs "python") > + (assoc-ref outputs "out"))) > + > +(define (site-packages inputs outputs) > + "Return the path of the current output's Python site-package." > + (let* ((out (python-output outputs)) > + (python (assoc-ref inputs "python"))) > + (string-append out "/lib/python" (python-version python) "/site-pack= ages"))) > + > +(define (add-installed-pythonpath inputs outputs) > + "Prepend the site-package of OUTPUT to GUIX_PYTHONPATH. This is usefu= l when > +running checks after installing the package." > + (setenv "GUIX_PYTHONPATH" (string-append (site-packages inputs outputs= ) ":" > + (getenv "GUIX_PYTHONPATH")))) > + > +(define* (add-install-to-pythonpath #:key inputs outputs #:allow-other-k= eys) > + "A phase that just wraps the 'add-installed-pythonpath' procedure." > + (add-installed-pythonpath inputs outputs)) > + > +(define* (add-install-to-path #:key outputs #:allow-other-keys) > + "Adding Python scripts to PATH is also often useful in tests." > + (setenv "PATH" (string-append (assoc-ref outputs "out") > + "/bin:" > + (getenv "PATH")))) > + > +(define* (install #:key inputs outputs (configure-flags '()) #:allow-oth= er-keys) Unused configure-flags argument. Also do not provide a default, as that's the concern of (guix build-system pyproject). > + "Install a wheel file according to PEP 427" > + ;; See https://www.python.org/dev/peps/pep-0427/#installing-a-wheel-di= stribution-1-0-py32-none-any-whl > + (let* ((site-dir (site-packages inputs outputs)) > + (python (assoc-ref inputs "python")) > + (out (assoc-ref outputs "out"))) Plain "let" seems enough here. > + (define (extract file) > + "Extract wheel (ZIP file) into site-packages directory" > + ;; Use Python=E2=80=99s 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 direct= ories." > + (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=E2=80=99s 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)))))= )) Not sure how this #!python shebang comes into existence; as that isn't a valid one. Perhaps double check things here? > + ;; data can create arbitrary directory structures. Most commonly > + ;; it is used for share/. Perhaps ;; Data can be contained in arbitrary ... ? > + (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-ve= rsion python) "/" distribution))) This line should be broken to fit under 80 chars. > + (when (file-exists? source) > + (merge-directories source destination)))) > + > + (define (list-directories base predicate) > + ;; Cannot use find-files here, because it=E2=80=99s recursive. > + (scandir > + base > + (lambda (name) > + (let ((stat (lstat (string-append base "/" name)))) > + (and > + (not (member name '("." ".."))) > + (eq? (stat:type stat) 'directory) > + (predicate name stat)))))) nitpick: and indentation style (same comment as for 'or' above). > + (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)))) > + ((=3D (length wheels) 0) > + (raise (condition (&no-wheels-built))))) Indentation is off here. > + (for-each extract wheels)) > + (let ((datadirs (map > + (cut string-append site-dir "/" <>) > + (list-directories site-dir (file-name-predicate "\\.= data$"))))) Too long line and map indentation style. > + (for-each (lambda (directory) > + (expand-data-directory directory) > + (rmdir directory)) > + datadirs)))) > + > +(define* (compile-bytecode #:key inputs outputs (configure-flags '()) #:= allow-other-keys) Unused configure-flags argument. > + "Compile installed byte-code in site-packages." > + (let ((site-dir (site-packages inputs outputs))) > + (invoke "python" "-m" "compileall" "--invalidation-mode=3Dunchecked-= hash" > + site-dir))) > + > +(define* (create-entrypoints #:key inputs outputs (configure-flags '()) = #:allow-other-keys) Unused configure-flags argument. > + "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." Two spaces between sentences. > + > + (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-mat= ch 1) #f)) > + (next-inside > + (if (not group-name) > + inside > + (or > + (string=3D? group-name "console_scripts") > + (string=3D? group-name "gui_scripts")))) > + (item-match (string-match "^([^ =3D]+)\\s*=3D\\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)))))))) Our coding standard is 80 chars width, not 100 :-). > + (define (create-script path name module function) > + "Create a Python script from an entry point=E2=80=99s NAME, MODULE a= nd > + 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 fu= nction > + 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))) Phew, that's a lot of parsing and manual handling of things. I'd rather we leave this to uptream tooling instead of having to maintain that ourselves, but based on previous discussion it remember that bootstrapping pypi was thought too difficult. > +(define* (wrap #:key inputs outputs search-paths #:allow-other-keys) > + (define (list-of-files dir) > + (find-files dir (lambda (file stat) > + (and (eq? 'regular (stat:type stat)) > + (not (wrapped-program? file)))))) > + > + (define bindirs > + (append-map (match-lambda > + ((_ . dir) > + (list (string-append dir "/bin") > + (string-append dir "/sbin")))) > + outputs)) > + > + ;; Do not require "bash" to be present in the package inputs > + ;; even when there is nothing to wrap. > + ;; Also, calculate (sh) only once to prevent some I/O. > + (define %sh (delay (search-input-file inputs "bin/bash"))) > + (define (sh) (force %sh)) > + > + (let* ((var `("GUIX_PYTHONPATH" prefix > + ,(search-path-as-string->list > + (or (getenv "GUIX_PYTHONPATH") ""))))) > + (for-each (lambda (dir) > + (let ((files (list-of-files dir))) > + (for-each (cut wrap-program <> #:sh (sh) var) > + files))) > + bindirs))) > + > +(define* (set-SOURCE-DATE-EPOCH #:rest _) Perhaps name this set-SOURCE-DATE-EPOCH* to hint that it's not the same thing duplicated. The rest of the patch LGTM. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 10:24:19 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 14:24:20 +0000 Received: from localhost ([127.0.0.1]:58837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3nv-0004nA-Mf for submit@debbugs.gnu.org; Thu, 27 Oct 2022 10:24:19 -0400 Received: from mail-qt1-f176.google.com ([209.85.160.176]:39821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3nt-0004mx-NE for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 10:24:18 -0400 Received: by mail-qt1-f176.google.com with SMTP id r19so1198415qtx.6 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 07:24:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=wxeNQVuL8gZMyXoES44Lqnfbo2XJCSgYSwfC+8yZ1Dw=; b=MgPG9lECV5QtsG7T0w5CD5eJa8eFPDWPEwiFZ+BtawQttJPnyYHhvojmqi7jevNQfT mN7n0W1pNQRRhFUq8MiNc6BiE2GGTpoie+opngfISJTJ2LoLOsad9hRKwkf5EFdgteBY qik4ECy3GDw7oITdgNVSc+0cbQSH7BwvrBxdu4sjUzQ4ffq7m9mYP2mIHN3p/cFlwuZ8 oPyBMX1dNI1zwuucoeZ9AtECa/0gT/nlXVMoLhjD7xxE2FUQTsd8lV1YLRT+/J0hKjD3 SYAF0RIWrBA2YL6y57mCfnv0nj5llJ+aH373hx0iGyacAZTlt41JOWWYKTBIa9YD8ZUE qYaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=wxeNQVuL8gZMyXoES44Lqnfbo2XJCSgYSwfC+8yZ1Dw=; b=vhwE4qsARM2nYejrJQLrsG2lGMvaMUD8GrUGOzgyyAb3G2VlvoqHW8RuA5rR0IuBSc /53hG4t8zxvPTQHhdyiPgVYMafICELeb/ksMAhM2Tk15qqXfUe+IWKwB/N9HdrurZvAF TdxtY0xLZfYhdQ3xbbLBI3Q5+TkeNgfdpQow6vbrq7hxhHRpSk4up7opMzAqd0TPd5xC bWGf0E8oWRHgMCJhcD08jC3DOcO+il8yZ3DyZ10PJbKe0FtecIFgd5+cpCUm5KlnOAWK rXV2RwTGHidSXFXn5ZyZlej0+PqXcRQQ4t47OokYK074/zHVUstmLBnqo+et1vYI4WJd bm4A== X-Gm-Message-State: ACrzQf161PpZ5NlpSc45BzX2XEpDVBESFXJRVNMnSXncPUv0xI1p8Aaj emYRmh0Y3CBE1U/fdzV2xgfPjLDFNzGrtw== X-Google-Smtp-Source: AMsMyM4ZMv95ltWKcOSIFK/zsCUy0Xr5VgrZVffbnHa2IbMynALkR1uBOQPAsuFumt2dWVNW2bU/VQ== X-Received: by 2002:ac8:5991:0:b0:39c:be3a:6f4f with SMTP id e17-20020ac85991000000b0039cbe3a6f4fmr41829037qte.348.1666880652141; Thu, 27 Oct 2022 07:24:12 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id o8-20020a05620a2a0800b006eeaf9160d6sm1072512qkp.24.2022.10.27.07.24.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 07:24:11 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 05/14] gnu: python-autopage: Use pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-5-marius@gnu.org> Date: Thu, 27 Oct 2022 10:24:10 -0400 In-Reply-To: <20221017201201.4808-5-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:11:52 +0200") Message-ID: <87v8o5jqet.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Marius Bakke writes: > * gnu/packages/python-xyz.scm (python-autopage)[build-system]: Switch to > PYPROJECT-BUILD-SYSTEM. > [arguments]: Remove redundant phases. Nice! LGTM. -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 10:26:41 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 14:26:41 +0000 Received: from localhost ([127.0.0.1]:58868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3qD-0004ry-3v for submit@debbugs.gnu.org; Thu, 27 Oct 2022 10:26:41 -0400 Received: from mail-qk1-f179.google.com ([209.85.222.179]:46834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo3qB-0004rb-VB for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 10:26:40 -0400 Received: by mail-qk1-f179.google.com with SMTP id z30so982922qkz.13 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 07:26:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=q7PR/twxkWC6UukBIjwm2PEwHF9Bngcn121ctoCouI8=; b=B/KQEegHGBHCCxpWUZdrl2KSlbSdPV8x4mnLTkoh/bt8kVlbeeV8aLU2WCo8Qugh2o ulliofszQtpkM+QZLqTCfWafIJBUo0G56oJQs5rrmULy6w0D4x0auMDTs0idFcjHvltR SN0LYLdCdkVMNZuDjQ+8WugeehVnIljgUpRCiSFJf9ziIFW7oqzIMl27Cjto46aOCtyx Fk2nwM53lzxpJcbZcRC0ct0JCVbsUIitsjyTzawt2cWJRLhR6PRC+DmmrnsZLKK3i00a dH35EsuFAxYPEUf+a6x86+/lApNkvlsENg+tbklSKw24ZtlEvOCgO2axzzYajvX8xXKb 29Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=q7PR/twxkWC6UukBIjwm2PEwHF9Bngcn121ctoCouI8=; b=KxMI9qaogUNLxdCvYIWJ2LMWwRjBmxldTLjhsS17TsE0OPv7gIyElLa+7bmPPacXeO cS5CCxj6n+c1GIwbKIY8gELVnq7rdwqYVvJsFfD68CRUFA5VdHb8rknMY2jy1Rpo4Xad euixi0bk1TJHcF3xZqN6o+/lk0UvRwc0J5C6WK0/4OBui96WWsz0sg7bwX6h8f+Vop0V MwXyUXJDFOjxbUvez/KhhPvVOelGrvDu3rKqiXe0LGpK66+CLD8jti5qnuHI6+M/LJ3e GpPxE9Gei1SfxWq4pMeTv8fy3c+W/psIp1D8PRLipyLUyNUYaEsp9giSiPyvyTbkgt1O bTcw== X-Gm-Message-State: ACrzQf3Y1Jk0uXl9VABGdezK7Iu7CHz/96nKrKcM4b3JBSaFlOwj3srj THs8B4ewpVIDBRabkD9DPIVzrQn5z+MjXA== X-Google-Smtp-Source: AMsMyM64qdP4azPrS69bDqlxlH3tN4V7WeM0InYkQZnLgLoQs0O4soqy5EGtjPzROi6LDhZVUh/k3Q== X-Received: by 2002:a05:620a:24cf:b0:6ee:6fb:4adf with SMTP id m15-20020a05620a24cf00b006ee06fb4adfmr34727202qkn.755.1666880794239; Thu, 27 Oct 2022 07:26:34 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id bl7-20020a05620a1a8700b006b5cc25535fsm1031947qkb.99.2022.10.27.07.26.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 07:26:33 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 14/14] gnu: python-pygmsh: Use pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-14-marius@gnu.org> Date: Thu, 27 Oct 2022 10:26:32 -0400 In-Reply-To: <20221017201201.4808-14-marius@gnu.org> (Marius Bakke's message of "Mon, 17 Oct 2022 22:12:01 +0200") Message-ID: <87r0ytjqav.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi, Marius Bakke writes: > * gnu/packages/simulation.scm (python-pygmsh)[build-system]: Switch to > PYPROJECT-BUILD-SYSTEM. > [arguments]: Remove redundant phases. > [native-inputs]: Remove PYTHON-PYPA-BUILD. LGTM, as well as all the previous patches switching to pyproject-build-system. Well done! :-) -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 11:17:22 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 15:17:22 +0000 Received: from localhost ([127.0.0.1]:58993 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo4dF-0006H4-RZ for submit@debbugs.gnu.org; Thu, 27 Oct 2022 11:17:22 -0400 Received: from mout-p-201.mailbox.org ([80.241.56.171]:44948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo4dB-0006Gk-3K for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 11:17:20 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4Myq6C27Hhz9slC; Thu, 27 Oct 2022 17:17:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1666883827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8EiK+UeX7k/hmZL2Mspr5SoOVv93zjW74nyIWu1ri70=; b=sygUR3r+stBg3iYbtOL2GJcVwQNnYHQ3yyO8LZFyQiWkVaQ15TIgctDBToJJRgZVAV9Mwy ZhMZlBLlt6incOPx41K4q6hvdW+cFSlLMTk2E+fbrkE55Jlz7xQ3Po1AxkC/KXDkCAX/PX k8HCswzbGWEWydG8hrHc7dgkfnCZ71p6YJ9RZB2Xn7RKtpi+EVthzlXwI1vKfYvhK2FJFT BeThsavS0qk3pJxEoSuqbkoK5BazqF/KvTjhgnV7j6KYmkbKLkKRRZgQgxQhez5LArOuoC 0BvgKSVCWvemirA5wG0RBZWot1fxsOC7IhdtZrii6Y/HbFvoCG1hldkxt4kEyA== Date: Thu, 27 Oct 2022 17:17:05 +0200 From: Lars-Dominik Braun To: Maxim Cournoyer Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. Message-ID: References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> <87zgdhjqgr.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zgdhjqgr.fsf@gmail.com> X-Rspamd-Queue-Id: 4Myq6C27Hhz9slC X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Marius Bakke X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Maxim, as the original author, I might be able to answer a few of these questions. > Not sure how this #!python shebang comes into existence; as that isn't a > valid one. Perhaps double check things here? As mentioned by the docstring of INSTALL this conforms to PEP 427. > Phew, that's a lot of parsing and manual handling of things. I'd rather > we leave this to uptream tooling instead of having to maintain that > ourselves, but based on previous discussion it remember that > bootstrapping pypi was thought too difficult. Last time I checked installer (https://github.com/pypa/installer) wasn’t in a good enough shape to use it here. We’d still have to write a few lines of Python code, since it does not come with an executable. Bootstrapping pip is pretty much impossible due to the amount of vendored components. Lars From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 13:13:01 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 17:13:01 +0000 Received: from localhost ([127.0.0.1]:59180 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6RA-00033a-Ll for submit@debbugs.gnu.org; Thu, 27 Oct 2022 13:13:01 -0400 Received: from mail-qk1-f175.google.com ([209.85.222.175]:34508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6R5-00033L-VH for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 13:12:59 -0400 Received: by mail-qk1-f175.google.com with SMTP id 8so1478424qka.1 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 10:12:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=DBJJaSc0dfEYZtygDYI8S6awXPi9tCc8/RiiOzSz5Fc=; b=VgCNCZSFgPvdsv1uVd2lRHrAViHRgt/9HQm8Ul0subN+83GfS6p9qIOwja/Hchz6Sm pz7zHg6MV9gxYj7pPq9I7YR3OKrkY/EcMM+QkDWMXveUJmj21YousjJpvJFUp4+tMmIh h4WJKbqZEIPAA0c9VZ4LS9bCTv9RhWufcnEXE5/jOR2cTlTQeFW5uEktxeq19ocpKKlW pO4/HlGw1DmftZ0XWiIMUfP6BGia2QBSsipC+emfPJOw9xRxRtU+J01g2LWeReFIYpre mQQO+/f96xqvg3tX1cP1Atrs8gq9ov+hmdHFU+AW6w1VzDkBGQGPJjmf8OszAzT6CDq/ swvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=DBJJaSc0dfEYZtygDYI8S6awXPi9tCc8/RiiOzSz5Fc=; b=CaG2sPbu0WYsbUjt7A0n6YPAPD5v8iMJpl5S/7n6A3yxc4f2oLlaK0jqvZn//E2qt9 AbM7upoGWLSLEKrbmrZz2NucRWTIG92I2XZPxhFu0JjaOeO65R3Nxc0tgIte695Zg70Q yfFkJl1B+48vk3eatfXfdeh5/eMXnukio1QUs5GcVRS/EqUibh/fv+e5gP57QDyDnCiY hY3MDaIgk3/XjD5edk/Hz0Nn10QM5+e94WDdw6lThjjh62mZwm4sxu5haMmBSQbVdcex 1hgJNqnC2sC9ZxKv8yhc//vLOw+FN3dXO2RpZXB8hWcou9kH23hP51rIKQoR/W34FVib by2Q== X-Gm-Message-State: ACrzQf0FXI+qcQxl5kiOEh0BXa9eiu6o6dzs9ovVDefMlZ2KzG5Na2wN ZMJ35Uvct+RJeJ3FF74Dw21c7+Dte9wWpw== X-Google-Smtp-Source: AMsMyM4U24nR4qeVHl/ya91exP5xOVhLbRXftfVie5yiEZ4M07Fy0JNmSmSw/PLCI8DxrV24jF5oLA== X-Received: by 2002:ac8:5702:0:b0:39c:f612:29b8 with SMTP id 2-20020ac85702000000b0039cf61229b8mr42004145qtw.68.1666890759752; Thu, 27 Oct 2022 10:12:39 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id f14-20020a05622a1a0e00b00398d83256ddsm1178984qtb.31.2022.10.27.10.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 10:12:39 -0700 (PDT) From: Maxim Cournoyer To: Lars-Dominik Braun Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> <87zgdhjqgr.fsf@gmail.com> Date: Thu, 27 Oct 2022 13:12:38 -0400 In-Reply-To: (Lars-Dominik Braun's message of "Thu, 27 Oct 2022 17:17:05 +0200") Message-ID: <87v8o5i41l.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Marius Bakke X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Lars-Dominik, Lars-Dominik Braun writes: > Hi Maxim, > > as the original author, I might be able to answer a few of these > questions. > >> Not sure how this #!python shebang comes into existence; as that isn't a >> valid one. Perhaps double check things here? > As mentioned by the docstring of INSTALL this conforms to PEP 427. OK, thanks for clearing that up for me. >> Phew, that's a lot of parsing and manual handling of things. I'd rather >> we leave this to uptream tooling instead of having to maintain that >> ourselves, but based on previous discussion it remember that >> bootstrapping pypi was thought too difficult. > Last time I checked installer (https://github.com/pypa/installer) > wasn=E2=80=99t in a good enough shape to use it here. We=E2=80=99d still = have > to write a few lines of Python code, since it does not come with an > executable. Bootstrapping pip is pretty much impossible due to the amount > of vendored components. This sounds like the kind of tool we'd want to use longer term, to avoid having to go back to the drawing board every time the Python community changes their mind on packaging matters (which is relatively often as of late). That said, I think the current approach can get us started, since it's already done and seems to work fine so far. --=20 Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 13:23:31 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 17:23:31 +0000 Received: from localhost ([127.0.0.1]:59199 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6bL-0003KY-13 for submit@debbugs.gnu.org; Thu, 27 Oct 2022 13:23:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39364) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6bJ-0003KI-Ix for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 13:23:30 -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 1oo6bD-000874-FK; Thu, 27 Oct 2022 13:23:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=MGMLETve4Ivaosh3rxiICmEaWQbg+2jmYJRtEXYhVsE=; b=cKaFJg1QFoVzBAyXe34t 24Vbsn3RHPzxb1NHWB/f5E1Pu8hyuHoqBLYoLQqI1Ig8164i51wgkyEVDFmpn1k4otIE8BwC3nxim /yxduhECmNRL8hFw9ExEnubxpiwV+UV+Ts2ozwY7fwNVHHEn8cA3lVvu3BrEY7MB8Ti76PaUHRaP7 R5H/IAc8nHE4Cboj6+qnRXZhzN5jLbYqCYpPmfQFcnmhUPoUdBjvpydL3JGGcBajAcygqFim8jqtV ycpxF3SM9d1fx/vpa0V5QzUMT/byROsP1PqzLDxGFD2O0YVcqB3cU6sEdEYO4/eCi10KM/kEv2d8K oQocmcSPQbaeVg==; 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 1oo6bC-0003s9-CB; Thu, 27 Oct 2022 13:23:23 -0400 From: Marius Bakke To: Maxim Cournoyer Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. In-Reply-To: <87zgdhjqgr.fsf@gmail.com> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> <87zgdhjqgr.fsf@gmail.com> Date: Thu, 27 Oct 2022 19:23:18 +0200 Message-ID: <871qqttc3d.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Maxim Cournoyer skriver: > Hello, > > Marius Bakke writes: > >> From: Lars-Dominik Braun >> >> This is an experimental build system based on python-build-system >> that implements PEP 517-compliant builds. >> >> * guix/build-system/pyproject.scm, >> guix/build/pyproject-build-system.scm, >> gnu/packages/aux-files/python/sanity-check-next.py, > > I know this file is temporary, but I'd keep the copyright/license > notices header anyway, less it may be forgotten in the future. Makes sense; done. >> 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. > > Seems this could be merged into gnu/packages/python-build.scm instead of > creating a new module. I think you reviewed an old revision; the latest revision adds python-toolchain straight into python.scm. We may have to bring back python-commencement.scm for bootstrapping setuptools and friends at a later core-updates cycle though. >> + ;; 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"))))) > > I think I'd leave the defaults in and document it that way. By leave, you mean: (apply invoke "pytest" "-vv" test-flags) ? >> +(define* (set-SOURCE-DATE-EPOCH #:rest _) > > Perhaps name this set-SOURCE-DATE-EPOCH* to hint that it's not the same > thing duplicated. Done; although in the latest revision nothing is duplicated as it inherits a bunch from python-build-system. Plans for the immediate core-updates cycle: * merge sanity-check-next.py into sanity-check.py * set SOURCE_DATE_EPOCH to ~1980 also in python-build-system (and inherit in pyproject-build-system) * move the compile-bytecode phase into python-build-system (currently python-build-system does this during install, hence duplication) --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1q+hw8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHeKgQD+PB21Eb1COjHfGjFxC8E+FllZ0/c+Y9aAsIX3 AraIdDsBALhq0Ye49mk10xx1p3SM7gbNWrf4/8wpNwgMH1j9Bo0F =3G68 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 13:34:25 2022 Received: (at 58587) by debbugs.gnu.org; 27 Oct 2022 17:34:25 +0000 Received: from localhost ([127.0.0.1]:59218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6lt-0003cN-Iv for submit@debbugs.gnu.org; Thu, 27 Oct 2022 13:34:25 -0400 Received: from mail-qk1-f170.google.com ([209.85.222.170]:33649) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo6lr-0003c8-Kd for 58587@debbugs.gnu.org; Thu, 27 Oct 2022 13:34:24 -0400 Received: by mail-qk1-f170.google.com with SMTP id x26so1553200qki.0 for <58587@debbugs.gnu.org>; Thu, 27 Oct 2022 10:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=bIcuWBa9GwuGgvL3ROOivaetCMd1CjPvEO883W1cO8E=; b=p7uw3MpU+2H6yW0PYnlrM/t5ykNIFyTQNWhPDgfIVyKedS5juaw0jVvfrqG4rKyU7a Z+6A/h3sCtomNuA2CWtN7kHbNeTyHvRkxAxk1YGgTpiM9MBW07d4TCbmHTPP00xcUl9H 2GpR21my+8k92SbJjxBSMTTDplyBlYv1wGTgIp8dthnBx2VVMrnpjswISDEzqt7goC0f RXP5puhEMflQl4whHgNKMYN7DRwjTIsQKiDQmDWValnaWcRe1EZ0fl72PKWfRpvkSe9r 98wYeeURlTfnydbLRpfimM95SIDkI+IBXkM15rtsckYEI4R6IDbIINcMaZuaNOXWDvNY tGeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=bIcuWBa9GwuGgvL3ROOivaetCMd1CjPvEO883W1cO8E=; b=ue7TDJrOdZEz9eHxJmuvJbUq9A+YbPr6a8j8iJfHREMBrpb43W6rJBEZxaynmkHjr4 i5DCczNIzQfvHvF93xxmsPktNIOaSf7+6kil4xxh0zmZ3i01LkU9oFO+J9gFs2+elceX bfWPQuY11LVzy73HkcY4Qy97dd5t2JTx0Ee7lIrZPqQPvYYP7VFyVx52kltqFu+xMeuN 8Anzy55sMRR55fCPvBPpEe1mfertEI5ziFpw0hRW89q5uGOT+1s0ScWn5n2dX3SKz26H jp1rz2CqpYQhj2yVjRB+FSo0yEoJtaKptMKvA29D7fHey0np/k8AGvNaOpc4Lnin6oya abxA== X-Gm-Message-State: ACrzQf1tEsOuEt/kz4daH1tThl2I4ttiT9nvsGFdAZmbIcGxQGPDj7Ki WE8Qn0af35jCO5Yl2wDter0= X-Google-Smtp-Source: AMsMyM6usiMX9yBQOuzRl+he9EFG8zj5SmwgX1Zm3qYzIN63wjo+ZMdJ95QyVzut0y78YnDFf57k2g== X-Received: by 2002:a05:620a:1082:b0:6eb:a13b:2460 with SMTP id g2-20020a05620a108200b006eba13b2460mr35782934qkk.156.1666892058110; Thu, 27 Oct 2022 10:34:18 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id fx12-20020a05622a4acc00b0039ccd7a0e10sm1151518qtb.62.2022.10.27.10.34.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 10:34:17 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 01/14] gnu: python-setuptools: Move to python-build. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <87czadl7of.fsf@gmail.com> <874jvptl4j.fsf@gnu.org> Date: Thu, 27 Oct 2022 13:34:16 -0400 In-Reply-To: <874jvptl4j.fsf@gnu.org> (Marius Bakke's message of "Thu, 27 Oct 2022 16:08:12 +0200") Message-ID: <87r0yti31j.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587 Cc: 58587@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Marius, Marius Bakke writes: > Maxim Cournoyer skriver: [...] >>> + '(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? >> >> A better place for this TODO would be next to the snippet in the origin, >> perhaps? > > The comments were taken verbatim from the current package definition. > > I'll submit a follow-up commit with these changes. I noticed when I got to read the removal part of the diff ;-). Sorry for giving you more work! -- Thanks, Maxim From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 15:32:36 2022 Received: (at 58587-done) by debbugs.gnu.org; 27 Oct 2022 19:32:36 +0000 Received: from localhost ([127.0.0.1]:59402 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo8cG-0006mo-Ep for submit@debbugs.gnu.org; Thu, 27 Oct 2022 15:32:36 -0400 Received: from eggs.gnu.org ([209.51.188.92]:47158) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo8cE-0006mY-2s for 58587-done@debbugs.gnu.org; Thu, 27 Oct 2022 15:32:34 -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 1oo8c8-00044V-Gp; Thu, 27 Oct 2022 15:32:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=du1mpWNAwoH6xRFQDacj+kU6f9TCFrU4ZF/HXEijwX4=; b=GIdi66Cm26DZDpKYNGR0 zjvIGu2O6aAOAwUrcceqRHYPlHRnxuuhTxd8qOJ2sYGGg1bY+g0O6LjawNEsZ3ZR+U4r0Gd2dZt4Y WsQT2R8j6B22j+as2dxZ6PriJXMq/6djp+MvGbJGKkpPBq6sCkE/WdhG39+RNiFmKrwHfHkuVoVZc j2T/d2x1tgTGb3+kwAuK4mddffvQCweLaS/YP/BaBgFGoyLtmDz/TEFcgYjuP8vfCHr0fxIN8+s0Z Jl3+vdlvCtsFLCsGDjXZpXap//Cpk2/NF9+JYCtoUOheD7swtdGqSXxRmqjzPPFcJMyFRYSn0X6rc ebv/aNxqHwDL5Q==; 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 1oo8c8-0006Fg-2N; Thu, 27 Oct 2022 15:32:28 -0400 From: Marius Bakke To: Maxim Cournoyer Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. In-Reply-To: <871qqttc3d.fsf@gnu.org> References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> <87zgdhjqgr.fsf@gmail.com> <871qqttc3d.fsf@gnu.org> Date: Thu, 27 Oct 2022 21:32:23 +0200 Message-ID: <87y1t1rrjs.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58587-done Cc: 58587-done@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Marius Bakke skriver: > Maxim Cournoyer skriver: > >> Hello, >> >> Marius Bakke writes: >> >>> From: Lars-Dominik Braun >>> >>> + ;; 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"))))) >> >> I think I'd leave the defaults in and document it that way. > > By leave, you mean: > > (apply invoke "pytest" "-vv" test-flags) > > ? I made this change in e944734ef9afa1ac9b46579934482b7d909ed24e. The patches are now merged! --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCY1rcyA8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHcvpgD7BBeyt/iHzCso8yd5ux/VzyUK4HhiLu8JT8hG z8wqXlIBAJMlLJQUM506e+rpLjPY437A8dzx0iQOlWM7hqd1oMQA =izOh -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 27 21:12:59 2022 Received: (at 58587-done) by debbugs.gnu.org; 28 Oct 2022 01:12:59 +0000 Received: from localhost ([127.0.0.1]:59785 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooDvf-00031M-1w for submit@debbugs.gnu.org; Thu, 27 Oct 2022 21:12:59 -0400 Received: from mail-qk1-f172.google.com ([209.85.222.172]:45662) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooDvd-00031A-9d for 58587-done@debbugs.gnu.org; Thu, 27 Oct 2022 21:12:57 -0400 Received: by mail-qk1-f172.google.com with SMTP id i10so2414297qkl.12 for <58587-done@debbugs.gnu.org>; Thu, 27 Oct 2022 18:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NdWztyMZq26OMPQ2x2p4/Cxj9pYdH1x5zLL/21HCo64=; b=bwYWnKenHqzkZA6ElAr6QAaqoP3Nl+nx9Pqe4dAmcakAJ1B2momBJjryJHoWzBo+KK SlyJP5UrjdN+b7zPtwV72ochaORQC6MuvA492ngKESMdvQcyJv5ngmQtN953+HTdK3RY aqshZNOHWf2x84lxBrxrOVTkcTPzqHsTOs4p8kifkQKiHKVkfk3RoJGe5gc8GRlNErWR vWmI/0UOESYZrjxpzC9klKJu7nOlMkPUvNBzwAUf3Rj8aV4puw6p/F2yZYgUdsxKaJAB xu6WqPvRn9IaNYOojXkhwXVSwHk4+abE4VJJRHr4Drx3HK2+he4x4TfJZoDG3R8YdciJ qclw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NdWztyMZq26OMPQ2x2p4/Cxj9pYdH1x5zLL/21HCo64=; b=ID7zPrBTNDfoj0y5Mqu4/XakYdXLetkCIRwnKpUJuvJmSbKf231xgPhRQJ2m519iDH SbJserLGpwrViGWGKO8S5d63zGonCrZwIrlBJvmEPsS8Ztr2kqkmjfMh6mdzzUQKaAL6 a+ENgqWz2TuVus7mL7r5IRIMmNl0q08uvJrLIeSfwFpQ51xDdwp9YiiFHGh/0IBe85hi FUvGgD6ilzYe3OKBXQYjihB/dIU73e4XCfxIQeKg8kJXBOPQJ07wq9XVvoeXmT8mno1/ x9l4eMR5q2B10l6DhhGXADBIb2fB6oEaacqMWANO/Vs52VZa75RqQMKy5uV6M9lZpeA0 beBw== X-Gm-Message-State: ACrzQf1KwRoOuAVoKY7WzJyWOT5HepSPM9vgMpv5gESs/LAxLw69HaKE 5ZM+nqg0Im1dJoSZcgLX+BU= X-Google-Smtp-Source: AMsMyM6MsH9kupbeUqpbOa8O+hlWcT3ZsYWNwnO4Ld1cGP7rXznL3N3zVT0vzG5IUD+yJYRn8dDNVA== X-Received: by 2002:a05:620a:2b9a:b0:6f9:f67a:fa1d with SMTP id dz26-20020a05620a2b9a00b006f9f67afa1dmr3790334qkb.185.1666919571668; Thu, 27 Oct 2022 18:12:51 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id r3-20020ac87ee3000000b0039442ee69c5sm1619776qtc.91.2022.10.27.18.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 18:12:51 -0700 (PDT) From: Maxim Cournoyer To: Marius Bakke Subject: Re: [bug#58587] [PATCH 04/14] build-system: Add pyproject-build-system. References: <20221017200624.4076-1-marius@gnu.org> <20221017201201.4808-1-marius@gnu.org> <20221017201201.4808-4-marius@gnu.org> <87zgdhjqgr.fsf@gmail.com> <871qqttc3d.fsf@gnu.org> <87y1t1rrjs.fsf@gnu.org> Date: Thu, 27 Oct 2022 21:12:49 -0400 In-Reply-To: <87y1t1rrjs.fsf@gnu.org> (Marius Bakke's message of "Thu, 27 Oct 2022 21:32:23 +0200") Message-ID: <878rl0iwdq.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58587-done Cc: 58587-done@debbugs.gnu.org, Lars-Dominik Braun X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Marius, Marius Bakke writes: > Marius Bakke skriver: > >> Maxim Cournoyer skriver: >> >>> Hello, >>> >>> Marius Bakke writes: >>> >>>> From: Lars-Dominik Braun >>>> >>>> + ;; 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"))))) >>> >>> I think I'd leave the defaults in and document it that way. >> >> By leave, you mean: >> >> (apply invoke "pytest" "-vv" test-flags) >> >> ? > > I made this change in e944734ef9afa1ac9b46579934482b7d909ed24e. > > The patches are now merged! Very nice! Well done! -- Thanks, Maxim From unknown Fri Aug 15 17:55:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 25 Nov 2022 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator