From patchwork Tue Oct 18 21:51:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43692 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8F0CA27BBEA; Tue, 18 Oct 2022 22:52:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E30D127BBE9 for ; Tue, 18 Oct 2022 22:52:12 +0100 (BST) Received: from localhost ([::1]:48858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okuVP-0003Z3-JX for patchwork@mira.cbaines.net; Tue, 18 Oct 2022 17:52:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42208) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okuVH-0003Yp-16 for guix-patches@gnu.org; Tue, 18 Oct 2022 17:52:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55921) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okuVG-0002fy-Hs for guix-patches@gnu.org; Tue, 18 Oct 2022 17:52:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okuVG-0006rb-DS for guix-patches@gnu.org; Tue, 18 Oct 2022 17:52:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH 00/14] Introducing pyproject-build-system. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 18 Oct 2022 21:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: zimoun , 58587@debbugs.gnu.org Cc: Lars-Dominik Braun , Maxim Cournoyer Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166612992026372 (code B ref 58587); Tue, 18 Oct 2022 21:52:02 +0000 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 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 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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? 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. --- 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 @@ -791,7 +791,9 @@ described above. 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 +804,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 +818,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..145aa16afd 100644 --- 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. +Eventually this build system will be deprecated and merged back into +@code{python-build-system}, probably some time in 2024. @end defvr @defvr {Scheme Variable} perl-build-system -- 2.38.0