From patchwork Sat Apr 20 01:07:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Christopher Marusich X-Patchwork-Id: 9599 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 1DCD716ECD; Sat, 20 Apr 2019 02:09:16 +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 3A2BA16ECC for ; Sat, 20 Apr 2019 02:09:15 +0100 (BST) Received: from localhost ([127.0.0.1]:35159 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHeVG-0001FL-Ln for patchwork@mira.cbaines.net; Fri, 19 Apr 2019 21:09:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37442) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hHeV6-00017n-HR for guix-patches@gnu.org; Fri, 19 Apr 2019 21:09:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hHeV5-0003bi-6K for guix-patches@gnu.org; Fri, 19 Apr 2019 21:09:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59804) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hHeV5-0003b0-2S for guix-patches@gnu.org; Fri, 19 Apr 2019 21:09:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hHeV4-0006aq-Sy for guix-patches@gnu.org; Fri, 19 Apr 2019 21:09:02 -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:09:02 +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.155572252125256 (code B ref 35333); Sat, 20 Apr 2019 01:09:02 +0000 Received: (at 35333) by debbugs.gnu.org; 20 Apr 2019 01:08:41 +0000 Received: from localhost ([127.0.0.1]:45098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHeUe-0006Yr-2k for submit@debbugs.gnu.org; Fri, 19 Apr 2019 21:08:41 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:35046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hHeUc-0006YZ-NR for 35333@debbugs.gnu.org; Fri, 19 Apr 2019 21:08:35 -0400 Received: by mail-pg1-f195.google.com with SMTP id g8so3316835pgf.2 for <35333@debbugs.gnu.org>; Fri, 19 Apr 2019 18:08:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fjk+iLnHPpxNB4dvOQ6wA2stzt1yxRL0JNwTFEkZd94=; b=vEsqmn0G9nRzaR0/YQtYW/CpsNmR+w/pI3vK35xLSl/DUngWd8Vftc5KftVTPOuB5O F3ht+oZYnDzuE6jp78iyG05BCRM4adHE4gY3XekFHccCRVSCyc6XL7QeRYyTmdDgwD3g JA8wmiABR/KjY34xKIJgY4HHnFdhZ52jT5Pkm1ueXI9MnZDjtF7OtmXDsswl8T9XkZ1C WnAUymONA+q6Nbt7pi2B+HkkpXe33EF1PiauVUplXeNK0vEwYdKT/IlNioQewy+dHAql 0x+yt/DOmIZzeFW68ZYP0vFJxM5mGU4veljycwF/GSHAXOtk06FHC66u4iICxIAKBeQu xSUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fjk+iLnHPpxNB4dvOQ6wA2stzt1yxRL0JNwTFEkZd94=; b=r1oFaWGA18Ufaxq6Q/Q+e9YeMYV8CZclp9al9gMO/o39s+5wDUyqHYmf3tAfk0owMQ qfkcMLPbd/n5yDzvTDPAgJkQpZeUArqJoTF19G0CXFaH7j3kDyQz7innvQC2eJJFLyZ6 3Yn2/4iW2SdSmlJeNJmSxvPURh0fQVam60d8UdPc2fQ3QFErMmEqw3zJbqlJQrBVrrmJ 8mU3OIBKlp2h4irrWTp5yX4TGTVCFqjienuShn6t8tTa9a4aPWnwtGNpDFB9vpoWMr5C KfqaqvDgkBNokBb7YEQ/ODuMEzhqLKnh8lG7dGOcPdxIBpL2cgA/JvYh57WPMf87nl5j 4xZg== X-Gm-Message-State: APjAAAWzi6AOm6pxBN/GCoN5CpIyAGLu169dlct7H+iWpt0Yy14gqPCZ cmmQFOwUjpbXQPz+fr0smvHrFmlW X-Google-Smtp-Source: APXvYqxxT+NI+T1dZGnLRz/2mJ6jEvkrtIC3z1OtJjnecSjBTo18xElZrCejT08SMinPVijXLkmxpg== X-Received: by 2002:a63:4c:: with SMTP id 73mr6809904pga.210.1555722508445; Fri, 19 Apr 2019 18:08:28 -0700 (PDT) Received: from garuda.lan ([2601:601:9d80:25b2::fa8]) by smtp.gmail.com with ESMTPSA id h16sm8876885pgj.85.2019.04.19.18.08.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 19 Apr 2019 18:08:27 -0700 (PDT) From: Chris Marusich Date: Fri, 19 Apr 2019 18:07:55 -0700 Message-Id: <20190420010800.5741-2-cmmarusich@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190420010800.5741-1-cmmarusich@gmail.com> References: <20190420003814.5120-1-cmmarusich@gmail.com> <20190420010800.5741-1-cmmarusich@gmail.com> 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: , Cc: Chris Marusich Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 | 49 +++++++++++++++++++ .../python-pyfakefs-remove-bad-test.patch | 23 +++++++++ 3 files changed, 73 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..df07525daa 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,51 @@ 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) + ;; 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)) + (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)