guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add python-contextlib2


From: Chris Marusich
Subject: Re: [PATCH] gnu: Add python-contextlib2
Date: Sat, 21 Nov 2015 13:28:41 -0800

Hi,

Thank you for the feedback, Ben and Andreas! I did not know about the
"modify-phases" procedure. That's very useful. I've attached the
modified patch. I've confirmed for both packages that "guix lint" does
not show any errors, that the build succeeds (and tests are run
successfully), and that installation also succeeds. It turns out that
you need to check the exit code of the system* call; if you don't, the
build will succeed even when the tests fail. So I've added that.

However, there is one curiosity. I've noticed that when I run
"./pre-inst-env guix environment python2-contextlib2", the PYTHONPATH
is configured to allow importation of contextlib2 from the
$profile/lib/python3.4/site-packages directory tree, rather than
$profile/lib/python2.7/site-packages. When I run python in this
environment, I get a Python 2.7 interpreter. When I import
contextlib2, it succeeds, and when I check the module's file location,
I see that it does in fact come from the
$profile/lib/python3.4/site-packages directory tree. This seems odd.
Is this expected behavior? Here's the exact output I see (hopefully my
email client won't mess up the formatting too badly):

[0] address@hidden:~/guix
$ ./pre-inst-env guix package --list-installed=context
;;; note: source file /home/marusich/guix/gnu/packages/python.scm
;;;       newer than compiled /home/marusich/guix/gnu/packages/python.go
;;; note: source file /home/marusich/guix/gnu/packages/python.scm
;;;       newer than compiled
/home/marusich/.cache/guile/ccache/2.0-LE-8-2.0/home/marusich/guix/gnu/packages/python.scm.go
python-contextlib2      0.4.0   out     
/gnu/store/5k9qn3csi0w32xrjqv50f9ifyjf0bb29-python-contextlib2-0.4.0
python2-contextlib2     0.4.0   out     
/gnu/store/msvhvplrir30lbdk5f54x9mxr7pm8qd5-python2-contextlib2-0.4.0
[0] address@hidden:~/guix
$ ls /gnu/store/msvhvplrir30lbdk5f54x9mxr7pm8qd5-python2-contextlib2-0.4.0
lib/
[0] address@hidden:~/guix
$ ls 
/gnu/store/msvhvplrir30lbdk5f54x9mxr7pm8qd5-python2-contextlib2-0.4.0/lib/python2.7/site-packages/contextlib2
contextlib2-0.4.0-py2.7.egg-info  contextlib2.py
contextlib2.pyc
[0] address@hidden:~/guix
$ ./pre-inst-env guix environment python2-contextlib2
;;; note: source file /home/marusich/guix/gnu/packages/python.scm
;;;       newer than compiled /home/marusich/guix/gnu/packages/python.go
;;; note: source file /home/marusich/guix/gnu/packages/python.scm
;;;       newer than compiled
/home/marusich/.cache/guile/ccache/2.0-LE-8-2.0/home/marusich/guix/gnu/packages/python.scm.go
[0] [env] address@hidden:~/guix
$ env | grep PYTHONP
PYTHONPATH=/gnu/store/sf69z6zr57vjgh57a1vsf7kr7bcsg5pj-python-2.7.10/lib/python2.7/site-packages:/home/marusich/.guix-profile/lib/python3.4/site-packages
[0] [env] address@hidden:~/guix
$ env | grep PYTHON
PYTHONPATH=/gnu/store/sf69z6zr57vjgh57a1vsf7kr7bcsg5pj-python-2.7.10/lib/python2.7/site-packages:/home/marusich/.guix-profile/lib/python3.4/site-packages
[0] [env] address@hidden:~/guix
$

I'm also curious: why does the "(#:phases" part need to be
quasi-quoted with the backtick symbol "`"? I know what quoting and
quasi-quoting are, but I'm not familiar with Scheme records, so it's
possible that this is something obvious that is related to records
which I just haven't learned about yet. I ask because I searched the
manual and could not find any obvious leads, so if you can point me in
the right direction to understand why the quasi-quote is necessary
here, I'd be grateful.

Thank you,
Chris

Attachment: 0001-gnu-Add-python-contextlib2.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]