From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Marusich Subject: Re: [PATCH] gnu: Add python-contextlib2 Date: Sat, 21 Nov 2015 13:28:41 -0800 Message-ID: References: <564C7549.3070707@uq.edu.au> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=001a113d76d811aa53052513ad96 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Fi7-00089Y-RV for guix-devel@gnu.org; Sat, 21 Nov 2015 16:28:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a0Fi6-0002Sb-M5 for guix-devel@gnu.org; Sat, 21 Nov 2015 16:28:43 -0500 Received: from mail-oi0-x230.google.com ([2607:f8b0:4003:c06::230]:34830) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a0Fi6-0002SR-Fs for guix-devel@gnu.org; Sat, 21 Nov 2015 16:28:42 -0500 Received: by oige206 with SMTP id e206so83805705oig.2 for ; Sat, 21 Nov 2015 13:28:41 -0800 (PST) In-Reply-To: <564C7549.3070707@uq.edu.au> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ben Woodcroft Cc: "guix-devel@gnu.org" --001a113d76d811aa53052513ad96 Content-Type: text/plain; charset=UTF-8 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] marusich@garuda:~/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] marusich@garuda:~/guix $ ls /gnu/store/msvhvplrir30lbdk5f54x9mxr7pm8qd5-python2-contextlib2-0.4.0 lib/ [0] marusich@garuda:~/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] marusich@garuda:~/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] marusich@garuda:~/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] marusich@garuda:~/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] marusich@garuda:~/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 --001a113d76d811aa53052513ad96 Content-Type: application/octet-stream; name="0001-gnu-Add-python-contextlib2.patch" Content-Disposition: attachment; filename="0001-gnu-Add-python-contextlib2.patch" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 RnJvbSBkN2VlMmZjNGViOTNkZDE3MGEwMTU5MmNjYzE0NzMyNjhlODE4MDZhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBDaHJpcyBNYXJ1c2ljaCA8Y21tYXJ1c2ljaEBnbWFpbC5jb20+ CkRhdGU6IE1vbiwgMTYgTm92IDIwMTUgMDk6Mjg6MzcgLTA4MDAKU3ViamVjdDogW1BBVENIXSBn bnU6IEFkZCBweXRob24tY29udGV4dGxpYjIuCgoqIGdudS9wYWNrYWdlcy9weXRob24uc2NtIChw eXRob24tY29udGV4dGxpYjIsIHB5dGhvbjItY29udGV4dGxpYjIpOgogIE5ldyB2YXJpYWJsZXMu Ci0tLQogZ251L3BhY2thZ2VzL3B5dGhvbi5zY20gfCAyOSArKysrKysrKysrKysrKysrKysrKysr KysrKysrKwogMSBmaWxlIGNoYW5nZWQsIDI5IGluc2VydGlvbnMoKykKCmRpZmYgLS1naXQgYS9n bnUvcGFja2FnZXMvcHl0aG9uLnNjbSBiL2dudS9wYWNrYWdlcy9weXRob24uc2NtCmluZGV4IDRl NTRlZjkuLjIzNTNhYjAgMTAwNjQ0Ci0tLSBhL2dudS9wYWNrYWdlcy9weXRob24uc2NtCisrKyBi L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pCisgICAgKGFyZ3VtZW50cworICAgICBgKCM6cGhhc2VzCisg ICAgICAgKG1vZGlmeS1waGFzZXMgJXN0YW5kYXJkLXBoYXNlcworICAgICAgICAgKHJlcGxhY2Ug J2NoZWNrCisgICAgICAgICAgIChsYW1iZGEgXyAoemVybz8KKyAgICAgICAgICAgICAgICAgICAg ICAoc3lzdGVtKiAicHl0aG9uIiAidGVzdF9jb250ZXh0bGliMi5weSIsICItdiIpKSkpKSkpCisg ICAgKGhvbWUtcGFnZSAiaHR0cDovL2NvbnRleHRsaWIyLnJlYWR0aGVkb2NzLm9yZy8iKQorICAg IChzeW5vcHNpcyAiVG9vbHMgZm9yIGRlY29yYXRvcnMgYW5kIGNvbnRleHQgbWFuYWdlcnMiKQor ICAgIChkZXNjcmlwdGlvbiAiVGhpcyBtb2R1bGUgaXMgcHJpbWFyaWx5IGEgYmFja3BvcnQgb2Yg dGhlIFB5dGhvbiAzLjIgY29udGV4dGxpYiB0bworZWFybGllciBQeXRob24gdmVyc2lvbnMuICBM aWtlIGNvbnRleHRsaWIsIGl0IHByb3ZpZGVzIHV0aWxpdGllcyBmb3IgY29tbW9uCit0YXNrcyBp bnZvbHZpbmcgZGVjb3JhdG9ycyBhbmQgY29udGV4dCBtYW5hZ2Vycy4gIEl0IGFsc28gY29udGFp bnMKK2FkZGl0aW9uYWwgZmVhdHVyZXMgdGhhdCBhcmUgbm90IHBhcnQgb2YgdGhlIHN0YW5kYXJk IGxpYnJhcnkuIikKKyAgICAobGljZW5zZSBwc2ZsKSkpCisKKyhkZWZpbmUtcHVibGljIHB5dGhv bjItY29udGV4dGxpYjIKKyAgKHBhY2thZ2Utd2l0aC1weXRob24yIHB5dGhvbi1jb250ZXh0bGli MikpCi0tIAoyLjUuMAoK --001a113d76d811aa53052513ad96--