From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/5] gnu: Enable tests in Python 3. Date: Fri, 07 Mar 2014 10:40:51 +0100 Message-ID: <878usm9wik.fsf@gnu.org> References: <1394160455-32580-1-git-send-email-tipecaml@gmail.com> <1394160455-32580-4-git-send-email-tipecaml@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60124) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLrH1-00062Q-Nb for guix-devel@gnu.org; Fri, 07 Mar 2014 04:41:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLrGv-0000xq-RA for guix-devel@gnu.org; Fri, 07 Mar 2014 04:40:59 -0500 Received: from hera.aquilenet.fr ([2a01:474::1]:51639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLrGv-0000xc-C2 for guix-devel@gnu.org; Fri, 07 Mar 2014 04:40:53 -0500 In-Reply-To: <1394160455-32580-4-git-send-email-tipecaml@gmail.com> (Cyril Roelandt's message of "Fri, 7 Mar 2014 03:47:33 +0100") 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: Cyril Roelandt Cc: guix-devel@gnu.org Cyril Roelandt skribis: > * gnu/packages/python.scm: enable tests for Python 3 > * gnu/packages/python-fix-tests.patch: New file. > * gnu/packages/gnu-sysem.am (dist_patch_DATA): add it. Typo here. > diff --git a/gnu/packages/patches/python-fix-tests.patch b/gnu/packages/p= atches/python-fix-tests.patch > new file mode 100644 > index 0000000..23ef17f > --- /dev/null > +++ b/gnu/packages/patches/python-fix-tests.patch > @@ -0,0 +1,62 @@ > +--- Lib/test/test_shutil.py 2014-03-01 04:56:37.768311000 +0100 > ++++ Lib/test/test_shutil.py 2014-03-01 03:02:36.088311000 +0100 > +@@ -1053,7 +1053,6 @@ > + self.assertRaises(ValueError, make_archive, base_name, 'xxx') > + Could you add a couple of lines of summary and (possibly) and a link to the upstream report/discussion (or a statement on the upstream status)? > + @requires_zlib > +- @unittest.skipIf(True, "getgrgid(0)[0] raises a KeyError on Guix") It seems that this part of the patch is reversed, no? > +--- Lib/test/test_posixpath.py 2014-03-01 05:46:56.984311000 +0100 > ++++ Lib/test/test_posixpath.py 2014-03-01 06:20:50.704311000 +0100 > +@@ -319,7 +319,11 @@ > + del env['HOME'] > + home =3D pwd.getpwuid(os.getuid()).pw_dir > + # $HOME can end with a trailing /, so strip it (see #17= 809) > +- 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.rstr= ip("/")) I see that the recipe=E2=80=99s =E2=80=98pre-check=E2=80=99 phase does: (setenv "HOME" (getcwd)) so $HOME should actually be /tmp/nix-build-xxx, not just /, no? > +--- Lib/test/test_socket.py 2014-03-02 22:14:12.264311000 +0100 > ++++ Lib/test/test_socket.py 2014-03-03 01:12:21.360311000 +0100 > +@@ -819,6 +819,8 @@ > + self.assertRaises(OverflowError, socket.htonl, k) > + self.assertRaises(OverflowError, socket.htons, k) > + > ++ @unittest.skipUnless(os.path.exists("/etc/services"), > ++ "getservbyname uses /etc/services, which is no= t in the chroot") (I think that should go upstream.) > ++ @unittest.skipUnless(os.path.exists("/etc/gai.conf"), > ++ "getaddrinfo uses /etc/gai.conf, which is not = in the chroot") I don=E2=80=99t think gai.conf is the problem. Instead, the problem is tha= t one cannot rely on name lookups in the build environment at all, and even in general. So this patch may be OK for ourselves (except the comment), but upstream Python should really just gracefully skip the test if name lookup fails. > + (arguments > + (let ((args `(#:modules ((guix build gnu-build-system) > + (guix build utils) > + (srfi srfi-1) > + (srfi srfi-26)) > + ,@(package-arguments python-2)))) > + (substitute-keyword-arguments args > + ((#:tests? _) > + `(list #t))))) #t instead of `(list #t) should do the job. :-) Thanks for going through all this! Ludo=E2=80=99.