unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxime Devos <maximedevos@telenet.be>
To: Antwane Mason <ad.mason1413@gmail.com>, guix-devel@gnu.org
Subject: Re: Python Site Package Syntax Runtime Error
Date: Sun, 19 Sep 2021 19:59:33 +0200	[thread overview]
Message-ID: <ca4b06993eb01c3205b3306b11d3f70cfc8f5207.camel@telenet.be> (raw)
In-Reply-To: <CAAztfgJDJ7oh-v=FNRs9iEh9Xkg=EMm9S+Z7cDytNBq6wS9A=A@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

Antwane Mason schreef op di 07-09-2021 om 13:39 [-0400]:
> Has anyone come across the following runtime error when running a python-based
> application in guix? I'm wondering if something went wrong during the package build
>  for python-onlykey-agent that messed up the PYTHONPATH export for the runtime.  I should
>  note that python-onlykey-agent is a program that I have packaged to eventually submit to guix.
> 
> --8<---------------cut here---------------start------------->8---
> export PYTHONPATH="...:/gnu/store/wand0zrwwnds6x636746116cfh3sy50k-python-pyopenssl-20.0.0/lib/python3.8/site-packages${PYTHONPATH:+:}$PYTHONPATH"
> 
> SyntaxError: invalid syntax
> --8<---------------cut here---------------end--------------->8---
> Here is the entire stack trace for reference.
> 
> --8<---------------cut here---------------start------------->8---
> antwane@wmguix ~$ onlykey-agent git@github.com
> Traceback (most recent call last):
>   File "/gnu/store/s2w1lq80x9vcwp5382kn98f5pi2k4b7b-python-onlykey-agent-1.1.12/bin/.onlykey-agent-real", line 11, in <module>
>     load_entry_point('onlykey-agent==1.1.12', 'console_scripts', 'onlykey-agent')()
>   File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
>     return get_distribution(dist).load_entry_point(group, name)
>   File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
>     return ep.load()
>   File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2443, in load
>     return self.resolve()
>   File "/gnu/store/sd2ic7bpv8fx3imy1j8xcjclx71sv6q0-python-3.8.2/lib/python3.8/site-packages/pkg_resources/__init__.py", line 2449, in resolve
>     module = __import__(self.module_name, fromlist=['__name__'], level=0)
>   File "/gnu/store/s2w1lq80x9vcwp5382kn98f5pi2k4b7b-python-onlykey-agent-1.1.12/bin/onlykey_agent.py", line 2

Why is "onlykey_agent.py" in "bin"?  If it is not a stand-alone library,
shouldn't it be in "share" or "lib"?

Anyway, to prevent onlykey_agent.py from being wrapped, you can replace
the 'wrap' phase with a custom 'wrap' phase adjusted for onlykey-agent pecularities:

(package
  (name "python-onlykey-agent")
  ...
  (arguments
    `(#:phases
      (modify-phases %standard-phases
        (replace 'wrap
          (lambda* (#:key outputs #:allow-other-keys)
            (define bin (string-append (assoc-ref outputs "out") "/bin")
            ;; Replace ??? with something appropriate for onlykey-agent 
            (wrap-program (string-append bin "/onlykey-agent)
               `("PYTHONPATH" '??? '???))
            'maybe-wrap-other-things
            '???))))))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  parent reply	other threads:[~2021-09-19 18:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 17:39 Python Site Package Syntax Runtime Error Antwane Mason
2021-09-16 12:06 ` Hartmut Goebel
2021-09-18 19:44   ` Antwane Mason
2021-09-19 16:31     ` Antwane Mason
2021-09-20 12:32     ` Hartmut Goebel
2021-09-20 20:28       ` Antwane Mason
2021-09-20 20:45         ` Hartmut Goebel
2021-09-19 17:59 ` Maxime Devos [this message]
     [not found]   ` <CAAztfgL+ZmbupibJtAeEQLdLoPwR=BNmnU80YU10Ea35P3jdeA@mail.gmail.com>
2021-09-20 20:10     ` Antwane Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ca4b06993eb01c3205b3306b11d3f70cfc8f5207.camel@telenet.be \
    --to=maximedevos@telenet.be \
    --cc=ad.mason1413@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).