Skip to content

Commit e36e455

Browse files
authored
Fix import hierarchy: Move debug_utils to core package (#175)
* Import modules not classes per Google style Adds backward compat re-exports for API stability * Refactor imports for better module compatibility - Switch from lazy to direct registration in tests to avoid module path dependencies - Update import style to use module imports instead of class imports - Add compatibility checks for sandboxed build environments - Fix debug_utils imports to work with flattened directory structures - Add environment detection to skip incompatible tests in restricted contexts This improves build system compatibility and makes the codebase more robust across different deployment environments. * Move debug_utils to core package to fix import hierarchy
1 parent c4a1343 commit e36e455

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

langextract/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def visualize(*args: Any, **kwargs: Any):
6666
"chunking": "langextract.chunking",
6767
"data": "langextract.data",
6868
"data_lib": "langextract.data_lib",
69-
"debug_utils": "langextract.debug_utils",
69+
"debug_utils": "langextract.core.debug_utils",
7070
"exceptions": "langextract.exceptions",
7171
"factory": "langextract.factory",
7272
"inference": "langextract.inference",
File renamed without changes.

langextract/core/tokenizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import enum
2929
import re
3030

31-
from langextract import debug_utils
31+
from langextract.core import debug_utils
3232
from langextract.core import exceptions
3333

3434

langextract/extraction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def extract(
148148

149149
if debug:
150150
# pylint: disable=import-outside-toplevel
151-
from langextract import debug_utils
151+
from langextract.core import debug_utils
152152

153153
debug_utils.configure_debug_logging()
154154

0 commit comments

Comments
 (0)