From: Foo Chuan Wei <chuanwei.foo@hotmail.com>
To: guix-devel@gnu.org
Subject: python-build-system does not wrap script correctly
Date: Thu, 25 Nov 2021 08:50:42 +0000 [thread overview]
Message-ID: <PU1PR01MB215500EA355BE955262EC5BC8D629@PU1PR01MB2155.apcprd01.prod.exchangelabs.com> (raw)
I am trying to package "Speedometer" [1]. This is the package
definition:
--8<---------------cut here---------------start------------->8---
(define-public speedometer
(package
(name "speedometer")
(version "2.8")
(source
(origin
(method url-fetch)
(uri (pypi-uri "Speedometer" version))
(sha256
(base32 "0qgpjmahy0wlfszqxg0067ck2xab5k6j42d0ifxg1j281yqnm9bx"))))
(build-system python-build-system)
(arguments
`(#:python ,python-2))
(propagated-inputs
`(("python2-urwid" ,python2-urwid)))
(home-page "https://excess.org/speedometer/")
(synopsis "Measure and display the rate of data across a network connection")
(description
"Console monitor of the rate of data across a network connection or data
being stored in a file.")
(license license:lgpl2.1+)))
--8<---------------cut here---------------end--------------->8---
It builds and installs successfully. However, when the wrapper script is
run, this error appears:
--8<---------------cut here---------------start------------->8---
Traceback (most recent call last):
File "/gnu/store/chr1cx6ia0is8s9d07s1nzdla30r6vs1-speedometer-2.8/bin/.speedometer-real", line 11, in <module>
load_entry_point('Speedometer==2.8', 'console_scripts', 'speedometer')()
File "/gnu/store/d3jwdk2v7xck82z3y3hs99033m9nkkw0-python2-2.7.17/lib/python2.7/site-packages/pkg_resources/__init__.py", line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/gnu/store/d3jwdk2v7xck82z3y3hs99033m9nkkw0-python2-2.7.17/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2852, in load_entry_point
return ep.load()
File "/gnu/store/d3jwdk2v7xck82z3y3hs99033m9nkkw0-python2-2.7.17/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2443, in load
return self.resolve()
File "/gnu/store/d3jwdk2v7xck82z3y3hs99033m9nkkw0-python2-2.7.17/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2449, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/gnu/store/chr1cx6ia0is8s9d07s1nzdla30r6vs1-speedometer-2.8/bin/speedometer.py", line 2
export PYTHONPATH="/gnu/store/chr1cx6ia0is8s9d07s1nzdla30r6vs1-speedometer-2.8/lib/python2.7/site-packages:/gnu/store/d3jwdk2v7xck82z3y3hs99033m9nkkw0-python2-2.7.17/lib/python2.7/site-packages:/gnu/store/1iszjcyvb537m6cif7fqrrh95r0sg9wp-python2-urwid-2.1.0/lib/python2.7/site-packages${PYTHONPATH:+:}$PYTHONPATH"
^
SyntaxError: invalid syntax
--8<---------------cut here---------------end--------------->8---
There is apparently something wrong with the wrapper script. What is it?
I worked around the problem by adding this phase:
--8<---------------cut here---------------start------------->8---
(add-after 'unpack 'fix-script
(lambda _
(substitute* "setup.py"
(("'scripts': \\['speedometer.py'\\],")
"'packages': ['.'],"))))
--8<---------------cut here---------------end--------------->8---
[1]: https://github.com/wardi/speedometer/tree/release-2.8
next reply other threads:[~2021-11-25 8:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 8:50 Foo Chuan Wei [this message]
2021-11-27 5:00 ` python-build-system does not wrap script correctly Maxim Cournoyer
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=PU1PR01MB215500EA355BE955262EC5BC8D629@PU1PR01MB2155.apcprd01.prod.exchangelabs.com \
--to=chuanwei.foo@hotmail.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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.