From: Marius Bakke <mbakke@fastmail.com>
To: Leo Famulari <leo@famulari.name>, guix-devel@gnu.org
Subject: Re: [PATCH 1/1] gnu: Add python-betamax.
Date: Sun, 16 Oct 2016 21:22:06 +0100 [thread overview]
Message-ID: <87shrwnixd.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <7303d3cdb0afa8e657039a476c4a13048ecb748e.1476638200.git.leo@famulari.name>
Leo Famulari <leo@famulari.name> writes:
> This is a build time dependency of python-requests-toolbelt when using
> Python 3.5.
>
> * gnu/packages/python.scm (python-betamax, python2-betamax): New variables.
This LGTM, but I have a couple of off-topic remarks.
The requests input/reference was a bit odd and seems to come from a
python PTH [0] file that sets up the full path to the requests library:
$ cat /gnu/store/q73wijsf2bapjwy47z5cl3jbq9rydmim-python-betamax-0.8.0/lib/python3.4/site-packages/python-betamax-0.8.0.pth
import sys; sys.__plen = len(sys.path)
./betamax-0.8.0-py3.4.egg
/gnu/store/4yxlmdi684axj11dxf0d905dfrjvaw3s-python-requests-2.9.1/lib/python3.4/site-packages/requests-2.9.1-py3.4.egg
import sys; new=sys.path[sys.__plen:]; del sys.path[sys.__plen:]; p=getattr(sys,'__egginsert',0); sys.path[p:p]=new; sys.__egginsert = p+len(new)
I can load this from a pure environment:
$ ./pre-inst-env guix environment --container --pure --ad-hoc python-betamax python
[...]
[env]# python3 -c 'import betamax'
[env]#
Doing the same when applied to wip-python-build-system results in:
[env]# python3 -c 'import betamax'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/gnu/store/gs8jwja6d5k96l32v5psvxwzvwk61rll-profile/lib/python3.4/site-packages/betamax/__init__.py", line 13, in <module>
from .decorator import use_cassette
File "/gnu/store/gs8jwja6d5k96l32v5psvxwzvwk61rll-profile/lib/python3.4/site-packages/betamax/decorator.py", line 4, in <module>
import requests
ImportError: No module named 'requests'
Can we leverage this mechanism instead of propagating everything? Are
there any drawbacks to doing that?
I'll have to do some more investigation around how those .pth files are
created, but food for thought. Perhaps it only works with eggs?
0: https://docs.python.org/3/library/site.html
next prev parent reply other threads:[~2016-10-16 20:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-16 17:17 [PATCH 1/1] gnu: Add python-betamax Leo Famulari
2016-10-16 20:22 ` Marius Bakke [this message]
2016-10-17 12:03 ` Hartmut Goebel
2016-10-17 8:56 ` Hartmut Goebel
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=87shrwnixd.fsf@duckhunt.i-did-not-set--mail-host-address--so-tickle-me \
--to=mbakke@fastmail.com \
--cc=guix-devel@gnu.org \
--cc=leo@famulari.name \
/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.