From patchwork Fri Dec 3 13:39:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 34942 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 729C727BBEA; Fri, 3 Dec 2021 13:44:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS 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 3B9CB27BBE9 for ; Fri, 3 Dec 2021 13:44:10 +0000 (GMT) Received: from localhost ([::1]:47524 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mt8rB-0003pV-Cu for patchwork@mira.cbaines.net; Fri, 03 Dec 2021 08:44:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37228) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8nC-0006JF-Ms for guix-patches@gnu.org; Fri, 03 Dec 2021 08:40:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38710) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mt8nC-0004ch-7b for guix-patches@gnu.org; Fri, 03 Dec 2021 08:40:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mt8nC-00011j-3Y for guix-patches@gnu.org; Fri, 03 Dec 2021 08:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52259] [PATCH 1/3] gnu: python-stdnum: Update to 1.17. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Dec 2021 13:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52259 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52259@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16385387683881 (code B ref -1); Fri, 03 Dec 2021 13:40:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2021 13:39:28 +0000 Received: from localhost ([127.0.0.1]:50256 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8me-00010X-33 for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:39:28 -0500 Received: from lists.gnu.org ([209.51.188.17]:39154) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8mY-00010J-Uw for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:39:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36986) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8mY-0005JU-0x for guix-patches@gnu.org; Fri, 03 Dec 2021 08:39:22 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8mR-0004Nz-C3 for guix-patches@gnu.org; Fri, 03 Dec 2021 08:39:17 -0500 Received: from hermia.goebel-consult.de ([79.211.191.200]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPSA (Nemesis) id 1N5VTm-1mUblT1k9S-01717j for ; Fri, 03 Dec 2021 14:39:05 +0100 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 3471E5F53A; Fri, 3 Dec 2021 14:39:09 +0100 (CET) From: Hartmut Goebel Date: Fri, 3 Dec 2021 14:39:02 +0100 Message-Id: <5fae975202b1a50b25270568def974822ca0ba98.1638538371.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Provags-ID: V03:K1:8ruu3Riv2Xzsi87jSQP1ceScXVJPCA7kTHSMIXswCxiZNJ3QE8e pqVUzAuCo/GAqU9hwQTyDXpjwzFg8pvAsTHNpr/y1MAKVcR8UW/MrGnWYPhxC/dA21F7NPa cLim6sqLZUcxSrCbs3brCciEPCvyy185KW46m9x5G4MK0HdCrQU4heVu0emF+CxyTwwjZNX Xxtne8EaSHlcdT9iVysZQ== X-UI-Out-Filterresults: notjunk:1;V03:K0:Z/YJZCieIiU=:h7hubmVO9HriKfiKWW8813 j3FdP7ebhJzMQ0PFVuXOVRvh7RtKqEeXQPftS9QdZE32yTNYCEa3kTQ0Zz33YERE/45lerqZr 6rjScYpBGVOGgGU/8dIEv7CWlkM2oG+TcvCJp84BDi4GnOxyp+MPHc3PEEs3eYeC3GP3+n1BB w9v/OaCngQWs4oISeyR/EYu366lrZOJVXZil1aFM6lKx/jIRkOCCLAeB17+6fDDk62bzjeX3a U7ZWH54w0ATe9FUnycvqw6EaYvQAwrO5q50maIMK66LLyCKaTuuti31/2Ok6P4xltk4UbcZxC KTtXgL1PyyVtjhHuoRZf1WUFyKKPo38NYI2UTgCI/YuDLnNfUhLVI3DPDP+orXJSPm44mpK9C fspyUBbcdSuYCTny0pXIAATPlICI/wok1oRLcPsrW04OH5Im8yQT2A8SrDuv8rPY2wykU4IMN OeRjq+3RrJg8dBDE18M5bbc8fRbQWlAwWTB3N1mDN0tq7VvPk56Df+Br2HzSXbkqhXwUFTKKC GdY2qpCX2UjvBJGu8iBQF7g9lxjsi3m6ZCuMzdPSZZN/DvU/a3nk0UxybUHA6ESeFnca1hTpY jqL6Y9v6wIPQ3X4dD2jDalvivc84abt75PH4tfPhncPL/TOIj0Bv+USoUq9gOdLQ2kq/8P3pq NfpUyd/hJJwHDe8gsfyZ6PNdGWVJOG6Xc3SJ7Z1iTQAoMxKe3xqLmDqHpLnWNUQUyOHF3Qerf mr2kYqaYlH1hUC96 Received-SPF: none client-ip=212.227.126.135; envelope-from=h.goebel@crazy-compilers.com; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/finance.scm (python-stdnum): Update to 1.17. --- gnu/packages/finance.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index 0bb9c79520..191529ce40 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -1157,13 +1157,13 @@ agent.") (define-public python-stdnum (package (name "python-stdnum") - (version "1.14") + (version "1.17") (source (origin (method url-fetch) (uri (pypi-uri "python-stdnum" version)) (sha256 - (base32 "070vd9zgvq0jchs4xc4j1h4r1l1lg4wwb8xs3p25k8c2xjw94fpx")))) + (base32 "0h4369b7gws5w5s2vhq590bk219y5k53zcmha2zwsb4i2dg2nkip")))) (build-system python-build-system) (arguments '(#:phases (modify-phases %standard-phases From patchwork Fri Dec 3 13:41:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 34943 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 9AC8927BBEA; Fri, 3 Dec 2021 13:44:45 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,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 1B74427BBE9 for ; Fri, 3 Dec 2021 13:44:45 +0000 (GMT) Received: from localhost ([::1]:50144 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mt8rk-0005cO-97 for patchwork@mira.cbaines.net; Fri, 03 Dec 2021 08:44:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8p8-0001Uj-AK for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38724) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mt8p8-0007LA-1L for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mt8p7-00016R-W4 for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52259] [PATCH 2/3] gnu: trytond: Fix import of trytond modules. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Dec 2021 13:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52259 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52259@debbugs.gnu.org X-Debbugs-Original-To: 52259@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16385388824160 (code B ref -1); Fri, 03 Dec 2021 13:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2021 13:41:22 +0000 Received: from localhost ([127.0.0.1]:50265 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8oT-000151-P0 for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:41:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:42794) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8oR-00014m-JW for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:41:19 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37554) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8oR-0007ut-BC for guix-patches@gnu.org; Fri, 03 Dec 2021 08:41:19 -0500 Received: from mout.kundenserver.de ([212.227.126.135]:50589) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8oO-0005er-5K for guix-patches@gnu.org; Fri, 03 Dec 2021 08:41:19 -0500 Received: from hermia.goebel-consult.de ([79.211.191.200]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MPGJh-1nEM1O3Mbd-00Pb1x; Fri, 03 Dec 2021 14:41:07 +0100 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 408695F53A; Fri, 3 Dec 2021 14:41:11 +0100 (CET) From: Hartmut Goebel Date: Fri, 3 Dec 2021 14:41:03 +0100 Message-Id: <3fa3f27e0f88ca1bef4639eb106e8f486b5dfcd5.1638538371.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <5fae975202b1a50b25270568def974822ca0ba98.1638538371.git.h.goebel@crazy-compilers.com> References: <5fae975202b1a50b25270568def974822ca0ba98.1638538371.git.h.goebel@crazy-compilers.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:/TPAaXjyjLVOaOMtsyWSr3KdP2eLR9YFO7Ok2lyo7dvhA7Q1yEO 93iQW9yZeef0U72B2+ZBL9R641PphyE/kSTS4qiMC8sSDKpIg+OlDgwsYu0F4PwL5itw+cp NyiLoGzAejrlS/zEt1aVVKLlnZOqlXCWP+/AXzKKOZiTcNhO27dClHn2f6kx/sKWZFDzTA1 WD+uS8XAQpbMz9y6Bsl1w== X-UI-Out-Filterresults: notjunk:1;V03:K0:EDR4Mr/SgvA=:BAthTMkaaFHx+1JjLqKxA4 PYc7zcueewb2n+uHQpxdte2WG8VoH1R7Soe6Qd9cOihU/qhppkkpg237pWnkqeVTWCCc73Zt3 d5LqzbPQQA6CQGGuqGalZyzljE0YT7tPWd10YInMY2zbRQKfFrFqHK+jk4phWGV4xc8CwB+OQ b5JqrKTQ4RQ1UA8Gk7/F2cUaA57ARZI3ADhGgRzPaM9mmRwEHvO+Tm8gkkB7sDnAKhhV7wEiS hoPe5pbnx+bzsePNh/DVziVyuDpSQf9XjeCSm+BWLX8t0RppPRlEY8hq2QhcSKDhF2KXZTFTE wyCIqBSIK7YqqkEiT6nDs0sXJUuqLp00CDIAUDe9e3dp9IvNVgus1IoHLpdS8/yaxGrbDXsdv xveU0eWxeozlI1eLw6El6YuaeYndzu4FKz4rmirdWZKdET5+LnTdZ2SWmNZRfm3t77nCXM8iC OFp28RWSz6Ejs2OW4cCOLkTaIdorFCDgIGCn9MVNcp67L691qHctbOKkTGHBZD9PrFq2KXOgy M+qRZrYg9m1VdG/cqzQQV4kjCt2c1Ywj2uMV8QsAlm2hXptYjH/3Pfz7jQ6yKRuI1Xb0DsPzx Qhrz/9jnvrauTTiaiIe92AG/8yqMLoVAKPecm5B7QAxO96wuHgKQoUtNZzGeUYvs3P6BCkZXG 0L0BqHjmNr964uKyX6yg+d10iMKrmGCliuRyA4KvIPWZW3IYmZRhhgY3Jm/mupCHKdpOgvvQf 4lT2ODSaN9ae/n2G Received-SPF: none client-ip=212.227.126.135; envelope-from=h.goebel@crazy-compilers.com; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 For adding modules, trytond uses entry-points, anyhow relying on the modules being named "trytond.modules.xxx" and being placed in the same filesystem path as "trytond.modules". The package "trytond.modules" is not a namespace module, anyhow trytond modules must be sub-modules of "trytond.modules". This works well if all packages are installed into the same filesystem path "…/trytond/modules": The Python importer will find all sub_modules at this place. Anyhow, in Guix, modules don't share the same filesystem path and the Python importer will not find them. Solution is to add all trytond module's locations to "trytond.modules._path__". This will make "trytond.module" behave much like a namespace module and the importer pick up the module. * gnu/packages/patches/trytond-add-egg-modules-to-path.patch: New file. * gnu/packages/tryton.scm (trytond): Use it. * gnu/local.mk (dist_patch_DATA): Add it --- gnu/local.mk | 1 + .../trytond-add-egg-modules-to-path.patch | 22 +++++++++++++++++++ gnu/packages/tryton.scm | 3 ++- 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/trytond-add-egg-modules-to-path.patch diff --git a/gnu/local.mk b/gnu/local.mk index 604c6cf151..a8b9bcac21 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1816,6 +1816,7 @@ dist_patch_DATA = \ %D%/packages/patches/tor-sandbox-i686.patch \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ + %D%/packages/patches/trytond-add-egg-modules-to-path.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/tup-unbundle-dependencies.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ diff --git a/gnu/packages/patches/trytond-add-egg-modules-to-path.patch b/gnu/packages/patches/trytond-add-egg-modules-to-path.patch new file mode 100644 index 0000000000..1baccfee1c --- /dev/null +++ b/gnu/packages/patches/trytond-add-egg-modules-to-path.patch @@ -0,0 +1,22 @@ +Work around trytond.module not being a real namespace module. + +Solution is to add all trytond module's locations to +trytond.modules._path__. This will make trytond.module behave much +like a namespace module. +Adding to __path__ is done in update_egg_modules() to ensure __path__ +is updated whenever the list of egg modules is updated. + +*** a/trytond/modules/__init__.py 1970-01-01 01:00:01.000000000 +0100 +--- b/trytond/modules/__init__.py 2021-12-02 18:12:15.385101986 +0100 +*************** +*** 38,43 **** +--- 38,46 ---- + import pkg_resources + for ep in pkg_resources.iter_entry_points('trytond.modules'): + EGG_MODULES[ep.name] = ep ++ path = os.path.join(ep.dist.location, 'trytond', 'modules') ++ if not path in __path__ and os.path.isdir(path): ++ __path__.append(path) + except ImportError: + pass + diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm index 0ac0a5a5cd..212d6593ad 100644 --- a/gnu/packages/tryton.scm +++ b/gnu/packages/tryton.scm @@ -48,7 +48,8 @@ (method url-fetch) (uri (pypi-uri "trytond" version)) (sha256 - (base32 "1jp5cadqpwkcnml8r1hj6aak5kc8an2d5ai62p96x77nn0dp3ny4")))) + (base32 "1jp5cadqpwkcnml8r1hj6aak5kc8an2d5ai62p96x77nn0dp3ny4")) + (patches (search-patches "trytond-add-egg-modules-to-path.patch")))) (build-system python-build-system) (propagated-inputs `(("python-dateutil" ,python-dateutil) From patchwork Fri Dec 3 13:41:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 34941 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 CB40B27BBEA; Fri, 3 Dec 2021 13:42:54 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,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 3622B27BBE9 for ; Fri, 3 Dec 2021 13:42:54 +0000 (GMT) Received: from localhost ([::1]:45940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mt8px-0002kA-3c for patchwork@mira.cbaines.net; Fri, 03 Dec 2021 08:42:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37828) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8p8-0001W1-NG for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:38725) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mt8p8-0007LG-FC for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mt8p8-00016Z-DU for guix-patches@gnu.org; Fri, 03 Dec 2021 08:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52259] [PATCH 3/3] gnu: trytond: Ensure all modules are found. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 03 Dec 2021 13:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52259 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52259@debbugs.gnu.org X-Debbugs-Original-To: 52259@debbugs.gnu.org, guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16385388864185 (code B ref -1); Fri, 03 Dec 2021 13:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Dec 2021 13:41:26 +0000 Received: from localhost ([127.0.0.1]:50270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8oX-00015R-TV for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:41:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:43090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mt8oW-00015E-HW for submit@debbugs.gnu.org; Fri, 03 Dec 2021 08:41:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:37596) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8oW-00087O-9t for guix-patches@gnu.org; Fri, 03 Dec 2021 08:41:24 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:51429) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mt8oU-0005vZ-7h for guix-patches@gnu.org; Fri, 03 Dec 2021 08:41:24 -0500 Received: from hermia.goebel-consult.de ([79.211.191.200]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1N1xZX-1mR3Ed3Ain-012Doc; Fri, 03 Dec 2021 14:41:10 +0100 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 5FAE766096; Fri, 3 Dec 2021 14:41:11 +0100 (CET) From: Hartmut Goebel Date: Fri, 3 Dec 2021 14:41:04 +0100 Message-Id: <0d461f73e5c687d1c53df55540d3248b38349414.1638538371.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <5fae975202b1a50b25270568def974822ca0ba98.1638538371.git.h.goebel@crazy-compilers.com> References: <5fae975202b1a50b25270568def974822ca0ba98.1638538371.git.h.goebel@crazy-compilers.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:fbYBNL+a6+IjFVq/0+JbvHgovANGJ4fW/wkh55TfQ8unVFhCrkc knUPi6xtOfIlp5DRSlnRqmbx6uyd6gmRqdhYl+b0834bs3HlRa90u+aJP666yKJCORcDrz9 +sxDdgg4mGhlMLcE97Cb6OyMeKtGdK9gPuu9qeYNv0lpzFpICraAmogiUx5qwT2MuD7U+WE 9594dzKeZREOFmUASFaOw== X-UI-Out-Filterresults: notjunk:1;V03:K0:2IRbRwI5qkw=:wm4q1ZSqdMz34hGS0oGhjw ZAGZabJNvHOUTHmdE5OzKFT+hQSOwtx4Z4ZtALrTsX/Q98l10A1mPPEiKgEBpgLAZ4zV8Spe1 MXhaIaVoFQwGSMRqDakETn04UAGadnAFq0z5Y6mwxwyq49hMzVf/5b4oAvtEBl3b8XN7yvmB3 1Ln3ADnhXO9TxWcdkCJ1P4xeti9qPoiUXx9LUGPdP5VtpNLmOriEuwsgIbMn3GPhApx4OTC9c WwOgxxyu4FHY88AbbWV4J/RbasaA2WwPJJsBCj0tIByb6NJPzTiDgFITvqsxWz0bV812I4a/o rAHWogbf1WIthuDnAFH37hFSAs24GPXYhM9C2yu4OQD1z1rmB1UeV83o317xk9obK1muMgGn/ MVgAJOqHrFBXFY6z0SNjU/ejjcXlz+bdXJ56okfNmOJ83KhecswOu97LM2lSpvQtyfbceVKJo IIV4LC7bVUH3l+km7qBqQL8HSP5Al1i1e38tw6a6DztturJGNZ2mQOLyRpQ6gMqcu3J530K0z rrjahwNSiogHlVqjq2UZqVI3xfwlXngmItGrPtJuuvWA5fEu1FRm5e6tSK9VCKkOUkty6k2B/ oNTOVEuJEbz9idFHbsH6bM3WOgoLvKTNI3Ej7X/6j4v2BD3DLur4xXRxbFKit4bJ+yrT7+F0y l+5C7NsWH2J4yrgbElH45Uiv4wb1o5ReYzp12GUb4lx/CY484nSWUPGPQ2GGBQImFyakxVpSx 9YaJXkMBP+RAVje2 Received-SPF: none client-ip=217.72.192.75; envelope-from=h.goebel@crazy-compilers.com; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 If the python package matching tryton is not installed alongside to trytond, PYTHONPATH ist not set (or pointing to a wring version) and trytond (and the trytond tools) would not find the trytond modules. This change introduces a new native-search-path GUIX_TRYTOND_MODULES_PATH. Trytond gets patched to honor this environment variable. Thanks to Maxim Cournoyer, who's code for guix-pythonpath-search-path was the template for guix-trytonpath-search-path. * gnu/packages/patches/trytond-add-guix_trytond_path.patch: New file. * gnu/local.mk: (dist_patch_DATA): Add it. * gnu/packages/tryton.scm (trytond): Use it. [native-search-paths]: New element. (guix-trytonpath-search-path): New function. --- gnu/local.mk | 1 + .../trytond-add-guix_trytond_path.patch | 26 +++++++++++++++++++ gnu/packages/tryton.scm | 19 +++++++++++++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/trytond-add-guix_trytond_path.patch diff --git a/gnu/local.mk b/gnu/local.mk index a8b9bcac21..cac9079325 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1817,6 +1817,7 @@ dist_patch_DATA = \ %D%/packages/patches/transcode-ffmpeg.patch \ %D%/packages/patches/transmission-honor-localedir.patch \ %D%/packages/patches/trytond-add-egg-modules-to-path.patch \ + %D%/packages/patches/trytond-add-guix_trytond_path.patch \ %D%/packages/patches/ttf2eot-cstddef.patch \ %D%/packages/patches/tup-unbundle-dependencies.patch \ %D%/packages/patches/tuxpaint-stamps-path.patch \ diff --git a/gnu/packages/patches/trytond-add-guix_trytond_path.patch b/gnu/packages/patches/trytond-add-guix_trytond_path.patch new file mode 100644 index 0000000000..7dc136ec46 --- /dev/null +++ b/gnu/packages/patches/trytond-add-guix_trytond_path.patch @@ -0,0 +1,26 @@ +Make trytond add all paths listed in GUIX_TRYTOND_MODULES_PATH to sys.path. + +*** a/trytond/modules/__init__.py 1970-01-01 01:00:01.000000000 +0100 +--- b/trytond/modules/__init__.py 2021-12-02 22:17:28.014612267 +0100 +*************** +*** 31,36 **** +--- 31,48 ---- + + EGG_MODULES = {} + ++ def __extend_python_path__(): ++ tryton_python_path = os.environ.get("GUIX_TRYTOND_MODULES_PATH") ++ if tryton_python_path: ++ paths = [path[:-16] # remove "/trytond/modules" ++ for path in tryton_python_path.split(os.pathsep)] ++ sys.path.extend(paths) ++ # ensure new paths are in the pkg_resources WorkingSet ++ import pkg_resources ++ list(map(pkg_resources.working_set.add_entry, paths)) ++ ++ __extend_python_path__() ++ + + def update_egg_modules(): + global EGG_MODULES +l diff --git a/gnu/packages/tryton.scm b/gnu/packages/tryton.scm index 212d6593ad..f8cd2b4c9d 100644 --- a/gnu/packages/tryton.scm +++ b/gnu/packages/tryton.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2020 Vinicius Monego ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 Hartmut Goebel +;;; Copyright © 2021 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -39,6 +40,19 @@ #:use-module (guix utils) #:use-module (guix build-system python)) +(define (guix-trytonpath-search-path version) + "Generate a GUIX_TRYTOND_MODULES_PATH search path specification, using +VERSION. + +Do not use PYTHHONPATH not avoid interfering with any different Python package +installed in the same environments. Collecting only paths actually containing +/tryton/modules reduces the number of paths." + (search-path-specification (variable "GUIX_TRYTOND_MODULES_PATH") + (files (list (string-append + "lib/python" + (version-major+minor version) + "/site-packages/trytond/modules"))))) + (define-public trytond (package (name "trytond") @@ -49,7 +63,8 @@ (uri (pypi-uri "trytond" version)) (sha256 (base32 "1jp5cadqpwkcnml8r1hj6aak5kc8an2d5ai62p96x77nn0dp3ny4")) - (patches (search-patches "trytond-add-egg-modules-to-path.patch")))) + (patches (search-patches "trytond-add-egg-modules-to-path.patch" + "trytond-add-guix_trytond_path.patch")))) (build-system python-build-system) (propagated-inputs `(("python-dateutil" ,python-dateutil) @@ -66,6 +81,8 @@ (native-inputs `(("python-mock" ,python-mock) ("python-pillow" ,python-pillow))) + (native-search-paths + (list (guix-trytonpath-search-path (package-version python)))) (arguments `(#:phases (modify-phases %standard-phases