From patchwork Sat Apr 20 01:41:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher Marusich X-Patchwork-Id: 9684 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C722A16ECF; Sat, 20 Apr 2019 02:42:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A4EE716ECC for ; Sat, 20 Apr 2019 02:42:08 +0100 (BST) Received: from localhost ([127.0.0.1]:35446 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHf14-0006RY-Fa for patchwork@mira.cbaines.net; Fri, 19 Apr 2019 21:42:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:43844) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHf11-0006RS-Fp for guix-patches@gnu.org; Fri, 19 Apr 2019 21:42:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHf10-00088k-0h for guix-patches@gnu.org; Fri, 19 Apr 2019 21:42:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59852) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHf0z-00088f-SK for guix-patches@gnu.org; Fri, 19 Apr 2019 21:42:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHf0z-0007PX-OG for guix-patches@gnu.org; Fri, 19 Apr 2019 21:42:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35333] [PATCH 1/6] gnu: Add python-pyfakefs and python2-pyfakefs. Resent-From: Chris Marusich Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 20 Apr 2019 01:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35333 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35333@debbugs.gnu.org Received: via spool by 35333-submit@debbugs.gnu.org id=B35333.155572449028441 (code B ref 35333); Sat, 20 Apr 2019 01:42:01 +0000 Received: (at 35333) by debbugs.gnu.org; 20 Apr 2019 01:41:30 +0000 Received: from localhost ([127.0.0.1]:45163 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHf0O-0007OW-Iy for submit@debbugs.gnu.org; Fri, 19 Apr 2019 21:41:30 -0400 Received: from mail-pg1-f196.google.com ([209.85.215.196]:42201) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHf0M-0007OJ-Lh for 35333@debbugs.gnu.org; Fri, 19 Apr 2019 21:41:23 -0400 Received: by mail-pg1-f196.google.com with SMTP id p6so3324340pgh.9 for <35333@debbugs.gnu.org>; Fri, 19 Apr 2019 18:41:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version; bh=MvfmsYfkV3JD3Lgma3cx1dM2taJKkeZa4/MDntsMh/M=; b=C+mRiyi8Kqw9voUiQLl/H+IdwPfkl9RnnsKNmSGIlVEt7dcYIqNWarq7IE8beEaj0R 5DetXKga88+ayyhpTAHKm07qAaz1O23yZI89bSKC7efmjyB1dTtldUwKhKs5mfioBaiY f9S5b4UtaHNdvf5XU4reuIIGDcIsvjmCNEDtmgGb7HP5fJ3t0Z15xTjscRqmz+qBALtm UilMoE4ODbz6Y+YTpwrnN4BcVDYbgF2kQIIN882UWtsFRc/ajZv/NQp1dgztnS/k2YzW NBkCu5AXp74ayTg37ez5UQQgpbmqiPoAZUwjFM8EA7q+4lGRNwL/Qavbn9Tn88MFx5tZ 8Buw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=MvfmsYfkV3JD3Lgma3cx1dM2taJKkeZa4/MDntsMh/M=; b=cKTmgVQdICXsnsgLRJ3YmjgBe3gPRktSu27vOzCSYyW7iFk9M1CSTzBwBYwCSoGSGX 835YbtpZq5BRWqZLwBp4aKn2ZQ6i/a733A1pkKeByLWWsIWiBBRbzaD+uWe+nkYRp4IV 1npwod+3C/l4PNw3tBC8O5sRl7PY7boDAMFU85rNK27isbO/0w5KrFFboGYIGiumRy6v Ggd+bSASaWMasF0xUPzOEIdR1pPkcrUVFHDG7SrBZH7Fhzq7/csUuoYGu4CQt/reeqQj AKDKZi5vIZOBhouYTk711oTBDo+kBJKzYuRm11z9cnjzZdIy3VmSWd+LR5s8rbgyaeHh 4ivA== X-Gm-Message-State: APjAAAXljSZDeK8dExytpULKvdrWK33an/PS45HHkZ6jXh6XbTjwzDZK PKxxGEzC4LqjITFDIZJRIsAPZrs6 X-Google-Smtp-Source: APXvYqyxly4+RxlrV1cLVVES8UmabSgOyOJKU8mYQrJI+85EOrsbZ0D424BY5weLEFkBRLeEbG6QZQ== X-Received: by 2002:a05:6a00:11:: with SMTP id h17mr7199848pfk.232.1555724476035; Fri, 19 Apr 2019 18:41:16 -0700 (PDT) Received: from garuda.local ([2601:601:9d80:25b2::fa8]) by smtp.gmail.com with ESMTPSA id 71sm16645296pfs.36.2019.04.19.18.41.14 for <35333@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 Apr 2019 18:41:14 -0700 (PDT) From: Chris Marusich References: <20190420003814.5120-1-cmmarusich@gmail.com> <20190420010800.5741-1-cmmarusich@gmail.com> <20190420010800.5741-2-cmmarusich@gmail.com> Date: Fri, 19 Apr 2019 18:41:13 -0700 In-Reply-To: <20190420010800.5741-2-cmmarusich@gmail.com> (Chris Marusich's message of "Fri, 19 Apr 2019 18:07:55 -0700") Message-ID: <8736mdxxl2.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Chris Marusich writes: > + ;; Guix lint doesn't like that this release is an autogenerated > + ;; archive, but it seems those are the only releases available. > + (uri (pypi-uri "pyfakefs" version)) This comment is stale. I've updated it in the attached patch. > diff --git a/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch b/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch > [...] > +Note that because the original file distributed in the release on PyPi > +has lines ending in CRLF, those are retained in the diff below. For some reason, the CRLFs became LFs in the patch email, so the build fails. That's curious, because the output of git-format-patch definitely included them. I've attached the updated patch to this email using Gnus instead of git-send-email. Hopefully it will retain the CRLFs this time. From f2091091a90fc25d21e0191df88cf10c6e9890dd Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Thu, 18 Apr 2019 00:40:21 -0700 Subject: [PATCH] gnu: Add python-pyfakefs and python2-pyfakefs. * gnu/packages/patches/python-pyfakefs-remove-bad-test.patch: New file. * gnu/local.mk (dist_patch_DATA): Add the patch. * gnu/packages/check.scm (python-pyfakefs, python2-pyfakefs): New variables. --- gnu/local.mk | 1 + gnu/packages/check.scm | 50 +++++++++++++++++++ .../python-pyfakefs-remove-bad-test.patch | 23 +++++++++ 3 files changed, 74 insertions(+) create mode 100644 gnu/packages/patches/python-pyfakefs-remove-bad-test.patch diff --git a/gnu/local.mk b/gnu/local.mk index 41924a7de5..3953e5b789 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1201,6 +1201,7 @@ dist_patch_DATA = \ %D%/packages/patches/python2-larch-coverage-4.0a6-compatibility.patch \ %D%/packages/patches/python-configobj-setuptools.patch \ %D%/packages/patches/python-faker-fix-build-32bit.patch \ + %D%/packages/patches/python-pyfakefs-remove-bad-test.patch \ %D%/packages/patches/python-flint-includes.patch \ %D%/packages/patches/python-mox3-python3.6-compat.patch \ %D%/packages/patches/python-testtools.patch \ diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm index a38abf0b5b..0be1102683 100644 --- a/gnu/packages/check.scm +++ b/gnu/packages/check.scm @@ -29,6 +29,7 @@ ;;; Copyright © 2017, 2018 Ludovic Courtès ;;; Copyright © 2018 Fis Trivial ;;; Copyright © 2019 Pierre Langlois +;;; Copyright © 2019 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; @@ -2262,3 +2263,52 @@ record the properties and behaviour of particular devices, and to run a program or test suite under a test bed with the previously recorded devices loaded.") (license license:lgpl2.1+))) + +(define-public python-pyfakefs + (package + (name "python-pyfakefs") + (version "3.5.8") + (source (origin + (method url-fetch) + ;; We use the PyPI URL because there is no proper release + ;; available from GitHub. The GitHub project only provides + ;; autogenerated tarballs, which are known to change in place. + (uri (pypi-uri "pyfakefs" version)) + (sha256 + (base32 + "0qb9jp0bqhc0dv0rn805fv99029fvx135f3bvka6scfkcl6jgllc")) + (patches (search-patches + "python-pyfakefs-remove-bad-test.patch")) + (file-name (string-append name "-" version ".tar.gz")))) + (arguments + `(#:phases + (modify-phases %standard-phases + ;; The default test suite does not run these extra tests. + (add-after 'check 'check-pytest-plugin + (lambda _ + (invoke + "python" "-m" "pytest" + "pyfakefs/pytest_tests/pytest_plugin_test.py") + #t))))) + (native-inputs + `(("python-pytest" ,python-pytest))) + (build-system python-build-system) + ;; Guix lint doesn't like that this is a permanent redirect to the GitHub + ;; page, but the pyfakefs documentation asks us to use this specific URL + ;; when linking to the project. Honor their request. + (home-page "http://pyfakefs.org/") + ;; TRANSLATORS: In the synopsis, "Mock" is a verb. + (synopsis "Mock file system interactions in tests") + (description + "This package provides a Python library intended for use in automated +tests. One difficulty when testing software is that the code under test might +need to read or write to files in the local file system. If the file system +is not set up in just the right way, it might cause a spurious error during +the test. The pyfakefs library provides a solution to problems like this by +mocking file system interactions. In other words, it arranges for the code +under test to interact with a fake file system instead of the real file +system. The code under test requires no modification to work with pyfakefs.") + (license license:asl2.0))) + +(define-public python2-pyfakefs + (package-with-python2 python-pyfakefs)) diff --git a/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch b/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch new file mode 100644 index 0000000000..a9488bbe43 --- /dev/null +++ b/gnu/packages/patches/python-pyfakefs-remove-bad-test.patch @@ -0,0 +1,23 @@ +This test incorrectly assumes that the root user is always available. +However, in the build environment, the root user is not available. +Note that because the original file distributed in the release on PyPi +has lines ending in CRLF, those are retained in the diff below. + +--- a/pyfakefs/tests/fake_filesystem_test.py 1969-12-31 16:00:00.000000000 -0800 ++++ b/pyfakefs/tests/fake_filesystem_test.py 1969-12-31 16:00:00.000000000 -0800 +@@ -1021,15 +1021,6 @@ + self.assertEqual(self.path.expanduser('~'), + self.os.environ['HOME'].replace('/', '!')) + +- @unittest.skipIf(TestCase.is_windows or TestCase.is_cygwin, +- 'only tested on unix systems') +- def test_expand_root(self): +- if sys.platform == 'darwin': +- roothome = '!var!root' +- else: +- roothome = '!root' +- self.assertEqual(self.path.expanduser('~root'), roothome) +- + def test_getsize_path_nonexistent(self): + file_path = 'foo!bar!baz' + self.assertRaises(os.error, self.path.getsize, file_path) -- 2.20.1