From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QKOyMvruSGFiawEAgWs5BA (envelope-from ) for ; Mon, 20 Sep 2021 22:28:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KDxKLvruSGF2FAAAB5/wlQ (envelope-from ) for ; Mon, 20 Sep 2021 20:28:42 +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 aspmx1.migadu.com (Postfix) with ESMTPS id 832B6F55F for ; Mon, 20 Sep 2021 22:28:41 +0200 (CEST) Received: from localhost ([::1]:56440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSPu4-0006KE-Jq for larch@yhetil.org; Mon, 20 Sep 2021 16:28:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSPtr-0006K0-9r for guix-devel@gnu.org; Mon, 20 Sep 2021 16:28:27 -0400 Received: from mail-ed1-x52a.google.com ([2a00:1450:4864:20::52a]:46668) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSPtp-0007sX-E1 for guix-devel@gnu.org; Mon, 20 Sep 2021 16:28:27 -0400 Received: by mail-ed1-x52a.google.com with SMTP id j13so65870475edv.13 for ; Mon, 20 Sep 2021 13:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GpS9QWtsY9BYtvmlLUwA0adkKI2ap0c2mU2JSXxrxvw=; b=FiaqdYZtu6zD7iTDt0HjQUX6421VCe1Xtfig37wyxImvbjOOiXMbP57t+lj8O1nJOM w/fumgoeiY2kuWToTolqpupa25GebNPotJpXGK8yrDwjy28X2wp3Pwb6ZkxaSpJcLkuP JnI+Ulb8McZUwqzyv9zszfawovmxwVZypa+E6HHD0KJu5Mi5uGXXq0Ih0P6uEF1VwBtz jgm2YGJ2x3CJF3SPrZIzOZckpNootz1j3T5ruqIzzEwrqzZ0RONDJmPwFQOMQ1IJq7rX 3ZuqPYPOQeljzTSmn7dEqam1vxOYBN5gLZBfkaS/HOFfcvS6wsdPoHNz/7/v2SozcFi0 mCKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GpS9QWtsY9BYtvmlLUwA0adkKI2ap0c2mU2JSXxrxvw=; b=gChSLaRgJRedpCB7m9005ICegMMyrLtsX/ucGaJxPRqQ/Rh8G6FwtvHcc/9CCksrao 8f14ob/BxIxiv95ig8quO3yEE1xdK6+GB9Wfacu7U+UYLHldz0aMs3UT9tSBsOHwfI84 YQ6rlXkxW7fuQ7ZwvipMMBcnPzPQIgMpspkAzxld6Md1kWlHo6ybMPs9QlQeYKuJaQjV oyTQANmHkbc0RYhaTlNoJg5DhYxhEnnBGoNkMnwyJ2Babk1JmFQmEIMIusdwEhA0JQt9 tzb1gPjCDBLYV1rTzHJQDB2kLoE2NxSvrr3e895JFOeavjwXD3iWe/Cpzp1PgsioOnbh 0NKA== X-Gm-Message-State: AOAM531NeDi9/81M7JiRFiJrBMjWpXGrPchkbWj7K2u+KhYP6Dz4d94Z ajvmMRDdNG5BhLm/kl1Z4k7z8q8fKyYaqYCW7k2dHqLnbrRiQw== X-Google-Smtp-Source: ABdhPJyLGP/ab1TlUcD3t1U36CoEVZxn8QPZt5oaa7cMTMsOJgPY6yeXNQIfgALyKvf5sQ53rJZo0h07ARvasmMWCHk= X-Received: by 2002:a05:6402:6d6:: with SMTP id n22mr24181446edy.257.1632169703820; Mon, 20 Sep 2021 13:28:23 -0700 (PDT) MIME-Version: 1.0 References: <1621bc1d-a291-e2dd-c598-0367d7c47edd@crazy-compilers.com> In-Reply-To: <1621bc1d-a291-e2dd-c598-0367d7c47edd@crazy-compilers.com> From: Antwane Mason Date: Mon, 20 Sep 2021 16:28:12 -0400 Message-ID: Subject: Re: Python Site Package Syntax Runtime Error To: Hartmut Goebel Content-Type: multipart/alternative; boundary="00000000000068d06c05cc731f75" Received-SPF: pass client-ip=2a00:1450:4864:20::52a; envelope-from=ad.mason1413@gmail.com; helo=mail-ed1-x52a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=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=1632169722; 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=GpS9QWtsY9BYtvmlLUwA0adkKI2ap0c2mU2JSXxrxvw=; b=CPeSaxV92/g4Y/dAw2fb105K+Dqz575Y++eWUz48FegYROWiV2msfa+r3SgxzaJz14spM+ tzciQH3IxmvMkMBf2Jg0tKr6+GeXHeKZ2+/MSEH17e2i5a9+euFlpI3jrRr0mHaZtJpc7y pJbOM6WYpDD+dlNxKnTuYHJOrlIE/s0EZoEUiqR+YaK3EAUDoFs2jVlEOd/Xb7FpAmsbsv Uyrv5ARDItwaXlymfoNTdzXZoUOpNnmfNijngTp3Pl8XeNKWA0AwENuuIQyBYuJLrRxFLF mq3np6djRzCfFnM0ZcNzboakoS8vH+9x/UQBsLGtcQ+qnxTEhCUsSR2xCsWCCA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1632169722; a=rsa-sha256; cv=none; b=Uq3rA5uR+CKh5js6dWaLUGAvQT+Ybgv+cf1A5L7YBaw8Iyfw2oj1PxzdO5F2orPWfz5sPu feKW73uTghAVOMZ5q1MqXV6UAyriiF7dT1gKxN3g12dpfnwVEDj2TJRQdJQXmCti3vbm+e kGe7tkQ1jlZzZIv2Q/TU4NSNQWtAb47SowNHh5vpDD4E6dw+qd8VElzbYP7HrOEBhGw6li gmMtXJ6NXJcROxnJIdkIa4fWFIjK7nGvgavcN9/Z7CNygYyA4uKov5+p3kuRyIBOcXrG55 b7v6jjZfovs7qs7nO+/kFlI+7EV0XlM3sat7bJjcyXMVpzacSfcEW0K0p/5CUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FiaqdYZt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.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: -3.09 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FiaqdYZt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.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: 832B6F55F X-Spam-Score: -3.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: lFT3k/+rFtI/ --00000000000068d06c05cc731f75 Content-Type: text/plain; charset="UTF-8" On Mon, Sep 20, 2021 at 8:32 AM Hartmut Goebel wrote: > Looking at the code of the package - which actually is quite simple - I > discover > > scripts=['onlykey_agent.py'], > > This might indeed trigger some issue in phase wrap. Please open a > bug-report for this, explicitly pointing to release v1.1.11 of that package. > > As a solution for you I propose replacing the aforementioned line in > setup.py by this line: > > py_modules=['onlykey_agent'], > > I also suggest reporting this upstream, since I assume having onlykey_agent.py > in bin is not desired. (Actually this is not a working script at all.) > > Thank you for the suggestion! Taking your advice, I ended up with the following snippet which ends up being simpler than overwriting the wrap phase. The main parts added are the modules field and snippet field; I simply added the whole source field so it is clear where those two fields go within the package definition. --8<---------------cut here---------------start------------->8--- (source (origin (method url-fetch) (uri (pypi-uri "onlykey-agent" version)) (sha256 (base32 "1586zhpph79s12alnyj1iiiwj0c5h1z8na2lqczf560p5mca6gxw")) (modules '((guix build utils))) (snippet '(begin (substitute* "setup.py" (("scripts=\\['onlykey_agent.py'\\]") "py_modules=['onlykey_agent']")) #t)))) --8<---------------cut here---------------end--------------->8--- After reinstalling onlykey-agent with the above change, I got the following runtime error when running onlykey-gpg init "Firstname Lastname < test@gmail.com>". --8<---------------cut here---------------start------------->8--- Traceback (most recent call last): File "/gnu/store/rg6jn2bhrgmfhbkiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/bin/.onlykey-gpg-real", line 11, in load_entry_point('onlykey-agent==1.1.12', 'console_scripts', 'onlykey-gpg')() File "/gnu/store/rg6jn2bhrgmfhbkiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/lib/python3.8/site-packages/onlykey_agent.py", line 6, in gpg_tool = lambda: libagent.gpg.main(DeviceType) File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/gpg/__init__.py", line 381, in main return args.func(device_type=device_type, args=args) File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/gpg/__init__.py", line 154, in run_init agent_path = util.which('{}-gpg-agent'.format(device_name)) File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/util.py", line 212, in wrapper result = func(*args, **kwargs) File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/util.py", line 248, in which raise OSError('Cannot find {!r} in $PATH'.format(cmd)) OSError: Cannot find '.onlykey-gpg-gpg-agent' in $PATH --8<---------------cut here---------------end--------------->8--- >From what I can tell, the issue is that the inherited __str__ for Onlykey class uses __name__ which resolves to '.onlykey-gpg'. This results in trying to get the full path for '.onlykey-gpg-gpg-agent' which doesn't exist. I think it should be instead trying to get the path of 'onlykey-gpg-agent'. I plan on trying to patch lib-agent to define a __str__ method that returns 'onlykey' for Onlykey class. I'm hoping that will fix the issue. At the end of this, I plan to submit a bug report as you suggested. --00000000000068d06c05cc731f75 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Mon, Sep 20, 2021= at 8:32 AM Hartmut Goebel <h.goebel@crazy-compilers.com> wrote:
=20 =20 =20
Looking at the code of the package - which actually is quite simple - I discover
=20

scripts=3D['onlykey_agent.py&= #39;],

This might indeed trigger some issue in phase wrap. Please open a bug-report for this, explicitly pointing to release v1.1.11 of that package.

As a solution for you I propose replacing the aforementioned line in setup.py by this line:

=C2=A0=C2=A0=C2=A0 py_modules=3D['onlykey_agent'],

I also suggest reporting this upstream, since I assume having = onlykey_agent.py in bin is not desired. (Actually this is not a working script at all.)

Thank you for the sugges= tion!=C2=A0 Taking your advice, I ended up with the following snippet which= ends up being simpler than overwriting the wrap phase.
The = main parts added are the modules field and snippet field; I simply added th= e whole source field so it is clear where those two fields go within the pa= ckage definition.

--8= <---------------cut here---------------start------------->8---=
(source
=C2=A0 =C2=A0 =C2=A0 (origin=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (method url-fetch)
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 (uri (pypi-uri "onlykey-agent" version))
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 (sha256
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (base32
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "1586zhpph79s12alnyj1iiiwj0c5h1= z8na2lqczf560p5mca6gxw"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (modules '= ;((guix build utils)))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 (snippet
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0'(begin (substitute* "setup.py"=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0((&qu= ot;scripts=3D\\['onlykey_agent.py'\\]")
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 "py_modules=3D[&#= 39;onlykey_agent']"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0#t))))
--8<---------------cut here---------------end-------= -------->8---

After reinstalling onlykey-age= nt with the above change, I got the following runtime error when running on= lykey-gpg init "Firstname Lastname <test@gmail.com>".

--8<---------------cut here---------------start------------->= 8---
Traceback (most recent call last):
=C2=A0 File &qu= ot;/gnu/store/rg6jn2bhrgmfhbkiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/= bin/.onlykey-gpg-real", line 11, in <module>
=C2=A0 =C2=A0 lo= ad_entry_point('onlykey-agent=3D=3D1.1.12', 'console_scripts= 9;, 'onlykey-gpg')()
=C2=A0 File "/gnu/store/rg6jn2bhrgmfhb= kiprsjp3rc5gxi55lp-python-onlykey-agent-1.1.12/lib/python3.8/site-packages/= onlykey_agent.py", line 6, in <lambda>
=C2=A0 =C2=A0 gpg_tool= =3D lambda: libagent.gpg.main(DeviceType)
=C2=A0 File "/gnu/store/= ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/python3.8/site-= packages/libagent/gpg/__init__.py", line 381, in main
=C2=A0 =C2=A0= return args.func(device_type=3Ddevice_type, args=3Dargs)
=C2=A0 File &q= uot;/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-lib-agent-1.0.3/lib/= python3.8/site-packages/libagent/gpg/__init__.py", line 154, in run_in= it
=C2=A0 =C2=A0 agent_path =3D util.which('{}-gpg-agent'.format= (device_name))
=C2=A0 File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgk= m13c-python-lib-agent-1.0.3/lib/python3.8/site-packages/libagent/util.py&qu= ot;, line 212, in wrapper
=C2=A0 =C2=A0 result =3D func(*args, **kwargs)=
=C2=A0 File "/gnu/store/ahbp2qnrx7m6m5yrxcfsf37gqmgkm13c-python-li= b-agent-1.0.3/lib/python3.8/site-packages/libagent/util.py", line 248,= in which
=C2=A0 =C2=A0 raise OSError('Cannot find {!r} in $PATH'= ;.format(cmd))
OSError: Cannot find '.onlykey-gpg-gpg-agent' in = $PATH
--8<--= -------------cut here---------------end--------------->8---

From what= I can tell, the issue is that the inherited __str__ for Onlykey class uses= __name__ which resolves to '.onlykey-gpg'. This results in trying = to get the full path for
'.onlykey-gpg-gpg-agent' which doesn&#= 39;t exist. I think it should be instead trying to get the path of 'onl= ykey-gpg-agent'. I plan on trying to patch lib-agent to define a __str_= _ method that returns 'onlykey' for Onlykey class.
I'm hoping th= at will fix the issue.

At the end of this, I plan to submit a bug r= eport as you suggested.

--00000000000068d06c05cc731f75--