diff options
author | Sam James <sam@gentoo.org> | 2023-06-24 07:35:26 +0100 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-06-24 07:35:49 +0100 |
commit | 9f0be9f1391414bbb13ae7987d01d21ef2d1161f (patch) | |
tree | ede18a4faf0e1aff512f8b8b1dacf54cca5b04ed /dev-python/python-magic | |
parent | dev-util/watchman: add 2023.06.19.00 (diff) | |
download | gentoo-9f0be9f1391414bbb13ae7987d01d21ef2d1161f.tar.gz gentoo-9f0be9f1391414bbb13ae7987d01d21ef2d1161f.tar.bz2 gentoo-9f0be9f1391414bbb13ae7987d01d21ef2d1161f.zip |
dev-python/python-magic: backport test (only) fix, enable py3.12
Closes: https://bugs.gentoo.org/892379
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-python/python-magic')
-rw-r--r-- | dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch | 26 | ||||
-rw-r--r-- | dev-python/python-magic/python-magic-0.4.27.ebuild | 6 |
2 files changed, 31 insertions, 1 deletions
diff --git a/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch b/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch new file mode 100644 index 000000000000..9a978146f32d --- /dev/null +++ b/dev-python/python-magic/files/python-magic-0.4.27-fix-gzip-test.patch @@ -0,0 +1,26 @@ +https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 + +From 4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 Mon Sep 17 00:00:00 2001 +From: Adam Hupp <adam@hupp.org> +Date: Mon, 9 Jan 2023 12:55:15 -0800 +Subject: [PATCH] update test for upstream added gzip extensions + +--- a/test/python_magic_test.py ++++ b/test/python_magic_test.py +@@ -134,7 +134,7 @@ def test_extension(self): + self.assert_values(m, { + # some versions return '' for the extensions of a gz file, + # including w/ the command line. Who knows... +- 'test.gz': ('gz/tgz/tpz/zabw/svgz', '', '???'), ++ 'test.gz': ('gz/tgz/tpz/zabw/svgz/adz/kmy/xcfgz', 'gz/tgz/tpz/zabw/svgz', '', '???'), + 'name_use.jpg': 'jpeg/jpg/jpe/jfif', + }) + except NotImplementedError: +@@ -227,6 +227,5 @@ def test_pathlike(self): + m = magic.Magic(mime=True) + self.assertEqual('application/pdf', m.from_file(path)) + +- + if __name__ == '__main__': + unittest.main() + diff --git a/dev-python/python-magic/python-magic-0.4.27.ebuild b/dev-python/python-magic/python-magic-0.4.27.ebuild index 18f2483f5cce..18f913a8638a 100644 --- a/dev-python/python-magic/python-magic-0.4.27.ebuild +++ b/dev-python/python-magic/python-magic-0.4.27.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..11} pypy3 ) +PYTHON_COMPAT=( python3_{10..12} pypy3 ) inherit distutils-r1 @@ -31,6 +31,10 @@ BDEPEND=" ) " +PATCHES=( + "${FILESDIR}"/${P}-fix-gzip-test.patch +) + distutils_enable_tests unittest python_test() { |