Hi,
Made a patch to fix the ModuleNotFoundError with Py 3.12. Attaching the
debdiff file.
Cheers!
diff -Nru python-ml-collections-0.1.1/debian/changelog 
python-ml-collections-0.1.1/debian/changelog
--- python-ml-collections-0.1.1/debian/changelog        2023-04-01 
05:59:28.000000000 +0000
+++ python-ml-collections-0.1.1/debian/changelog        2024-01-08 
20:00:00.000000000 +0000
@@ -1,3 +1,13 @@
+python-ml-collections (0.1.1-3) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Included a patch for ml_collections/config_flags/config_flags.py
+    to replace deprecated imp with importlib to fix ModuleNotFoundError
+    in Python 3.12. (Closes: #1058106)
+  * Added python3-absl, python3-contextlib2, python3-yaml to test-deps.
+
+ -- Yogeswaran Umasankar <kd8...@gmail.com>  Mon, 08 Jan 2024 20:00:00 +0000
+
 python-ml-collections (0.1.1-2) unstable; urgency=medium
 
   * Team Upload.
diff -Nru 
python-ml-collections-0.1.1/debian/patches/002_imp-module-replacement.patch 
python-ml-collections-0.1.1/debian/patches/002_imp-module-replacement.patch
--- python-ml-collections-0.1.1/debian/patches/002_imp-module-replacement.patch 
1970-01-01 00:00:00.000000000 +0000
+++ python-ml-collections-0.1.1/debian/patches/002_imp-module-replacement.patch 
2024-01-08 20:00:00.000000000 +0000
@@ -0,0 +1,24 @@
+Description: Implemented importlib to fix ModuleNotFoundError with Python 3.12.
+Author: Yogeswaran Umasankar <kd8...@gmail.com>
+Last-Update: 2024-01-08
+
+--- a/ml_collections/config_flags/config_flags.py
++++ b/ml_collections/config_flags/config_flags.py
+@@ -16,7 +16,7 @@
+ """Configuration commmand line parser."""
+ 
+ import errno
+-import imp
++import importlib
+ import os
+ import re
+ import sys
+@@ -450,7 +450,7 @@ def _LoadConfigModule(name: str, path: s
+ 
+   # Works for relative paths.
+   with ignoring_errors.Attempt('Relative path', path):
+-    config_module = imp.load_source(name, path)
++    config_module = importlib.load_source(name, path)
+     return config_module
+ 
+   # Nothing worked. Log the paths that were attempted.
diff -Nru python-ml-collections-0.1.1/debian/patches/series 
python-ml-collections-0.1.1/debian/patches/series
--- python-ml-collections-0.1.1/debian/patches/series   2023-04-01 
05:50:43.000000000 +0000
+++ python-ml-collections-0.1.1/debian/patches/series   2024-01-08 
20:00:00.000000000 +0000
@@ -1 +1,2 @@
 noRequirements.patch
+002_imp-module-replacement.patch
diff -Nru python-ml-collections-0.1.1/debian/tests/control 
python-ml-collections-0.1.1/debian/tests/control
--- python-ml-collections-0.1.1/debian/tests/control    2023-04-01 
05:56:46.000000000 +0000
+++ python-ml-collections-0.1.1/debian/tests/control    2024-01-08 
20:00:00.000000000 +0000
@@ -1,3 +1,3 @@
 Tests: run-unit-test
-Depends: @, bazel-bootstrap, python3-mock, python-is-python3
+Depends: @, bazel-bootstrap, python3-mock, python-is-python3, python3-absl, 
python3-contextlib2, python3-yaml
 Restrictions: allow-stderr, skip-not-installable

Attachment: signature.asc
Description: PGP signature



Reply via email to