Repository: datalad/datalad-next

Issue:
Add cannonical import for `ConfigManager` class
This is an essential component, and we need the import, at minimum, for type annotation.

Comments:

Patch:
diff --git a/datalad_next/config/__init__.py b/datalad_next/config/__init__.py
new file mode 100644
index 0000000..cd5bc53
--- /dev/null
+++ b/datalad_next/config/__init__.py
@@ -0,0 +1,1 @@
+from datalad.config import ConfigManager
diff --git a/datalad_next/credman/manager.py b/datalad_next/credman/manager.py
index c5a6bf7..60124e2 100644
--- a/datalad_next/credman/manager.py
+++ b/datalad_next/credman/manager.py
@@ -26,6 +26,7 @@ from typing import (
 )
 
 import datalad
+from datalad_next.config import ConfigManager
 from datalad_next.exceptions import (
     CapturedException,
     CommandError,
@@ -78,7 +79,7 @@ class CredentialManager(object):
         'user_password': 'password',
     }
 
-    def __init__(self, cfg=None):
+    def __init__(self, cfg: ConfigManager | None = None):
         """
 
         Parameters
diff --git a/datalad_next/url_operations/__init__.py b/datalad_next/url_operations/__init__.py
index d6f1edf..d4c218e 100644
--- a/datalad_next/url_operations/__init__.py
+++ b/datalad_next/url_operations/__init__.py
@@ -11,6 +11,7 @@ from typing import (
 )
 
 import datalad
+from datalad_next.config import ConfigManager
 from datalad_next.utils import log_progress
 from datalad_next.utils.multihash import (
     MultiHash,
@@ -35,7 +36,7 @@ class UrlOperations:
     This class provides a range of helper methods to aid computation of
     hashes and progress reporting.
     """
-    def __init__(self, *, cfg=None):
+    def __init__(self, *, cfg: ConfigManager | None = None):
         """
         Parameters
         ----------
@@ -46,7 +47,7 @@ class UrlOperations:
         self._cfg = cfg
 
     @property
-    def cfg(self):
+    def cfg(self) -> ConfigManager:
 
         if self._cfg is None:
             self._cfg = datalad.cfg
diff --git a/datalad_next/url_operations/any.py b/datalad_next/url_operations/any.py
index 258141d..9b2cd75 100644
--- a/datalad_next/url_operations/any.py
+++ b/datalad_next/url_operations/any.py
@@ -10,6 +10,7 @@ from pathlib import Path
 import re
 from typing import Dict
 
+from datalad_next.config import ConfigManager
 from datalad_next.exceptions import CapturedException
 
 from . import UrlOperations
@@ -59,7 +60,7 @@ class AnyUrlOperations(UrlOperations):
     operations, such that held connections or cached credentials can be reused
     efficiently.
     """
-    def __init__(self, cfg=None):
+    def __init__(self, cfg: ConfigManager | None = None):
         """
         Parameters
         ----------
diff --git a/docs/source/pyutils.rst b/docs/source/pyutils.rst
index ead2205..ef8e24c 100644
--- a/docs/source/pyutils.rst
+++ b/docs/source/pyutils.rst
@@ -8,6 +8,7 @@ Python utilities
    :toctree: generated
 
    commands.ValidatedInterface
+   config.ConfigManager
    constraints
    credman.manager
    exceptions


Test patch:
diff --git a/datalad_next/credman/tests/test_credman.py b/datalad_next/credman/tests/test_credman.py
index aafa36c..08b17eb 100644
--- a/datalad_next/credman/tests/test_credman.py
+++ b/datalad_next/credman/tests/test_credman.py
@@ -11,7 +11,7 @@
 """
 import pytest
 
-from datalad.config import ConfigManager
+from datalad_next.config import ConfigManager
 from ..manager import (
     CredentialManager,
     _get_cred_cfg_var,