From 749dbd02b14c09c6e8df5848359b45c223acc1cc Mon Sep 17 00:00:00 2001 From: EnumDev Date: Wed, 6 May 2026 21:02:40 +0300 Subject: [PATCH] Rebuild with python 3.14 --- pkg.info | 5 +++-- source-files/file-5.47-fix.diff | 8 +++++++ source-files/fix-test-suite.patch | 36 +++++++++++++++++++++++++++---- source.sh | 3 ++- 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 source-files/file-5.47-fix.diff diff --git a/pkg.info b/pkg.info index c1d0757..d2ae86d 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: python-magic description: A python wrapper for libmagic version: 0.4.27 -revision: 1 +revision: 2 url: https://github.com/ahupp/python-magic license: MIT architecture: any @@ -9,12 +9,13 @@ output_architecture: any type: source depends: - file - - python3 + - python3=3.14.* make_depends: - python-build - python-installer - python-setuptools - python-wheel +check_depends: - python-pytest downloads: - url: https://github.com/ahupp/python-magic/archive/refs/tags/${BPM_PKG_VERSION}.tar.gz diff --git a/source-files/file-5.47-fix.diff b/source-files/file-5.47-fix.diff new file mode 100644 index 0000000..d57f972 --- /dev/null +++ b/source-files/file-5.47-fix.diff @@ -0,0 +1,8 @@ +96c96 +< 'test.snappy.parquet': 'application/octet-stream', +--- +> 'test.snappy.parquet': 'application/vnd.apache.parquet', +127c127 +< 'test.snappy.parquet': ('Apache Parquet', 'Par archive data'), +--- +> 'test.snappy.parquet': ('Apache Parquet file', 'Par archive data'), diff --git a/source-files/fix-test-suite.patch b/source-files/fix-test-suite.patch index aa08d36..2abd495 100644 --- a/source-files/fix-test-suite.patch +++ b/source-files/fix-test-suite.patch @@ -1,7 +1,33 @@ -From 545a2a561522efc2869066792062694b59b1b39c Mon Sep 17 00:00:00 2001 +https://github.com/ahupp/python-magic/commit/4ffcd59113fa26d7c2e9d5897b1eef919fd4b457 + +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 + +--- 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() + +From b434c88c9c8e901adf5b3779e3aac65f10d90aab 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 +Subject: [PATCH 1/2] Fix test suite with file 5.45 [ 12s] test/python_magic_test.py:53: in assert_values [ 12s] self.assertIn(value, expected_value) @@ -25,10 +51,10 @@ index 5719a58..7b4665b 100644 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 +index 624a443..78f63a3 100755 --- a/test/python_magic_test.py +++ b/test/python_magic_test.py -@@ -108,7 +108,8 @@ def test_descriptions(self): +@@ -108,7 +108,8 @@ class MagicTest(unittest.TestCase): self.assert_values(m, { 'magic._pyc_': 'python 2.4 byte-compiled', 'test.pdf': ('PDF document, version 1.2', @@ -38,3 +64,5 @@ index d51587c..410a149 100755 'test.gz': ('gzip compressed data, was "test", from Unix, last ' 'modified: Sun Jun 29 01:32:52 2008', +-- +2.43.0 diff --git a/source.sh b/source.sh index 20e9d2b..349b6f6 100644 --- a/source.sh +++ b/source.sh @@ -7,6 +7,7 @@ prepare() { cd "$BPM_SOURCE" patch -Np1 -i "$BPM_WORKDIR"/fix-test-suite.patch + patch -i "$BPM_WORKDIR"/file-5.47-fix.diff test/python_magic_test.py } # The build function is executed in the source directory @@ -18,7 +19,7 @@ build() { # The check function is executed in the source directory # This function is used to run tests to verify the package has been compiled correctly check() { - LC_ALL=en_US.UTF-8 pytest --deselect test/python_magic_test.py::MagicTest::test_extension + LC_ALL=en_US.UTF-8 pytest } # The package function is executed in the source directory