From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IPUzILpfTWC5WAAA0tVLHw (envelope-from ) for ; Sun, 14 Mar 2021 00:58:34 +0000 Received: from aspmx2.migadu.com ([2001:41d0:2:c151::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YPzSG7pfTWBPKAAAbx9fmQ (envelope-from ) for ; Sun, 14 Mar 2021 00:58:34 +0000 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 aspmx2.migadu.com (Postfix) with ESMTPS id 17AA6ABF9 for ; Sun, 14 Mar 2021 01:58:34 +0100 (CET) Received: from localhost ([::1]:45760 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lLF5V-0003fY-8W for larch@yhetil.org; Sat, 13 Mar 2021 19:58:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36580) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lLF5N-0003fS-Jk for guix-devel@gnu.org; Sat, 13 Mar 2021 19:58:25 -0500 Received: from mail-qk1-x72f.google.com ([2607:f8b0:4864:20::72f]:40654) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lLF5L-0004P8-TB; Sat, 13 Mar 2021 19:58:25 -0500 Received: by mail-qk1-x72f.google.com with SMTP id l132so28393276qke.7; Sat, 13 Mar 2021 16:58:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=g3oZM6ADVapdySCB6TWRUYAPcjWBVcypioh0rXtMUM8=; b=k3NXKaIhMWWQgUOv7HSS5a9wa+GUx3VHSHsTSMfG19FCDZ4McPGGhuhpRfHw6l8aZF bOJ7aC0Hbwgd/GbmDUPvvrJI6BEHveeLstzIw7rBlt85dF43zJI6IGyxLdUhAxbNnN15 B6KS3gqVC4NA7zjxpLKa7SwaNrp8LPniurxuyZfOK0KKTJLmOKXzn33dxGH2J0RysL/M GaDpuiH9Ak40UWygejrOiYgzOapHLlH2IGD5ntBsHui4ek+KE6triAzn39we1wiDSJ7F qy1njng9zQkK2e8F4LUFu99CIkxQva/xJgyoa1eW50REERZF6FjqOCcXZh8S7ohYA+1W KuiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=g3oZM6ADVapdySCB6TWRUYAPcjWBVcypioh0rXtMUM8=; b=Vx/BajjK7NgUj+VSuswk6q/AmkPTzhKgLIonXDNDc+QcKcIkw/pE8Uuw9mNDZxwz2H DuMoe4HJ++7qM+x2fDk7dGcL8dalJQnM7OC+YxZvTStRXdzJ0nIdUw0e5cCvPg3RCB6C fNFYhkmO4pN327GtB0Zm1LvzzdPuZAUoZfKmpWxIn+zBAoJTYlVncxMKYQG/HRPpCkyk jqTNPl7BJiQhVVNJvnHzN1MXZvFLcxmNHRjmGSHUE67L6Y14NWE9mJR70B2vQv4GdFa9 qWfGC1wRFilFY1o+TP9oICPpO+3DIxgi3LXJsJVwmvUl8MPCPaRo/G9AeXVl5+j39bwV Jsow== X-Gm-Message-State: AOAM533jW3KkLMhCHF7Nq/2tbfIPlGsP0znDVmkGlqfEdVSfJqzKbwRI IWpDrOF5AfTwzPzIlKiIucbjzCmQpnLzug== X-Google-Smtp-Source: ABdhPJwn8X6gWIsl72HNW0R4YrCbkydiok17fLaA9Ecxo5RtnAp/G4X1QoVnplXSvyM3StKPvMa+sg== X-Received: by 2002:a05:620a:205e:: with SMTP id d30mr18549007qka.380.1615683501541; Sat, 13 Mar 2021 16:58:21 -0800 (PST) Received: from hurd (dsl-151-123.b2b2c.ca. [66.158.151.123]) by smtp.gmail.com with ESMTPSA id d2sm7935796qkk.42.2021.03.13.16.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Mar 2021 16:58:20 -0800 (PST) From: Maxim Cournoyer To: Hartmut Goebel Subject: Re: 03/163: build/python: Add a new guix-pythonpath procedure. References: <20210125070022.22870.17321@vcs0.savannah.gnu.org> <20210125070114.03C0B20E1C@vcs0.savannah.gnu.org> <87czxs3d1i.fsf@gnu.org> <878s8g3bxa.fsf@gmail.com> <87lfcdm9jb.fsf@gnu.org> <87im7fyg5c.fsf@gmail.com> <871rd296yo.fsf@gmail.com> <3c1b9db7-e849-a863-b6e3-a40c12702389@crazy-compilers.com> Date: Sat, 13 Mar 2021 19:58:19 -0500 In-Reply-To: <3c1b9db7-e849-a863-b6e3-a40c12702389@crazy-compilers.com> (Hartmut Goebel's message of "Sun, 7 Mar 2021 12:13:32 +0100") Message-ID: <87lfaqtutw.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::72f; envelope-from=maxim.cournoyer@gmail.com; helo=mail-qk1-x72f.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615683514; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=g3oZM6ADVapdySCB6TWRUYAPcjWBVcypioh0rXtMUM8=; b=XUnx63bn0Vxrmfn8+sZ1+QlS+GB1WvT+KD+iIkriFOBj90cvIntarYa43q6Tv40MdKtH2u sjySQ2j6/wYaR0hTaHGgSOsBNU8Ix5Bzc/nIj2cj8Q0U5p2+p+GY4wzg4s2xUyu2NVttu5 K4FdaT+UnfA2bRIN8Eg9DP3ouWSbu8TcA1zVbDSzy7rjmGEBpD3QaZFswDZ6UxZU3+OFbt SRNIphKDNVMJ9UzrCmv1y4ad+sWTDaGtPkFdFlLZKUY1YC3cNfzs9So0JpBd0FZwZE+hxv sVZrrPT1kvE1rtSwHfNPpuEEclKACZWF5djuBbHx5YkhVbbZ0GcCR+H3Jj8Ojw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615683514; a=rsa-sha256; cv=none; b=JKczb1TWr5GCIP8WXE4N5j8FKzbKRs7yeCFejdvNHF0zirHp8slBtEgAXSAzVQ5UXAT8x4 8b0gl7/tr34XvySSpnFiwZ62epAdAqwylLjpP/TO/HsNWO3Nu87WA2qEhXLwwTyUXDoW4r 6UeRV9kNSN9Nycf7Moki08aiaCmMt7jRMuCzoQ3zkHkNzN3DBBz/rat5xvSrSjL5wZ8abx 7RWgzVKQ2CVFqvwjg2Ic7cj+qPcs0aDi21u6opFULCEkotCVi9NNwyfKMzNDnWVHFaTQ0N FiM3PkDMbaJ+AYkHexEKMkrnL9mPTalDpZ7iVJ6Zo8JyiPS0U8yTmuuH8KdcaA== ARC-Authentication-Results: i=1; aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=k3NXKaIh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -1.30 Authentication-Results: aspmx2.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20161025 header.b=k3NXKaIh; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx2.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 17AA6ABF9 X-Spam-Score: -1.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: fY9lRtAcvw+8 Hi Harmut! Hartmut Goebel writes: > Hi schrieb Maxim, >> Sorry for the delay. > > No problem, I reward this with another delay ;-) (Just kidding ;-) > > >> Hartmut Goebel writes: >> >>> 2) This does not remove duplicates and does not honor .pth files in >>> the respective directories - which might still be used. Thus >>> site.addsitedir() should be called for adding the paths. This also >>> takes care about duplicates. >> I confess I didn't pay attention to .pth files, which mostly seemed like >> legacy cruft to me; are they still used in the context of PEP 517 and >> modern Python packaging? > > I can't tell for sure. (I rinember to have seen a note about .pth still > being used in some setuptool-tick, but can't find it now.) Anyhow, since > site.py still supports it, I would prefer to be on the save side and > support it, to. > >> The problem with calling site.addsitedir is >> that it simply appends to sys.path. We want to splice in the content of >> GUIX_PYTHONPATH at a controlled location. > > site.addsitedir takes an option second arguments where the paths are > collected into. > > >>> 4) Since PYTHONPATH is evaluated prior to importing sitecustomize, any >>> sitecustominze.py in the user's path will overwrite our file, thus >>> inhibiting our paths to be added. Not sure this is what we want in Guix. >> I asked guidance on the #python channel on freenode and was recommended >> to use sitecustomize.py for this purpose; reading the doc here seems to >> confirm our usage of it is as intended [0]: > > IC. > > >>> 6) Please add some more comments to the code explaining the idea. >> I was under the impression the code was concise enough to forego with >> verbose explanations; I'd rather keep it this way. > > Please add some comments. I had a hard time understanding it - and I was > not even sure I understood, see my question (1). I'm spread thin right now, so if you could prepare a patch addressing the above for me to review, that'd be much appreciated. Otherwise I'll get to it, but it won't be before some time. > Another point, which came into my mind just now: Do virtuall > environments still work as expected? (With --system-site-packages, > packages in the profile are available, but venv-packages overwrite. > Without ----system-site-packages packages in the profile are *not* > available.) Yes! This was the main motivation behind this change. Thank you, Maxim