[med-svn] [Git][med-team/invesalius][master] Added patch to replace the use of the imghdr library, which was removed from Python 3.11.

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Mon Nov 18 12:34:06 GMT 2024



Michael R. Crusoe pushed to branch master at Debian Med / invesalius


Commits:
32b6b848 by Michael R. Crusoe at 2024-11-18T12:33:08+00:00
Added patch to replace the use of the imghdr library, which was removed from Python 3.11.

Closes: #1084567.

- - - - -


4 changed files:

- debian/changelog
- debian/control
- + debian/patches/python3.13
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+invesalius (3.1.99998-6) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Added patch to replace the use of the imghdr library, which was removed
+    from Python 3.11. Closes: #1084567.
+
+ -- Michael R. Crusoe <crusoe at debian.org>  Mon, 18 Nov 2024 12:31:39 +0000
+
 invesalius (3.1.99998-5) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -10,7 +10,8 @@ Build-Depends: debhelper-compat (= 13),
                cython3,
                dh-sequence-python3,
                imagemagick,
-               python3-numpy
+               python3-numpy,
+	       python3-puremagic
 Build-Depends-Indep: python3
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/med-team/invesalius
@@ -36,6 +37,7 @@ Depends: ${python3:Depends},
          python3-h5py,
          python3-imageio,
          python3-pubsub,
+	 python3-puremagic,
          invesalius-bin
 Recommends: python3-torch | python3-torch-cuda
 Description: 3D medical imaging reconstruction software


=====================================
debian/patches/python3.13
=====================================
@@ -0,0 +1,35 @@
+From: Michael R. Crusoe <crusoe at debian.org>
+Subject: Replaced deprecated/removed imghdr with puremagic package
+
+It was deprecated in Python 3.11 and removed in Python 3.13
+
+https://peps.python.org/pep-0594/#deprecated-modules
+
+--- a/invesalius/reader/bitmap_reader.py
++++ b/invesalius/reader/bitmap_reader.py
+@@ -16,7 +16,6 @@
+ #    PARTICULAR. Consulte a Licenca Publica Geral GNU para obter mais
+ #    detalhes.
+ # --------------------------------------------------------------------------
+-import imghdr
+ import os
+ import re
+ import sys
+@@ -31,6 +30,8 @@
+ from invesalius.pubsub import pub as Publisher
+ from vtk.util import numpy_support
+ 
++import puremagic
++
+ import invesalius.constants as const
+ import invesalius.data.converters as converters
+ import invesalius.utils as utils
+@@ -444,7 +445,7 @@
+ 
+ def VerifyDataType(filepath):
+     try:
+-        t = imghdr.what(filepath)
++        t = puremagic.what(filepath)
+         if t:
+             return t
+         else:


=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@
 11_rm_gdcm_trace.patch
 0005-Distutils-is-being-deprecated-using-setuptools.patch
 0006-mark-a-string-as-raw-to-deal-with-a-Windows-slash.patch
+python3.13



View it on GitLab: https://salsa.debian.org/med-team/invesalius/-/commit/32b6b848ff7c279f352ad7849434e18a516adc56

-- 
View it on GitLab: https://salsa.debian.org/med-team/invesalius/-/commit/32b6b848ff7c279f352ad7849434e18a516adc56
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241118/92d04728/attachment-0001.htm>


More information about the debian-med-commit mailing list