commit:     eceef75b4e3f0906eb641426efe6e922da77274c
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 12 19:15:22 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 12 20:19:41 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eceef75b

dev-python/pyfakefs: Bump to 4.1.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/pyfakefs/Manifest                       |  1 +
 .../pyfakefs/files/pyfakefs-4.1.0-openpyxl.patch   | 38 ++++++++++++++++++++++
 dev-python/pyfakefs/pyfakefs-4.1.0.ebuild          | 28 ++++++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/dev-python/pyfakefs/Manifest b/dev-python/pyfakefs/Manifest
index 5df88a33cff..57ba60cb194 100644
--- a/dev-python/pyfakefs/Manifest
+++ b/dev-python/pyfakefs/Manifest
@@ -1,2 +1,3 @@
 DIST pyfakefs-3.7.2.tar.gz 180195 BLAKE2B 
f1e76b652fc67f630fb45798974dc22455e9e99509829fbcaa479f36887c90207d7b6f087e89c9e113bb44df8c4221dc4676129663740812a9426d84a1d47401
 SHA512 
33bdbf7e21f1135c0ee048943a4b7dffec96e018285e4ee2e6a1c6a7f9e595e27348c83af3803d80322e7fd12a59985a6bf6342aa6211ba95c74ffa20929fb5a
 DIST pyfakefs-4.0.2.tar.gz 177627 BLAKE2B 
a52bd900466203af6170bb9ce92f1e5f73f246d576f12390f5b52224de34fa69a3a4c426319b701953f040e343bcf267e20ea2a33df62c4a46f6397f760330aa
 SHA512 
ba14cbc278ece50142d441b7731b01ba316ba9f11e5d442476e12b8b678490aace9578eb3b2fa2e47d6805795ceaf85574d3c5fb992a098585597c7e96d7143a
+DIST pyfakefs-4.1.0.tar.gz 185920 BLAKE2B 
ee61e5ecda697150374bef035054038aed29e23958c58a3b135aae8dae7b397a194586ef6fd3ae70db1d136572a23a876d7f2dacb7e5814c1bedc9bb4502c3fe
 SHA512 
946e21e34643db2b84e53d14bd9758c8edaa9e5e40b827fd74b245f018e8084995f55256900bf795c23a5aae29f124d9fcb80caf08442f6292adb80ee59d79b4

diff --git a/dev-python/pyfakefs/files/pyfakefs-4.1.0-openpyxl.patch 
b/dev-python/pyfakefs/files/pyfakefs-4.1.0-openpyxl.patch
new file mode 100644
index 00000000000..44b76b0132b
--- /dev/null
+++ b/dev-python/pyfakefs/files/pyfakefs-4.1.0-openpyxl.patch
@@ -0,0 +1,38 @@
+From 1d6fabcaccf8dc716f7a49a67f5342d83ef37976 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
+Date: Sun, 12 Jul 2020 21:26:33 +0200
+Subject: [PATCH] Skip test_write_excel if openpyxl is not installed
+
+test_write_excel fails if pandas are installed but openpyxl is not.
+Adjust the condition around the case appropriately.
+---
+ pyfakefs/tests/patched_packages_test.py | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/pyfakefs/tests/patched_packages_test.py 
b/pyfakefs/tests/patched_packages_test.py
+index 05ed7ef..f8d8a1a 100644
+--- a/pyfakefs/tests/patched_packages_test.py
++++ b/pyfakefs/tests/patched_packages_test.py
+@@ -28,6 +28,11 @@ try:
+ except ImportError:
+     xlrd = None
+ 
++try:
++    import openpyxl
++except ImportError:
++    openpyxl = None
++
+ 
+ class TestPatchedPackages(fake_filesystem_unittest.TestCase):
+     def setUp(self):
+@@ -57,6 +62,7 @@ class TestPatchedPackages(fake_filesystem_unittest.TestCase):
+             df = pd.read_excel(path)
+             assert (df.columns == [1, 2, 3, 4]).all()
+ 
++    if pd is not None and openpyxl is not None:
+         def test_write_excel(self):
+             self.fs.create_dir('/foo')
+             path = '/foo/bar.xlsx'
+-- 
+2.27.0
+

diff --git a/dev-python/pyfakefs/pyfakefs-4.1.0.ebuild 
b/dev-python/pyfakefs/pyfakefs-4.1.0.ebuild
new file mode 100644
index 00000000000..f1b37e17b4b
--- /dev/null
+++ b/dev-python/pyfakefs/pyfakefs-4.1.0.ebuild
@@ -0,0 +1,28 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} pypy3 )
+DISTUTILS_USE_SETUPTOOLS=rdepend
+DISTUTILS_IN_SOURCE_BUILD=1
+
+inherit distutils-r1
+
+DESCRIPTION="a fake file system that mocks the Python file system modules"
+HOMEPAGE="https://github.com/jmcgeheeiv/pyfakefs/ 
https://pypi.org/project/pyfakefs/";
+SRC_URI="https://github.com/jmcgeheeiv/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sparc ~x86"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+       "${FILESDIR}"/${P}-openpyxl.patch
+)
+
+python_test() {
+       "${EPYTHON}" -m pyfakefs.tests.all_tests -v || die "tests failed under 
${EPYTHON}"
+}

Reply via email to