all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Python 3.5 start of update
@ 2016-02-27  5:19 Diane Trout
  2016-03-04  3:15 ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Diane Trout @ 2016-02-27  5:19 UTC (permalink / raw)
  To: guix-devel

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

Hi,

Attached is the patch I used for trying to update python 3 to 3.5. I disabled 
a test and added an exception handler for some code calling pwd.getpwuid(0) 
and the group equivalent.

It builds outside of the python.scm module but if I change the version in 
python.scm python-minimal ends up with a link error.

*** WARNING: renaming "_ctypes" since importing it failed: build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so: cannot open shared object 
file: No such file or directory
error: [Errno 2] No such file or directory: 'build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so' -> 'build/lib.linux-
x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu_failed.so'
Makefile:608: recipe for target 'sharedmods' failed

I'm currently pretty baffled by the link error as if I do --keep-failed I can 
get it to build with:
cd /tmp/nix-builc-python-minimal-3.5.1.drv
chown -R me .
guix environment python-minimal
cd Python-3.5.1
make

Diane

[-- Attachment #2: 0001-Update-python-3-to-3.5.1.-Disabling-a-test-that-depe.patch --]
[-- Type: text/x-patch, Size: 3323 bytes --]

From 834e5073580c9584b8daf533da6735d9402049b8 Mon Sep 17 00:00:00 2001
From: Diane Trout <diane@ghic.org>
Date: Fri, 26 Feb 2016 16:12:31 -0800
Subject: [PATCH] Update python 3 to 3.5.1. Disabling a test that depended on
 home and adding exception handling for get{pwu,grg}id(0)

---
 gnu/packages/patches/python-fix-tests.patch | 33 +++++++++++++++++++++++++++++
 gnu/packages/python.scm                     |  4 ++--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
index 82c1998..1762531 100644
--- a/gnu/packages/patches/python-fix-tests.patch
+++ b/gnu/packages/patches/python-fix-tests.patch
@@ -1,6 +1,18 @@
 See the discussion about the issues fixed here at:
 http://bugs.python.org/issue20868 .
 
+--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+         expect = set() if not support.fs_is_case_insensitive(BASE) else given
+         self.assertEqual(given, expect)
+         self.assertEqual(set(p.rglob("FILEd*")), set())
+ 
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         support.import_module('pwd')
+         import pwd
 --- Lib/test/test_shutil.py     2014-03-01 03:02:36.088311000 +0100
 +++ Lib/test/test_shutil.py     2014-03-01 04:56:37.768311000 +0100
 @@ -1053,6 +1053,7 @@
@@ -64,6 +76,27 @@ http://bugs.python.org/issue20868 .
      @unittest.skipUnless(support.is_resource_enabled('network'),
                           'network is not enabled')
      def test_idna(self):
+
+--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+     try:
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+ 
+     
 --- Lib/test/_test_multiprocessing.py	2014-04-06 23:12:27.575235000 +0200
 +++ Lib/test/_test_multiprocessing.py	2014-04-06 23:13:04.827235000 +0200
 @@ -1016,6 +1016,7 @@
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index b67aed0..03cc549 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -260,7 +260,7 @@ data types.")
 
 (define-public python
   (package (inherit python-2)
-    (version "3.4.3")
+    (version "3.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
@@ -274,7 +274,7 @@ data types.")
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm"))))
+                "1j95yx32ggqx8jf13h3c8qfp34ixpyg8ipqcdjmn143d6q67rmf6"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-02-27  5:19 Python 3.5 start of update Diane Trout
@ 2016-03-04  3:15 ` Leo Famulari
  2016-03-05  6:51   ` Diane Trout
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-03-04  3:15 UTC (permalink / raw)
  To: Diane Trout; +Cc: guix-devel

On Fri, Feb 26, 2016 at 09:19:40PM -0800, Diane Trout wrote:
> Hi,
> 
> Attached is the patch I used for trying to update python 3 to 3.5. I disabled 
> a test and added an exception handler for some code calling pwd.getpwuid(0) 
> and the group equivalent.
> 
> It builds outside of the python.scm module but if I change the version in 
> python.scm python-minimal ends up with a link error.
> 
> *** WARNING: renaming "_ctypes" since importing it failed: build/lib.linux-
> x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so: cannot open shared object 
> file: No such file or directory
> error: [Errno 2] No such file or directory: 'build/lib.linux-
> x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu.so' -> 'build/lib.linux-
> x86_64-3.5/_ctypes.cpython-35m-x86_64-linux-gnu_failed.so'
> Makefile:608: recipe for target 'sharedmods' failed
> 
> I'm currently pretty baffled by the link error as if I do --keep-failed I can 
> get it to build with:
> cd /tmp/nix-builc-python-minimal-3.5.1.drv
> chown -R me .
> guix environment python-minimal
> cd Python-3.5.1
> make

Thanks for attempting this major upgrade!

I think that using `guix environment python-minimal` will not get you
the exact environment that exists while building with the daemon.

Without the '--pure' or '--container' options, `guix environment`
augments your existing environment rather than replacing it.

Also, the 'python-minimal' offered by `guix environment python-minimal`
is likely the one that lives on the master branch, deployed by `guix
pull`, unless you symlinked your git checkout to
'~/.config/guix/latest'.

Could you try something like this, having checked out the branch where
you are attempting this upgrade:

`~/src/guix/pre-inst-env guix environment --pure python-minimal`

I would suggest '--container' but you'd have to make some changes to
your system if you are on Debian.

You could also try to source the 'environment-variables' file in the
failed build directory, although you will again want to unset your
pre-existing environment first (I'm not sure how to do that).

Sorry if I've misunderstood your dilemma.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-03-04  3:15 ` Leo Famulari
@ 2016-03-05  6:51   ` Diane Trout
  2016-03-08  6:52     ` Diane Trout
  0 siblings, 1 reply; 11+ messages in thread
From: Diane Trout @ 2016-03-05  6:51 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Hello,

Thank you for getting back to me.

> Also, the 'python-minimal' offered by `guix environment python-
> minimal`
> is likely the one that lives on the master branch, deployed by `guix
> pull`, unless you symlinked your git checkout to
> '~/.config/guix/latest'.
> 

I remembered --pure, but I keep forgetting the .config/guix/latest
symlink gets updated fairly frequently.

> Could you try something like this, having checked out the branch
> where
> you are attempting this upgrade:
> 
> `~/src/guix/pre-inst-env guix environment --pure python-minimal`
> 
> I would suggest '--container' but you'd have to make some changes to
> your system if you are on Debian.

I switched to trying to do this on a GuixSD VM.

With pre-inst-env guix environment --pure python-minimal I managed to
get an environment, and figured out some of the config flags from a run
of guix build python-minimal

Whats output in the build log looks like:

(environment variables setting path to bash that I didn't copy) --prefix=/gnu/store/wj1b0simlx4s9vdksc297043cg7ah9gf-python-minimal-3.5.1 --enable-shared LDFLAGS=-Wl,-rpath=/gnu/store/wj1b0simlx4s9vdksc297043cg7ah9gf-python-minimal-3.5.1/lib --without-system-ffi

Does guix sort the config flags somehow? I wasn't sure if the LDFLAGS
could be defined between --arguments.

I had a list of several things I tried that didn't work but then I
asked why is python-minimal using --without-system-ffi? It occurred to
me to try building it with libffi and --with-system-ffi, and that
wonderfully did build. 

I hope this stream of consciousness made some sense. If --without-
system-ffi isn't actually important I can clean up the patch and submit
it after I've gotten some sleep.

(Mostly my previous patch plus commented out the current python-minimal 
(arguments...) and adding ("libffi" ,libffi) to the inputs)

Diane

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-03-05  6:51   ` Diane Trout
@ 2016-03-08  6:52     ` Diane Trout
  2016-03-08  8:24       ` Ricardo Wurmus
  2016-06-21 15:44       ` Christopher Allan Webber
  0 siblings, 2 replies; 11+ messages in thread
From: Diane Trout @ 2016-03-08  6:52 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

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

Hello,

I've gotten further with my Python 3.5 update.

Attached are two patches. One to update Python to 3.5.1 and one to
update pytest as I couldn't get that to run with pytest 2.6.1.

My test was to install jupyter, which pulled in already packaged for
guix packages numpy, pandas, six, requests, pyyaml, dateutil, jinja2,
flask, pyzmq, tornado, traitlets, pygments, nose, pexpect, sphinx,
terminado, pexpect

I only had trouble building cython. There was one unit test failure.
(hand copied from a graphical VM console so some of the python stack
trace text is missing).

FAIL: runTest (__main__.EndToEndTest)
End-to-end asyncio_generators

Traceback
 File runtests.py line 1417 in runTest
   self.assertEqual(0, res, "nonzero exit status
   assertion error 0 != 1 non zero exit status

I have a vague memory of trying to build cython with python 3.4.3 and
having the unit test fail, but it was late and I may have forgotten to
stash all my changes.

(If you're curious about my progress with jupyter, that's over here:
https://github.com/detrout/guix-detrout/blob/master/detrout/packages/py
data.scm )

[-- Attachment #2: 0001-Build-python-3.5.1.patch --]
[-- Type: text/x-patch, Size: 4404 bytes --]

From ecd68c7702fc06a947eb8b550938dd00107b2e33 Mon Sep 17 00:00:00 2001
From: Diane Trout <diane@ghic.org>
Date: Mon, 7 Mar 2016 21:07:21 -0800
Subject: [PATCH 1/2] Build python 3.5.1

This changes python-minimal to also use the system-ffi as
without-system-ffi caused the build to fail trying to
when trying to import _ctypes.
---
 gnu/packages/patches/python-fix-tests.patch | 33 +++++++++++++++++++++++++++++
 gnu/packages/python.scm                     | 12 ++++-------
 2 files changed, 37 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
index 82c1998..1762531 100644
--- a/gnu/packages/patches/python-fix-tests.patch
+++ b/gnu/packages/patches/python-fix-tests.patch
@@ -1,6 +1,18 @@
 See the discussion about the issues fixed here at:
 http://bugs.python.org/issue20868 .
 
+--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+         expect = set() if not support.fs_is_case_insensitive(BASE) else given
+         self.assertEqual(given, expect)
+         self.assertEqual(set(p.rglob("FILEd*")), set())
+ 
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         support.import_module('pwd')
+         import pwd
 --- Lib/test/test_shutil.py     2014-03-01 03:02:36.088311000 +0100
 +++ Lib/test/test_shutil.py     2014-03-01 04:56:37.768311000 +0100
 @@ -1053,6 +1053,7 @@
@@ -64,6 +76,27 @@ http://bugs.python.org/issue20868 .
      @unittest.skipUnless(support.is_resource_enabled('network'),
                           'network is not enabled')
      def test_idna(self):
+
+--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+     try:
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+ 
+     
 --- Lib/test/_test_multiprocessing.py	2014-04-06 23:12:27.575235000 +0200
 +++ Lib/test/_test_multiprocessing.py	2014-04-06 23:13:04.827235000 +0200
 @@ -1016,6 +1016,7 @@
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 050f9e6..d8610a4 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -260,7 +260,7 @@ data types.")
 
 (define-public python
   (package (inherit python-2)
-    (version "3.4.3")
+    (version "3.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
@@ -268,13 +268,13 @@ data types.")
               (patches (map search-patch
                             '("python-fix-tests.patch"
                               ;; XXX Try removing this patch for python > 3.4.3
-                              "python-disable-ssl-test.patch"
+                              ;; "python-disable-ssl-test.patch"
                               "python-3-deterministic-build-info.patch"
                               "python-3-search-paths.patch")))
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm"))))
+                "1j95yx32ggqx8jf13h3c8qfp34ixpyg8ipqcdjmn143d6q67rmf6"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
@@ -301,14 +301,10 @@ data types.")
   (package (inherit python)
     (name "python-minimal")
     (outputs '("out"))
-    (arguments
-     (substitute-keyword-arguments (package-arguments python)
-       ((#:configure-flags cf)
-        `(append ,cf '("--without-system-ffi")))))
-
     ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
     ;; zlib is required by 'zipimport', used by pip.
     (inputs `(("openssl" ,openssl)
+              ("libffi" ,libffi)                         ; for ctypes
               ("zlib" ,zlib)))))
 
 (define* (wrap-python3 python
-- 
2.6.3


[-- Attachment #3: 0002-Update-pytest-to-2.9.0.patch --]
[-- Type: text/x-patch, Size: 1121 bytes --]

From 9c452ae5e62b4e8af8004d72a69dbb62cefda968 Mon Sep 17 00:00:00 2001
From: Diane Trout <diane@ghic.org>
Date: Mon, 7 Mar 2016 22:19:43 -0800
Subject: [PATCH 2/2] Update pytest to 2.9.0

The previous version 2.6.1 had problems running under python 3.5.1.
---
 gnu/packages/python.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index d8610a4..1631646 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -1523,7 +1523,7 @@ code introspection, and logging.")
 (define-public python-pytest
   (package
     (name "python-pytest")
-    (version "2.6.1")
+    (version "2.9.0")
     (source
      (origin
        (method url-fetch)
@@ -1532,7 +1532,7 @@ code introspection, and logging.")
              version ".tar.gz"))
        (sha256
         (base32
-         "0g2w4p0n42wvz8rq4k6gnzpkakgz3g8sfanxk8jrsra9675snkcr"))
+         "03p4spzzvibv82ldhzjrqw38p090ylyvhrrxp6fwc0q9pz657bbg"))
        (modules '((guix build utils)))
        (snippet
         ;; One of the tests involves the /usr directory, so it fails.
-- 
2.6.3


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-03-08  6:52     ` Diane Trout
@ 2016-03-08  8:24       ` Ricardo Wurmus
  2016-06-21 15:44       ` Christopher Allan Webber
  1 sibling, 0 replies; 11+ messages in thread
From: Ricardo Wurmus @ 2016-03-08  8:24 UTC (permalink / raw)
  To: Diane Trout; +Cc: guix-devel


Diane Trout <diane@ghic.org> writes:

> (If you're curious about my progress with jupyter, that's over here:
> https://github.com/detrout/guix-detrout/blob/master/detrout/packages/py
> data.scm)

Oh, nice.  I also have a couple of jupyter-related patches, but they are
already a little older.  I also stumbled into dependency loops which
made it difficult to make progress.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-03-08  6:52     ` Diane Trout
  2016-03-08  8:24       ` Ricardo Wurmus
@ 2016-06-21 15:44       ` Christopher Allan Webber
  2016-06-21 21:29         ` Ludovic Courtès
  1 sibling, 1 reply; 11+ messages in thread
From: Christopher Allan Webber @ 2016-06-21 15:44 UTC (permalink / raw)
  To: Diane Trout; +Cc: guix-devel

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

Building on both the work that Diane did and my recent patch for python
3.4.4, here's two patches which do both consecutively: the first patch
updates python-3.4 to 3.4.4, and the second patch adds python-3.5 and
sets this to be the default python.

I'm interested in packaging Pulsar, but this requires Python 3.5 or
higher, so these patches are a step towards it.

Most of the work is Diane's.  Thank you Diane!  Great work :)

 - Chris


[-- Attachment #2: 0001-gnu-Add-geiser-next.patch --]
[-- Type: text/x-patch, Size: 2243 bytes --]

From bbc1f68204318d79ece3fa46ed71d7c21d6ec8a2 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Fri, 29 Apr 2016 17:53:50 -0500
Subject: [PATCH] gnu: Add geiser-next.

Also, I previously committed to this repository in 2015; add self to copyright
headers for that year too.

* gnu/packages/emacs.scm (geiser-next): New variable.
---
 gnu/packages/emacs.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/emacs.scm b/gnu/packages/emacs.scm
index 11010b2..7f904c0 100644
--- a/gnu/packages/emacs.scm
+++ b/gnu/packages/emacs.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2016 Nils Gillmann <niasterisk@grrlz.net>
 ;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
+;;; Copyright © 2015, 2016 Christopher Allan Webber <cwebber@dustycloud.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -260,6 +261,33 @@ implementation, Emacs and, ultimately, the schemer, giving them access to live
 metadata.")
     (license license:bsd-3)))
 
+(define-public geiser-next
+  ;; Geiser's upcoming version supports guile-next, and 0.8.1 does not.
+  ;; When the next Geiser release comes out, we can remove this.
+  (package (inherit geiser)
+    (name "geiser-next")
+    (version "20160428.4c8b3de")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/jaor/geiser.git")
+                    (commit "4c8b3dee30ce7258602bef356337def95fcccd7e")))
+              (sha256
+               (base32
+                "1nr183438z52v62amq38ngd83nwgkxzgssya19f7v6f47im0b95j"))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("texinfo" ,texinfo)
+       ,@(package-native-inputs geiser)))
+    (arguments
+     (substitute-keyword-arguments (package-arguments geiser)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'autogen
+             (lambda _
+               (zero? (system* "sh" "autogen.sh"))))))))))
+
 (define-public paredit
   (package
     (name "paredit")
-- 
2.7.4


[-- Attachment #3: 0002-gnu-Add-python-3.5.patch --]
[-- Type: text/x-patch, Size: 5767 bytes --]

From ec0797ceaed8f20b4dbbfb8fb96b2c4752e93f2e Mon Sep 17 00:00:00 2001
From: Diane Trout <diane@ghic.org>
Date: Tue, 21 Jun 2016 09:22:43 -0500
Subject: [PATCH 2/2] gnu: Add python-3.5.

* gnu/packages/python.scm (python-3.5): New variable.
  (python-3.4): Inherit from python-3.5.
  (python-3): Switched alias to point to python-3.5.
  (python-minimal): Use the system-ffi as without-system-ffi caused the build
  to fail when trying to import _ctypes.
* gnu/packages/patches/python-fix-tests-py3.5.patch:
  New file.  Patch Lib/test/test_pathlib.py to skip test_expanduser.
  Patch Lib/test/test_tarfile.py to ignore pwd.getpwuid and grp.getgrgid tests
  for user root being of id 0.
---
 gnu/packages/patches/python-fix-tests-py3.5.patch | 35 +++++++++++++++++++++++
 gnu/packages/python.scm                           | 31 ++++++++++++++------
 2 files changed, 58 insertions(+), 8 deletions(-)
 create mode 100644 gnu/packages/patches/python-fix-tests-py3.5.patch

diff --git a/gnu/packages/patches/python-fix-tests-py3.5.patch b/gnu/packages/patches/python-fix-tests-py3.5.patch
new file mode 100644
index 0000000..47dded4
--- /dev/null
+++ b/gnu/packages/patches/python-fix-tests-py3.5.patch
@@ -0,0 +1,35 @@
+Additional test fixes which affect Python 3.5 (and presumably later) but not
+prior revisions of Python.
+
+--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+         expect = set() if not support.fs_is_case_insensitive(BASE) else given
+         self.assertEqual(given, expect)
+         self.assertEqual(set(p.rglob("FILEd*")), set())
+ 
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         support.import_module('pwd')
+         import pwd
+--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+     try:
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+ 
+     
\ No newline at end of file
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 92535cb..0cb08ed 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -20,6 +20,7 @@
 ;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
 ;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
 ;;; Copyright © 2016 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2016 Diane Trout <diane@ghic.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -269,21 +270,22 @@ data types.")
 ;; Current 2.x version.
 (define-public python-2 python-2.7)
 
-(define-public python-3.4
+(define-public python-3.5
   (package (inherit python-2)
-    (version "3.4.4")
+    (version "3.5.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
                                   version "/Python-" version ".tar.xz"))
               (patches (search-patches
                         "python-fix-tests.patch"
+                        "python-fix-tests-py3.5.patch"
                         "python-3-deterministic-build-info.patch"
                         "python-3-search-paths.patch"))
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "18kb5c29w04rj4gyz3jngm72sy8izfnbjlm6ajv6rv2m061d75x7"))))
+                "1j95yx32ggqx8jf13h3c8qfp34ixpyg8ipqcdjmn143d6q67rmf6"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
@@ -293,8 +295,24 @@ data types.")
                                         (version-major+minor version)
                                         "/site-packages"))))))))
 
+(define-public python-3.4
+  (package (inherit python-3.5)
+    (version "3.4.4")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://www.python.org/ftp/python/"
+                                  version "/Python-" version ".tar.xz"))
+              (patches (search-patches
+                        "python-fix-tests.patch"
+                        "python-3-deterministic-build-info.patch"
+                        "python-3-search-paths.patch"))
+              (patch-flags '("-p0"))
+              (sha256
+               (base32
+                "18kb5c29w04rj4gyz3jngm72sy8izfnbjlm6ajv6rv2m061d75x7"))))))
+
 ;; Current 3.x version.
-(define-public python-3 python-3.4)
+(define-public python-3 python-3.5)
 
 ;; Current major version.
 (define-public python python-3)
@@ -316,14 +334,11 @@ data types.")
   (package (inherit python)
     (name "python-minimal")
     (outputs '("out"))
-    (arguments
-     (substitute-keyword-arguments (package-arguments python)
-       ((#:configure-flags cf)
-        `(append ,cf '("--without-system-ffi")))))
 
     ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
     ;; zlib is required by 'zipimport', used by pip.
     (inputs `(("openssl" ,openssl)
+              ("libffi" ,libffi)                         ; for ctypes
               ("zlib" ,zlib)))))
 
 (define* (wrap-python3 python
-- 
2.8.4


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-06-21 15:44       ` Christopher Allan Webber
@ 2016-06-21 21:29         ` Ludovic Courtès
  2016-06-22 13:15           ` Christopher Allan Webber
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2016-06-21 21:29 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

Christopher Allan Webber <cwebber@dustycloud.org> skribis:

> Building on both the work that Diane did and my recent patch for python
> 3.4.4, here's two patches which do both consecutively: the first patch
> updates python-3.4 to 3.4.4, and the second patch adds python-3.5 and
> sets this to be the default python.
>
> I'm interested in packaging Pulsar, but this requires Python 3.5 or
> higher, so these patches are a step towards it.
>
> Most of the work is Diane's.  Thank you Diane!  Great work :)

Nice!

> From bbc1f68204318d79ece3fa46ed71d7c21d6ec8a2 Mon Sep 17 00:00:00 2001
> From: Christopher Allan Webber <cwebber@dustycloud.org>
> Date: Fri, 29 Apr 2016 17:53:50 -0500
> Subject: [PATCH] gnu: Add geiser-next.

Oops.  ;-)

> From ec0797ceaed8f20b4dbbfb8fb96b2c4752e93f2e Mon Sep 17 00:00:00 2001
> From: Diane Trout <diane@ghic.org>
> Date: Tue, 21 Jun 2016 09:22:43 -0500
> Subject: [PATCH 2/2] gnu: Add python-3.5.
>
> * gnu/packages/python.scm (python-3.5): New variable.
>   (python-3.4): Inherit from python-3.5.
>   (python-3): Switched alias to point to python-3.5.
>   (python-minimal): Use the system-ffi as without-system-ffi caused the build
>   to fail when trying to import _ctypes.
> * gnu/packages/patches/python-fix-tests-py3.5.patch:
>   New file.  Patch Lib/test/test_pathlib.py to skip test_expanduser.
>   Patch Lib/test/test_tarfile.py to ignore pwd.getpwuid and grp.getgrgid tests
>   for user root being of id 0.

Feel free to add a “Co-authored-by” tag if you think it’s relevant.

> diff --git a/gnu/packages/patches/python-fix-tests-py3.5.patch b/gnu/packages/patches/python-fix-tests-py3.5.patch
> new file mode 100644
> index 0000000..47dded4
> --- /dev/null
> +++ b/gnu/packages/patches/python-fix-tests-py3.5.patch
> @@ -0,0 +1,35 @@
> +Additional test fixes which affect Python 3.5 (and presumably later) but not
> +prior revisions of Python.
> +
> +--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
> ++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
> +@@ -1986,8 +1986,9 @@
> +         expect = set() if not support.fs_is_case_insensitive(BASE) else given
> +         self.assertEqual(given, expect)
> +         self.assertEqual(set(p.rglob("FILEd*")), set())
> + 
> ++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")

Could it be that adding a phase that does (setenv "HOME" (getcwd)) would
help?

> +--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
> ++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
> +@@ -2305,11 +2305,14 @@
> +     try:
> +         import pwd, grp
> +     except ImportError:
> +         return False
> +-    if pwd.getpwuid(0)[0] != 'root':
> +-        return False
> +-    if grp.getgrgid(0)[0] != 'root':
> ++    try:
> ++        if pwd.getpwuid(0)[0] != 'root':
> ++            return False
> ++        if grp.getgrgid(0)[0] != 'root':
> ++            return False
> ++    except KeyError:
> +         return False
> +     return True

(I was skeptical about this bit so I tried this:

--8<---------------cut here---------------start------------->8---
store-monad@(guile-user) [1]> (gexp->derivation "foo"
						#~(call-with-output-file #$output
						    (lambda (port)
						      (write (list (false-if-exception (getpwuid 0))
								   (false-if-exception (getgrgid 0)))
							     port))))
$6 = #<derivation /gnu/store/zxlirg8wbl8r5pkkhsc89gxvx6lzmwd7-foo.drv => /gnu/store/fr9klqdkfqz8ayiq1fjq5i468qjx39mc-foo 42843c0>
store-monad@(guile-user) [1]> (built-derivations (list $6))
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
building path(s) `/gnu/store/fr9klqdkfqz8ayiq1fjq5i468qjx39mc-foo'
$7 = #t
--8<---------------cut here---------------end--------------->8---

… and indeed, we get (#f #f).  No wonder because libstore/build.cc
does not add any entry for “root” in /etc/passwd.  Probably worth fixing
someday.)

Other than that, LGTM!

The big frustration is that we’ll have to open a ‘python-updates’
branch, where we can also add Hartmut’s changes, but we’ll have to wait
until ‘core-updates’ is merged before we can start building it, which
could take another week or so.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-06-21 21:29         ` Ludovic Courtès
@ 2016-06-22 13:15           ` Christopher Allan Webber
  2016-08-21 17:58             ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Christopher Allan Webber @ 2016-06-22 13:15 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès writes:

>> From bbc1f68204318d79ece3fa46ed71d7c21d6ec8a2 Mon Sep 17 00:00:00 2001
>> From: Christopher Allan Webber <cwebber@dustycloud.org>
>> Date: Fri, 29 Apr 2016 17:53:50 -0500
>> Subject: [PATCH] gnu: Add geiser-next.
>
> Oops.  ;-)

Oops indeed... I'll attach the right first of 2 patches when I get the
next commit in.

>> From ec0797ceaed8f20b4dbbfb8fb96b2c4752e93f2e Mon Sep 17 00:00:00 2001
>> From: Diane Trout <diane@ghic.org>
>> Date: Tue, 21 Jun 2016 09:22:43 -0500
>> Subject: [PATCH 2/2] gnu: Add python-3.5.
>>
>> * gnu/packages/python.scm (python-3.5): New variable.
>>   (python-3.4): Inherit from python-3.5.
>>   (python-3): Switched alias to point to python-3.5.
>>   (python-minimal): Use the system-ffi as without-system-ffi caused the build
>>   to fail when trying to import _ctypes.
>> * gnu/packages/patches/python-fix-tests-py3.5.patch:
>>   New file.  Patch Lib/test/test_pathlib.py to skip test_expanduser.
>>   Patch Lib/test/test_tarfile.py to ignore pwd.getpwuid and grp.getgrgid tests
>>   for user root being of id 0.
>
> Feel free to add a “Co-authored-by” tag if you think it’s relevant.

Oh I didn't know about that... will do.

>> diff --git a/gnu/packages/patches/python-fix-tests-py3.5.patch b/gnu/packages/patches/python-fix-tests-py3.5.patch
>> new file mode 100644
>> index 0000000..47dded4
>> --- /dev/null
>> +++ b/gnu/packages/patches/python-fix-tests-py3.5.patch
>> @@ -0,0 +1,35 @@
>> +Additional test fixes which affect Python 3.5 (and presumably later) but not
>> +prior revisions of Python.
>> +
>> +--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
>> ++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
>> +@@ -1986,8 +1986,9 @@
>> +         expect = set() if not support.fs_is_case_insensitive(BASE) else given
>> +         self.assertEqual(given, expect)
>> +         self.assertEqual(set(p.rglob("FILEd*")), set())
>> + 
>> ++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
>
> Could it be that adding a phase that does (setenv "HOME" (getcwd)) would
> help?

A good idea, will give it a try!

>> +--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
>> ++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
>> +@@ -2305,11 +2305,14 @@
>> +     try:
>> +         import pwd, grp
>> +     except ImportError:
>> +         return False
>> +-    if pwd.getpwuid(0)[0] != 'root':
>> +-        return False
>> +-    if grp.getgrgid(0)[0] != 'root':
>> ++    try:
>> ++        if pwd.getpwuid(0)[0] != 'root':
>> ++            return False
>> ++        if grp.getgrgid(0)[0] != 'root':
>> ++            return False
>> ++    except KeyError:
>> +         return False
>> +     return True
>
> (I was skeptical about this bit so I tried this:
>
> --8<---------------cut here---------------start------------->8---
> store-monad@(guile-user) [1]> (gexp->derivation "foo"
> 						#~(call-with-output-file #$output
> 						    (lambda (port)
> 						      (write (list (false-if-exception (getpwuid 0))
> 								   (false-if-exception (getgrgid 0)))
> 							     port))))
> $6 = #<derivation /gnu/store/zxlirg8wbl8r5pkkhsc89gxvx6lzmwd7-foo.drv => /gnu/store/fr9klqdkfqz8ayiq1fjq5i468qjx39mc-foo 42843c0>
> store-monad@(guile-user) [1]> (built-derivations (list $6))
> substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 100.0%
> building path(s) `/gnu/store/fr9klqdkfqz8ayiq1fjq5i468qjx39mc-foo'
> $7 = #t
> --8<---------------cut here---------------end--------------->8---
>
> … and indeed, we get (#f #f).  No wonder because libstore/build.cc
> does not add any entry for “root” in /etc/passwd.  Probably worth fixing
> someday.)

Heh :)

Is it worth filing a bug?

> Other than that, LGTM!
>
> The big frustration is that we’ll have to open a ‘python-updates’
> branch, where we can also add Hartmut’s changes, but we’ll have to wait
> until ‘core-updates’ is merged before we can start building it, which
> could take another week or so.

Makes sense.  It'll be worth it!

I'll try to get the rest of this done this afternoon, but it might
happen sometime later this week.

 - Chris

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-06-22 13:15           ` Christopher Allan Webber
@ 2016-08-21 17:58             ` Leo Famulari
  2016-08-30  1:48               ` Leo Famulari
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-08-21 17:58 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 2141 bytes --]

On Wed, Jun 22, 2016 at 08:15:02AM -0500, Christopher Allan Webber wrote:
> Ludovic Courtès writes:
> >> From bbc1f68204318d79ece3fa46ed71d7c21d6ec8a2 Mon Sep 17 00:00:00 2001
> >> From: Christopher Allan Webber <cwebber@dustycloud.org>
> 
> >> diff --git a/gnu/packages/patches/python-fix-tests-py3.5.patch b/gnu/packages/patches/python-fix-tests-py3.5.patch
> >> new file mode 100644
> >> index 0000000..47dded4
> >> --- /dev/null
> >> +++ b/gnu/packages/patches/python-fix-tests-py3.5.patch
> >> @@ -0,0 +1,35 @@
> >> +Additional test fixes which affect Python 3.5 (and presumably later) but not
> >> +prior revisions of Python.
> >> +
> >> +--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
> >> ++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
> >> +@@ -1986,8 +1986,9 @@
> >> +         expect = set() if not support.fs_is_case_insensitive(BASE) else given
> >> +         self.assertEqual(given, expect)
> >> +         self.assertEqual(set(p.rglob("FILEd*")), set())
> >> + 
> >> ++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
> >
> > Could it be that adding a phase that does (setenv "HOME" (getcwd)) would
> > help?

IIUC, we already do that in python-2, and python-3 inherits from
python-2. So, it seems that it's not enough.

> I'll try to get the rest of this done this afternoon, but it might
> happen sometime later this week.

;)

I picked this up. I've attached two patches. They upgrade python-3.4 to
3.4.5, and then upgrade python-3 to 3.5.2 while preserving a python-3.4.
These are the latest releases in their respective series.

I had to split part of the python-fix-tests.patch into 3.4 and 3.5
specific patches, since those packages' codebases have diverged.

python@3.4.5 and python@3.5.2 both build on master and wip-python.
python-setuptools builds with python@3.5.2 on master.

I'd like to put these on core-updates. The wip-python branch will take a
while to get ready. I found this saga about what Nix had to do to
upgrade setuptools:
https://github.com/NixOS/nixpkgs/pull/12552

[-- Attachment #1.2: 0001-gnu-python-3.4-Update-to-3.4.5.patch --]
[-- Type: text/plain, Size: 4185 bytes --]

From 34f52581bed88368396490d6e42fd1cb50e0a3f1 Mon Sep 17 00:00:00 2001
From: Christopher Allan Webber <cwebber@dustycloud.org>
Date: Mon, 20 Jun 2016 14:05:20 -0500
Subject: [PATCH 1/2] gnu: python-3.4: Update to 3.4.5.

* gnu/packages/patches/python-disable-ssl-test.patch: Delete file.
* gnu/local.mk (dist_patch_DATA): Remove it.
* gnu/packages/python.scm (python-3.4): Update to 3.4.5.
[source]: Remove patch.
[arguments]: Remove field.
(python-minimal)[inputs]: Add libffi.
---
 gnu/local.mk                                       |  1 -
 gnu/packages/patches/python-disable-ssl-test.patch | 12 ------------
 gnu/packages/python.scm                            | 14 +++++---------
 3 files changed, 5 insertions(+), 22 deletions(-)
 delete mode 100644 gnu/packages/patches/python-disable-ssl-test.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 3444c20..f201232 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -734,7 +734,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-3-deterministic-build-info.patch	\
   %D%/packages/patches/python-3-search-paths.patch		\
   %D%/packages/patches/python-dendropy-exclude-failing-tests.patch \
-  %D%/packages/patches/python-disable-ssl-test.patch		\
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-ipython-inputhook-ctype.patch	\
   %D%/packages/patches/python-rarfile-fix-tests.patch		\
diff --git a/gnu/packages/patches/python-disable-ssl-test.patch b/gnu/packages/patches/python-disable-ssl-test.patch
deleted file mode 100644
index e351c77..0000000
--- a/gnu/packages/patches/python-disable-ssl-test.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Disable a test that fails with openssl-1.0.2b.
-
---- Lib/test/test_ssl.py.orig	2015-02-25 06:27:45.000000000 -0500
-+++ Lib/test/test_ssl.py	2015-06-12 03:14:09.395212502 -0400
-@@ -2718,6 +2718,7 @@
-                                        chatty=True, connectionchatty=True)
-             self.assertIs(stats['compression'], None)
- 
-+        @unittest.skipIf(True, "openssl 1.0.2b complains: dh key too small")
-         def test_dh_params(self):
-             # Check we can get a connection with ephemeral Diffie-Hellman
-             context = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index a83e4ee..5d529b0 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -301,21 +301,19 @@ data types.")
 
 (define-public python-3.4
   (package (inherit python-2)
-    (version "3.4.3")
+    (version "3.4.5")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
                                   version "/Python-" version ".tar.xz"))
               (patches (search-patches
                         "python-fix-tests.patch"
-                        ;; XXX Try removing this patch for python > 3.4.3
-                        "python-disable-ssl-test.patch"
                         "python-3-deterministic-build-info.patch"
                         "python-3-search-paths.patch"))
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "1f4nm4z08sy0kqwisvv95l02crv6dyysdmx44p1mz3bn6csrdcxm"))))
+                "12l9klp778wklxmckhghniy5hklss8r26995pyd00qbllk4b2r7f"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
@@ -348,14 +346,12 @@ data types.")
   (package (inherit python)
     (name "python-minimal")
     (outputs '("out"))
-    (arguments
-     (substitute-keyword-arguments (package-arguments python)
-       ((#:configure-flags cf)
-        `(append ,cf '("--without-system-ffi")))))
 
+    ;; Build fails due to missing ctypes without libffi.
     ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
     ;; zlib is required by 'zipimport', used by pip.
-    (inputs `(("openssl" ,openssl)
+    (inputs `(("libffi" ,libffi)
+              ("openssl" ,openssl)
               ("zlib" ,zlib)))))
 
 (define* (wrap-python3 python
-- 
2.9.3


[-- Attachment #1.3: 0002-gnu-python-3-Update-to-python-3.5.2.patch --]
[-- Type: text/plain, Size: 8863 bytes --]

From d4b9e30eae7c230a93d9510d5680e7ef4ae6b9d6 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Sun, 21 Aug 2016 00:51:38 -0400
Subject: [PATCH 2/2] gnu: python-3: Update to python-3.5.2.

* gnu/packages/patches/python-3.4-fix-tests.patch,
gnu/packages/patches/python-3.5-fix-tests.patch: New files.
* gnu/local.mk (dist_patch_DATA): Add them.
* gnu/packages/patches/python-fix-tests.patch: Move python-3.4 specific
hunk to 'gnu/packages/patches/python-3.4-fix-tests.patch'.
* gnu/packages/python.scm (python-3.5): New variable.
(python-3.4): Inherit from python-3.5.
[source]: Use 'gnu/packages/patches/python-3.4-fix-tests.patch'.
(python-3): Point to python-3.5.

Co-authored-by: Diane Trout <diane@ghic.org>
Co-authored-by: Christopher Allan Webber <cwebber@dustycloud.org>
---
 gnu/local.mk                                    |  2 ++
 gnu/packages/patches/python-3.4-fix-tests.patch | 12 +++++++
 gnu/packages/patches/python-3.5-fix-tests.patch | 46 +++++++++++++++++++++++++
 gnu/packages/patches/python-fix-tests.patch     | 15 --------
 gnu/packages/python.scm                         | 26 +++++++++++---
 5 files changed, 82 insertions(+), 19 deletions(-)
 create mode 100644 gnu/packages/patches/python-3.4-fix-tests.patch
 create mode 100644 gnu/packages/patches/python-3.5-fix-tests.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index f201232..2b129a6 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -733,6 +733,8 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-2.7-source-date-epoch.patch	\
   %D%/packages/patches/python-3-deterministic-build-info.patch	\
   %D%/packages/patches/python-3-search-paths.patch		\
+  %D%/packages/patches/python-3.4-fix-tests.patch		\
+  %D%/packages/patches/python-3.5-fix-tests.patch		\
   %D%/packages/patches/python-dendropy-exclude-failing-tests.patch \
   %D%/packages/patches/python-fix-tests.patch			\
   %D%/packages/patches/python-ipython-inputhook-ctype.patch	\
diff --git a/gnu/packages/patches/python-3.4-fix-tests.patch b/gnu/packages/patches/python-3.4-fix-tests.patch
new file mode 100644
index 0000000..d1f8138
--- /dev/null
+++ b/gnu/packages/patches/python-3.4-fix-tests.patch
@@ -0,0 +1,12 @@
+--- Lib/test/test_posixpath.py  2014-03-01 05:46:56.984311000 +0100
++++ Lib/test/test_posixpath.py  2014-03-07 00:59:20.888311000 +0100
+@@ -319,7 +319,11 @@
+                 del env['HOME']
+                 home = pwd.getpwuid(os.getuid()).pw_dir
+                 # $HOME can end with a trailing /, so strip it (see #17809)
+-                self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
++                # The Guix builders have '/' as a home directory, so
++                # home.rstrip("/") will be an empty string and the test will
++                # fail. Let's just disable it since it does not really make
++                # sense with such a bizarre setup.
++                # self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
diff --git a/gnu/packages/patches/python-3.5-fix-tests.patch b/gnu/packages/patches/python-3.5-fix-tests.patch
new file mode 100644
index 0000000..46d2a84
--- /dev/null
+++ b/gnu/packages/patches/python-3.5-fix-tests.patch
@@ -0,0 +1,46 @@
+Additional test fixes which affect Python 3.5 (and presumably later) but not
+prior revisions of Python.
+
+--- Lib/test/test_pathlib.py     2014-03-01 03:02:36.088311000 +0100
++++ Lib/test/test_pathlib.py     2014-03-01 04:56:37.768311000 +0100
+@@ -1986,8 +1986,9 @@
+         expect = set() if not support.fs_is_case_insensitive(BASE) else given
+         self.assertEqual(given, expect)
+         self.assertEqual(set(p.rglob("FILEd*")), set())
+ 
++    @unittest.skipIf(True, "Guix builder home is '/' which causes trouble for these tests")
+     def test_expanduser(self):
+         P = self.cls
+         support.import_module('pwd')
+         import pwd
+--- Lib/test/test_tarfile.py        2016-02-24 19:22:52.597208055 +0000
++++ Lib/test/test_tarfile.py     2016-02-24 20:50:48.941950135 +0000
+@@ -2305,11 +2305,14 @@
+     try:
+         import pwd, grp
+     except ImportError:
+         return False
+-    if pwd.getpwuid(0)[0] != 'root':
+-        return False
+-    if grp.getgrgid(0)[0] != 'root':
++    try:
++        if pwd.getpwuid(0)[0] != 'root':
++            return False
++        if grp.getgrgid(0)[0] != 'root':
++            return False
++    except KeyError:
+         return False
+     return True
+
+
+--- Lib/test/test_asyncio/test_base_events.py
++++ Lib/test/test_asyncio/test_base_events.py
+@@ -142,6 +142,8 @@ class BaseEventTests(test_utils.TestCase):
+             (INET, STREAM, TCP, '', ('1.2.3.4', 1)),
+             base_events._ipaddr_info('1.2.3.4', b'1', INET, STREAM, TCP))
+ 
++    @unittest.skipUnless(support.is_resource_enabled('network'),
++                         'network is not enabled')
+     def test_getaddrinfo_servname(self):
+         INET = socket.AF_INET
+         STREAM = socket.SOCK_STREAM
diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/patches/python-fix-tests.patch
index 82c1998..e093307 100644
--- a/gnu/packages/patches/python-fix-tests.patch
+++ b/gnu/packages/patches/python-fix-tests.patch
@@ -20,21 +20,6 @@ http://bugs.python.org/issue20868 .
      def test_tarfile_root_owner(self):
          tmpdir, tmpdir2, base_name =  self._create_files()
 
---- Lib/test/test_posixpath.py	2014-03-01 05:46:56.984311000 +0100
-+++ Lib/test/test_posixpath.py	2014-03-07 00:59:20.888311000 +0100
-@@ -319,7 +319,11 @@
-                 del env['HOME']
-                 home = pwd.getpwuid(os.getuid()).pw_dir
-                 # $HOME can end with a trailing /, so strip it (see #17809)
--                self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
-+                # The Guix builders have '/' as a home directory, so
-+                # home.rstrip("/") will be an empty string and the test will
-+                # fail. Let's just disable it since it does not really make
-+                # sense with such a bizarre setup.
-+                # self.assertEqual(posixpath.expanduser("~"), home.rstrip("/"))
- 
-     def test_normpath(self):
-         self.assertEqual(posixpath.normpath(""), ".")
 --- Lib/test/test_socket.py.orig	2014-03-02 22:14:12.264311000 +0100
 +++ Lib/test/test_socket.py	2014-03-21 03:50:45.660311000 +0100
 @@ -819,6 +819,8 @@
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 5d529b0..975459e 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -299,21 +299,22 @@ data types.")
 ;; Current 2.x version.
 (define-public python-2 python-2.7)
 
-(define-public python-3.4
+(define-public python-3.5
   (package (inherit python-2)
-    (version "3.4.5")
+    (version "3.5.2")
     (source (origin
               (method url-fetch)
               (uri (string-append "https://www.python.org/ftp/python/"
                                   version "/Python-" version ".tar.xz"))
               (patches (search-patches
                         "python-fix-tests.patch"
+                        "python-3.5-fix-tests.patch"
                         "python-3-deterministic-build-info.patch"
                         "python-3-search-paths.patch"))
               (patch-flags '("-p0"))
               (sha256
                (base32
-                "12l9klp778wklxmckhghniy5hklss8r26995pyd00qbllk4b2r7f"))))
+                "0h6a5fr7ram2s483lh0pnmc4ncijb8llnpfdxdcl5dxr01hza400"))))
     (arguments (substitute-keyword-arguments (package-arguments python-2)
                  ((#:tests? _) #t)))
     (native-search-paths
@@ -323,8 +324,25 @@ data types.")
                                         (version-major+minor version)
                                         "/site-packages"))))))))
 
+(define-public python-3.4
+  (package (inherit python-3.5)
+    (version "3.4.5")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://www.python.org/ftp/python/"
+                                  version "/Python-" version ".tar.xz"))
+              (patches (search-patches
+                        "python-fix-tests.patch"
+                        "python-3.4-fix-tests.patch"
+                        "python-3-deterministic-build-info.patch"
+                        "python-3-search-paths.patch"))
+              (patch-flags '("-p0"))
+              (sha256
+               (base32
+                "12l9klp778wklxmckhghniy5hklss8r26995pyd00qbllk4b2r7f"))))))
+
 ;; Current 3.x version.
-(define-public python-3 python-3.4)
+(define-public python-3 python-3.5)
 
 ;; Current major version.
 (define-public python python-3)
-- 
2.9.3


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-08-21 17:58             ` Leo Famulari
@ 2016-08-30  1:48               ` Leo Famulari
  2016-08-30 14:03                 ` Christopher Allan Webber
  0 siblings, 1 reply; 11+ messages in thread
From: Leo Famulari @ 2016-08-30  1:48 UTC (permalink / raw)
  To: Christopher Allan Webber; +Cc: guix-devel

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

On Sun, Aug 21, 2016 at 01:58:51PM -0400, Leo Famulari wrote:
> I picked this up. I've attached two patches. They upgrade python-3.4 to
> 3.4.5, and then upgrade python-3 to 3.5.2 while preserving a python-3.4.
> These are the latest releases in their respective series.
> 
> I had to split part of the python-fix-tests.patch into 3.4 and 3.5
> specific patches, since those packages' codebases have diverged.
> 
> python@3.4.5 and python@3.5.2 both build on master and wip-python.
> python-setuptools builds with python@3.5.2 on master.
> 
> I'd like to put these on core-updates. The wip-python branch will take a
> while to get ready. I found this saga about what Nix had to do to
> upgrade setuptools:
> https://github.com/NixOS/nixpkgs/pull/12552

I went ahead and pushed to core-updates, bringing the branch to
72df66806.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Python 3.5 start of update
  2016-08-30  1:48               ` Leo Famulari
@ 2016-08-30 14:03                 ` Christopher Allan Webber
  0 siblings, 0 replies; 11+ messages in thread
From: Christopher Allan Webber @ 2016-08-30 14:03 UTC (permalink / raw)
  To: Leo Famulari; +Cc: guix-devel

Leo Famulari writes:

> On Sun, Aug 21, 2016 at 01:58:51PM -0400, Leo Famulari wrote:
>> I picked this up. I've attached two patches. They upgrade python-3.4 to
>> 3.4.5, and then upgrade python-3 to 3.5.2 while preserving a python-3.4.
>> These are the latest releases in their respective series.
>> 
>> I had to split part of the python-fix-tests.patch into 3.4 and 3.5
>> specific patches, since those packages' codebases have diverged.
>> 
>> python@3.4.5 and python@3.5.2 both build on master and wip-python.
>> python-setuptools builds with python@3.5.2 on master.
>> 
>> I'd like to put these on core-updates. The wip-python branch will take a
>> while to get ready. I found this saga about what Nix had to do to
>> upgrade setuptools:
>> https://github.com/NixOS/nixpkgs/pull/12552
>
> I went ahead and pushed to core-updates, bringing the branch to
> 72df66806.

Horray!  Thanks for pushing it the rest of the way. :)

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-08-30 14:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-27  5:19 Python 3.5 start of update Diane Trout
2016-03-04  3:15 ` Leo Famulari
2016-03-05  6:51   ` Diane Trout
2016-03-08  6:52     ` Diane Trout
2016-03-08  8:24       ` Ricardo Wurmus
2016-06-21 15:44       ` Christopher Allan Webber
2016-06-21 21:29         ` Ludovic Courtès
2016-06-22 13:15           ` Christopher Allan Webber
2016-08-21 17:58             ` Leo Famulari
2016-08-30  1:48               ` Leo Famulari
2016-08-30 14:03                 ` Christopher Allan Webber

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.