From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id qHThFfIR8WNk7gAAbAwnHQ (envelope-from ) for ; Sat, 18 Feb 2023 18:59:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id GIX3FfIR8WPcugAA9RJhRA (envelope-from ) for ; Sat, 18 Feb 2023 18:59:14 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E692011C20 for ; Sat, 18 Feb 2023 18:59:13 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTRU9-0000BU-FX; Sat, 18 Feb 2023 12:58:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTRU7-0000B5-1B for help-guix@gnu.org; Sat, 18 Feb 2023 12:58:55 -0500 Received: from sender11-op-o12.zoho.eu ([31.186.226.226]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTRU4-000374-To for help-guix@gnu.org; Sat, 18 Feb 2023 12:58:54 -0500 ARC-Seal: i=1; a=rsa-sha256; t=1676743127; cv=none; d=zohomail.eu; s=zohoarc; b=ljOurTB3Qe9OY4ttR+pue0MGItx3WZFsxBRw3f4dvjJxtDkh0uugEOyF4xpZXTulwqunJk9K4gRX9U1NwJAfGJ6u2F5GnvCfHLkCEDszOXFoZUFVri/AMolnmFziSySYBnyyWXWPvFLIZCbJ0WCfZMSoaO5MhAxfE23Yz+1RXtg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.eu; s=zohoarc; t=1676743127; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=W8GcwIpYdz9j+mAnlxuQav4l742clBAjvC8T9YMempE=; b=LNbWH1pV8pIcl3+82WbAY43q+Jd+g2HhzAlinj9uhtTg3lXzWZPvoEc+z79pqgcEBsJgjTo8fnfPE/MQdNkNozNqIlPcFaht9guHmu9hws8V1AoyeyC74C8bbtnak1yu3mBUuAHWhjzixGCPaGLOGmrrwXKwslFIP+kkuVPVoLk= ARC-Authentication-Results: i=1; mx.zohomail.eu; dkim=pass header.i=rdklein.fr; spf=pass smtp.mailfrom=edou@rdklein.fr; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1676743127; s=zoho; d=rdklein.fr; i=edou@rdklein.fr; h=References:From:From:To:To:Cc:Cc:Subject:Subject:Date:Date:In-reply-to:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=W8GcwIpYdz9j+mAnlxuQav4l742clBAjvC8T9YMempE=; b=Yne/XalBrCZwjStzwZwo047HwIay4A7+BdyG55AtgraNzXPsIQp8GIRKDkkrsCFq oQM9SljhTF8XWuBbBIK1POYuCPe3slIrb1R1TSoeA/BoJILivLkeqTU3s7+Fw4eHoAL 0O3KzvZrrxvoopL64h5fMSPUmmnG6AKEJvqrUpPDZuiV1K4a5aflBbaJH6aIDnxPfIQ QPI1J04WAB1WoeMEDYENRXLaa3RtWFHr1G7PB4Jdvpo7Vranvy+ux3uYnkwQadNyI0H 0o1GjtyDZxAFaTZ0xsVab/n67WvYqJV7qy6R0DCXRBblclYdy2SfuEl0fT6o8NIUpKr 52CHPenNrQ== Received: from schwarzy (lfbn-idf3-1-667-244.w86-252.abo.wanadoo.fr [86.252.237.244]) by mx.zoho.eu with SMTPS id 167674312512754.02593414566593; Sat, 18 Feb 2023 18:58:45 +0100 (CET) References: <87ttzkose5.fsf@posteo.net> <20230218105734.61c02d5e.koszko@koszko.org> User-agent: mu4e 1.8.11; emacs 28.2 From: Edouard Klein To: Wojtek Kosior Cc: Kyle Andrews , help-guix@gnu.org Subject: Re: Using an alternative python to build python modules Date: Sat, 18 Feb 2023 18:53:18 +0100 In-reply-to: <20230218105734.61c02d5e.koszko@koszko.org> Message-ID: <871qmmlut8.fsf@rdklein.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External Received-SPF: pass client-ip=31.186.226.226; envelope-from=edou@rdklein.fr; helo=sender11-op-o12.zoho.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=pass header.d=rdklein.fr header.s=zoho header.b="Yne/XalB"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; arc=pass ("zohomail.eu:s=zohoarc:i=1"); dmarc=none ARC-Seal: i=2; s=key1; d=yhetil.org; t=1676743154; a=rsa-sha256; cv=pass; b=Fetv9JC9qPJfftkSITTytH1MMA1Qyp2UsOTS0wJCMk+tI7RD3216b4s4LbDKZCraS05Lk8 4qxk4ZjBjaN7aR+imGOIjIT573E3jeE+5fBDPJXSEAHNvg/ZTmf2zFk8EijOxEwwh5tan8 nObXrIkWK+SAaAn6sJ6UGO0QZJwZGacn6Y+QOrvGF9sEiE5hySlahuThNEYRB9hsErXqZP SQqVRZmN+VV92AHPfwKy7b3M5F/zPODTOPtqHrgDERYBDTv4FJJUueIkbslV1emSuTC71C 1I6NEJFkPOdmvFxVK0O2n9OrKGWw5n9iJqzMnz3Ll++tWteyGbHoMwzwKC/MRw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676743154; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=W8GcwIpYdz9j+mAnlxuQav4l742clBAjvC8T9YMempE=; b=bn+rx5NXOfbOpdsm2TcVH8eEz1ZY772UqNF0u9RLHLL2A5ToZz0GGL+qQ3KzNF+sWRKJ1N 1qzmfRnUe0awOQ366Gw5CQzFuntHlGIRh6YH6nUY/VzAv37AFZ8iDrh9W/GGe3l/G/YANt RWGqnYXSwA4TP1FhBfpSjoEVPh1jY1t6O/Z5vFNXu5ER5GQ0AmxmP+cbGMl7LzlPgXFqZg YlNPGqqwn7fWklS1nDHGrfmyIW6+5XJltf6JfyF9fHuSY+I7KSh3Y73X67QSdT04le/cuV ohBOhHSm20i/7AKHj0/ZbflLu08NIrzIyAmfvEnetPEwZe0buT5Ma+hUHLsLLw== X-Migadu-Spam-Score: -4.63 X-Migadu-Scanner: scn1.migadu.com X-Migadu-Queue-Id: E692011C20 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=rdklein.fr header.s=zoho header.b="Yne/XalB"; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; arc=pass ("zohomail.eu:s=zohoarc:i=1"); dmarc=none X-Spam-Score: -4.63 X-TUID: 4A+Xx+25wXj8 As an example in this line of thought, a long time ago I submitted a patch (since then reverted as it broke a lot of things) to use an obsolete version of a python module, which was the only one that worked with a specific module that hadn't updated its dependencies: https://git.savannah.gnu.org/cgit/guix.git/commit/?id=3D32ba87c14fd5e5b54d9= 5211cd9a159d568ce7c67 Look at the following lines: #+begin_src scheme (define-public prompt-toolkit-2-instead-of-prompt-toolkit (package-input-rewriting/spec `(("python-prompt-toolkit" . ,(const python-prompt-toolkit-2))))) #+end_src If instead of replacing "python-prompt-toolkit" with python-prompt-toolkit-2, you could replace "python" with the version of python you want to use, package-input-rewriting would then handle the work of changing the python package anywhere it appears in any dependency of your manifest. You can then end your manifest with (python-3.6-instead-of-python python-apted) Cheers, Edouard. Wojtek Kosior via writes: > [[PGP Signed Part:Undecided]] > Hi Kyle, > > Have you looked at the (package-input-rewriting) procedure described > towards the bottom of "Defining Package Variants"[1]? > > You might also like to look at the not-exported > (package-with-explicit-python) proc defined in > guix/build-system/python.scm[2]. It is used to produce python2 variants > of packages but I suppose it would also work for swapping the minor > versions of python3. > > Good luck with your task :) > > Wojtek > > [1] https://guix.gnu.org/manual/en/html_node/Defining-Package-Variants.ht= ml > [2] https://git.savannah.gnu.org/cgit/guix.git/tree/guix/build-system/pyt= hon.scm?id=3Db544f460989a6189af111bb3ff6752cabdf23abc#n82 > > -- (sig_start) > website: https://koszko.org/koszko.html > PGP: https://koszko.org/key.gpg > fingerprint: E972 7060 E3C5 637C 8A4F 4B42 4BC5 221C 5A79 FD1A > > =E2=99=A5 R29kIGlzIHRoZXJlIGFuZCBsb3ZlcyBtZQ=3D=3D | =C3=B7 c2luIHNlcGFyY= XRlZCBtZSBmcm9tIEhpbQ=3D=3D > =E2=9C=9D YnV0IEplc3VzIGRpZWQgdG8gc2F2ZSBtZQ=3D=3D | ? U2hhbGwgSSBiZWNvbW= UgSGlzIGZyaWVuZD8=3D > -- (sig_end) > > > On Fri, 17 Feb 2023 21:27:39 +0000 > Kyle Andrews wrote: > >> Dear Guix, >> >> I want to use the python-apted package in my manifest. That package is >> not in Guix, but can readily be fetched from: >> >> ``` >> guix import pypi APTED > python-apted.scm >> ``` >> >> I just had to prefix the following modules to turn that into a package >> definition as well as a manifest. >> >> ``` >> (use-modules (guix packages) >> (guix download) >> (guix licenses) >> (guix profiles) >> (gnu packages) >> (guix build-system python)) >> ``` >> >> During my original testing of my scientific workflow I discovered that >> there was a bug introduced to the APTED package which was caused by a >> change in how python worked under the hood. As a result, the APTED >> package only advertises compatibility with python versions less than >> 3.7. So, I would like to use python 3.6 to be on the safe side. >> >> I also want to include 60+ other packages in my manifest which are >> "current" with the Guix repository and included within it. For >> situations like this it would be really convenient if it were possible >> to pass a version of python to python-build-system. Then, I hope all I >> would have to do is pass another another defined variant of the python >> package (e.g. called python-3.6) into that build-system argument. >> >> For example: >> >> ``` >> (build-system python-build-system #:python python-3.6) >> ``` >> >> That would be quite convenient and in line with the level of complexity >> I was faced with when I took the conda approach before trying to use >> Guix. Unfortunately, this functionality doesn't seem to be provided out >> of box and I am seeking help in the hopes that there is an easy way to >> do it. >> >> Am I thinking about this right? >> >> Thanks, >> Kyle >> >> P.S. >> >> APTED claims to also be able to run on top of python-2.7 so maybe that >> fact could be used to simplify this specific issue. I just wanted to >> discuss the general problem first because I really want Guix to gain >> broad traction within the scientific community. >> >> P.P.S. >> >> Here is a pretend manifest where I would love guidance on how to make >> python-apted get built in the context of python-2.7 or ideally >> python-3.6 even though the latest version of python is python-3.9 (where >> APTED doesn't always work). >> >> ``` >> (use-modules (guix packages) >> (guix download) >> (guix licenses) >> (guix profiles) >> (gnu packages) >> (guix build-system python)) >> >> (define-public python-apted >> (package >> (name "python-apted") >> (version "1.0.3") >> (source (origin >> (method url-fetch) >> (uri (pypi-uri "apted" version)) >> (sha256 >> (base32 >> "1sawf6s5c64fgnliwy5w5yxliq2fc215m6alisl7yiflwa0m3ymy")))) >> (build-system python-build-system) >> (arguments '(#:tests? #f)) >> (home-page "https://github.com/JoaoFelipe/apted") >> (synopsis "APTED algorithm for the Tree Edit Distance") >> (description "APTED algorithm for the Tree Edit Distance") >> (license expat))) >> >> (concatenate-manifests >> (list (specifications->manifest (list "r" "r-dplyr" "r-reticulate")) >> (packages->manifest (list python-apted)))) >> ``` >> > > > [[End of PGP Signed Part]]