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