From fe88a77baf02704130bd74de27125e28366ccf80 Mon Sep 17 00:00:00 2001 From: Yusuke Watanabe Date: Mon, 27 Apr 2026 05:10:46 +0900 Subject: [PATCH] =?UTF-8?q?chore(logging):=20convert=20explicit=20re-expor?= =?UTF-8?q?t=20shim=20=E2=86=92=20sys.modules-alias=20bridge?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit scitex-logging is already a standalone package; the umbrella was using an explicit re-export of ~50 symbols (which means the list drifts whenever scitex-logging adds new APIs). Replace with the same sys.modules alias pattern used by every other extracted module so: * `scitex.logging is scitex_logging` * Any new public name added to scitex_logging is automatically visible. Also remove the empty scitex/logging/llm/__pycache__ leftover that had no real source files behind it. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/scitex/logging/__init__.py | 155 ++++----------------------------- 1 file changed, 18 insertions(+), 137 deletions(-) diff --git a/src/scitex/logging/__init__.py b/src/scitex/logging/__init__.py index fbc15b6b..4f214909 100755 --- a/src/scitex/logging/__init__.py +++ b/src/scitex/logging/__init__.py @@ -1,140 +1,21 @@ -#!/usr/bin/env python3 -"""SciTeX logging — delegates to scitex-logging.""" +"""SciTeX logging — thin compatibility shim for scitex-logging. -from scitex_logging import ( - CRITICAL, - DEBUG, - ERROR, - FAIL, - INFO, - SUCCESS, - WARNING, - AuthenticationError, - AxisError, - BibTeXEnrichmentError, - ConfigFileNotFoundError, - ConfigKeyError, - ConfigurationError, - DataError, - DataLossWarning, - DOIResolutionError, - DTypeError, - EnrichmentError, - FigureNotFoundError, - FileFormatError, - InvalidPathError, - IOError, - LoadError, - ModelError, - NNError, - PathError, - PathNotFoundError, - PDFDownloadError, - PDFExtractionError, - PerformanceWarning, - PlottingError, - SaveError, - ScholarError, - SciTeXDeprecationWarning, - SciTeXError, - SciTeXWarning, - SearchError, - ShapeError, - StatsError, - StyleWarning, - Tee, - TemplateError, - TemplateViolationError, - TestError, - TranslatorError, - UnitWarning, - check_file_exists, - check_path, - check_shape_compatibility, - configure, - enable_file_logging, - filterwarnings, - get_level, - get_log_path, - getLogger, - is_file_logging_enabled, - llm, - log_to_file, - resetwarnings, - set_level, - tee, - warn, - warn_data_loss, - warn_deprecated, - warn_performance, -) +Aliases ``scitex.logging`` to the standalone ``scitex_logging`` package via +``sys.modules`` so ``scitex.logging is scitex_logging`` and every +sub-namespace + symbol resolves identically. -__all__ = [ - "getLogger", - "DEBUG", - "INFO", - "WARNING", - "ERROR", - "CRITICAL", - "SUCCESS", - "FAIL", - "llm", - "configure", - "set_level", - "get_level", - "enable_file_logging", - "is_file_logging_enabled", - "get_log_path", - "Tee", - "tee", - "log_to_file", - "SciTeXWarning", - "UnitWarning", - "StyleWarning", - "SciTeXDeprecationWarning", - "PerformanceWarning", - "DataLossWarning", - "warn", - "filterwarnings", - "resetwarnings", - "warn_deprecated", - "warn_performance", - "warn_data_loss", - "SciTeXError", - "ConfigurationError", - "ConfigFileNotFoundError", - "ConfigKeyError", - "IOError", - "FileFormatError", - "SaveError", - "LoadError", - "ScholarError", - "SearchError", - "EnrichmentError", - "PDFDownloadError", - "DOIResolutionError", - "PDFExtractionError", - "BibTeXEnrichmentError", - "TranslatorError", - "AuthenticationError", - "PlottingError", - "FigureNotFoundError", - "AxisError", - "DataError", - "ShapeError", - "DTypeError", - "PathError", - "InvalidPathError", - "PathNotFoundError", - "TemplateError", - "TemplateViolationError", - "NNError", - "ModelError", - "StatsError", - "TestError", - "check_path", - "check_file_exists", - "check_shape_compatibility", -] +Install: ``pip install scitex-logging`` (already a core dep of ``scitex``). +See: https://github.com/ywatanabe1989/scitex-logging +""" -# EOF +import sys as _sys + +try: + import scitex_logging as _real +except ImportError as _e: # pragma: no cover + raise ImportError( + "scitex.logging requires the 'scitex-logging' package. " + "Install with: pip install scitex-logging" + ) from _e + +_sys.modules[__name__] = _real