diff --git a/srcpkgs/python3-magic/patches/tests-fix-gzip-extensions.patch b/srcpkgs/python3-magic/patches/tests-fix-gzip-extensions.patch new file mode 100644 index 00000000000000..ddf23ba5e6e2ac --- /dev/null +++ b/srcpkgs/python3-magic/patches/tests-fix-gzip-extensions.patch @@ -0,0 +1,29 @@ +From 4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 Mon Sep 17 00:00:00 2001 +From: Adam Hupp +Date: Mon, 9 Jan 2023 12:55:15 -0800 +Subject: [PATCH] update test for upstream added gzip extensions + +--- + test/python_magic_test.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/test/python_magic_test.py b/test/python_magic_test.py +index 624a443..d51587c 100755 +--- 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/srcpkgs/python3-magic/patches/tests-fix-pdf-description.patch b/srcpkgs/python3-magic/patches/tests-fix-pdf-description.patch new file mode 100644 index 00000000000000..aa08d369326d14 --- /dev/null +++ b/srcpkgs/python3-magic/patches/tests-fix-pdf-description.patch @@ -0,0 +1,40 @@ +From 545a2a561522efc2869066792062694b59b1b39c Mon Sep 17 00:00:00 2001 +From: Dominique Leuenberger +Date: Wed, 2 Aug 2023 11:29:47 +0200 +Subject: [PATCH] Fix test suite with file 5.45 + +[ 12s] test/python_magic_test.py:53: in assert_values +[ 12s] self.assertIn(value, expected_value) +[ 12s] E AssertionError: 'PDF document, version 1.2, 2 page(s)' not found in ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages') +--- + test/libmagic_test.py | 2 +- + test/python_magic_test.py | 3 ++- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/test/libmagic_test.py b/test/libmagic_test.py +index 5719a58..7b4665b 100644 +--- a/test/libmagic_test.py ++++ b/test/libmagic_test.py +@@ -15,7 +15,7 @@ class MagicTestCase(unittest.TestCase): + filename = os.path.join(TESTDATA_DIR, 'test.pdf') + expected_mime_type = 'application/pdf' + expected_encoding = 'us-ascii' +- expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages') ++ expected_name = ('PDF document, version 1.2', 'PDF document, version 1.2, 2 pages', 'PDF document, version 1.2, 2 page(s)') + + def assert_result(self, result): + self.assertEqual(result.mime_type, self.expected_mime_type) +diff --git a/test/python_magic_test.py b/test/python_magic_test.py +index d51587c..410a149 100755 +--- a/test/python_magic_test.py ++++ b/test/python_magic_test.py +@@ -108,7 +108,8 @@ def test_descriptions(self): + self.assert_values(m, { + 'magic._pyc_': 'python 2.4 byte-compiled', + 'test.pdf': ('PDF document, version 1.2', +- 'PDF document, version 1.2, 2 pages'), ++ 'PDF document, version 1.2, 2 pages', ++ 'PDF document, version 1.2, 2 page(s)'), + 'test.gz': + ('gzip compressed data, was "test", from Unix, last ' + 'modified: Sun Jun 29 01:32:52 2008', diff --git a/srcpkgs/python3-magic/template b/srcpkgs/python3-magic/template index 002eb87cf5bef7..c06dc1ed4176af 100644 --- a/srcpkgs/python3-magic/template +++ b/srcpkgs/python3-magic/template @@ -1,7 +1,7 @@ # Template file for 'python3-magic' pkgname=python3-magic -version=0.4.25 -revision=5 +version=0.4.27 +revision=1 build_style=python3-module hostmakedepends="python3-setuptools" makedepends="libmagic" @@ -13,11 +13,8 @@ license="MIT" homepage="https://github.com/ahupp/python-magic" changelog="https://raw.githubusercontent.com/ahupp/python-magic/master/CHANGELOG" distfiles="https://github.com/ahupp/python-magic/archive/${version}.tar.gz" -checksum=0c1f483995067ffff268103f8bb6860d2f42aa3a5a9b906eaf34bcce1de36329 - -do_check() { - ( cd test/; python3 -m pytest ) -} +checksum=3978a25d43d9a7b8a89ae9d726bd4962fc90dc4f69ae852e399f3c56d4b0bd63 +make_check_pre="env LC_ALL=en_US.UTF-8" post_install() { vlicense LICENSE