diff --git a/tests/unit/test_logging/test_logging_config.py b/tests/unit/test_logging/test_logging_config.py index 1eba43f0da..3423184efc 100644 --- a/tests/unit/test_logging/test_logging_config.py +++ b/tests/unit/test_logging/test_logging_config.py @@ -124,7 +124,7 @@ def test_dictconfig_on_startup(logging_module: str, dict_config_not_called: str) [ [ "logging", - "logging.QueueHandler" + "logging.handlers.QueueHandler" if sys.version_info >= (3, 12, 0) else "litestar.logging.standard.QueueListenerHandler", "litestar.logging.standard.LoggingQueueListener", @@ -150,6 +150,10 @@ def test_default_queue_listener_handler( elif expected_handler_class_str == "litestar.logging.picologging.QueueListenerHandler": from litestar.logging.picologging import QueueListenerHandler + expected_handler_class = QueueListenerHandler + elif expected_handler_class_str == "logging.handlers.QueueHandler": + from logging.handlers import QueueHandler as QueueListenerHandler + expected_handler_class = QueueListenerHandler else: expected_handler_class = importlib.import_module(expected_handler_class_str) @@ -221,7 +225,7 @@ def test_get_logger_without_logging_config() -> None: [ [ "logging", - "logging.QueueHandler" + "logging.handlers.QueueHandler" if sys.version_info >= (3, 12, 0) else "litestar.logging.standard.QueueListenerHandler", ], @@ -237,6 +241,10 @@ def test_default_loggers(logging_module_str: str, expected_handler_class_str: st elif expected_handler_class_str == "litestar.logging.picologging.QueueListenerHandler": from litestar.logging.picologging import QueueListenerHandler + expected_handler_class = QueueListenerHandler + elif expected_handler_class_str == "logging.handlers.QueueHandler": + from logging.handlers import QueueHandler as QueueListenerHandler + expected_handler_class = QueueListenerHandler else: expected_handler_class = importlib.import_module(expected_handler_class_str) @@ -260,7 +268,7 @@ def test_default_loggers(logging_module_str: str, expected_handler_class_str: st [ [ "logging", - "litestar.logging.standard.QueueListenerHandler" + "logging.handlers.QueueHandler" if sys.version_info >= (3, 12, 0) else "litestar.logging.standard.QueueListenerHandler", ], @@ -276,6 +284,10 @@ def test_connection_logger(logging_module_str: str, expected_handler_class_str: elif expected_handler_class_str == "litestar.logging.picologging.QueueListenerHandler": from litestar.logging.picologging import QueueListenerHandler + expected_handler_class = QueueListenerHandler + elif expected_handler_class_str == "logging.handlers.QueueHandler": + from logging.handlers import QueueHandler as QueueListenerHandler + expected_handler_class = QueueListenerHandler else: expected_handler_class = importlib.import_module(expected_handler_class_str) @@ -329,7 +341,7 @@ def test_validation(logging_module_str: Optional[str]) -> None: [ [ "logging", - "logging.QueueHandler" + "logging.handlers.QueueHandler" if sys.version_info >= (3, 12, 0) else "litestar.logging.standard.QueueListenerHandler", ], @@ -345,6 +357,10 @@ def test_root_logger(logging_module_str: str, expected_handler_class_str: str) - elif expected_handler_class_str == "litestar.logging.picologging.QueueListenerHandler": from litestar.logging.picologging import QueueListenerHandler + expected_handler_class = QueueListenerHandler + elif expected_handler_class_str == "logging.handlers.QueueHandler": + from logging.handlers import QueueHandler as QueueListenerHandler + expected_handler_class = QueueListenerHandler else: expected_handler_class = importlib.import_module(expected_handler_class_str) @@ -383,7 +399,7 @@ def test_root_logger_no_config(logging_module_str: str) -> None: [ "logging", True, - "logging.QueueHandler" + "logging.handlers.QueueHandler" if sys.version_info >= (3, 12, 0) else "litestar.logging.standard.QueueListenerHandler", ], @@ -408,6 +424,10 @@ def test_customizing_handler( elif expected_root_logger_handler_class_str == "litestar.logging.picologging.QueueListenerHandler": from litestar.logging.picologging import QueueListenerHandler + expected_root_logger_handler_class = QueueListenerHandler + elif expected_root_logger_handler_class_str == "logging.handlers.QueueHandler": + from logging.handlers import QueueHandler as QueueListenerHandler + expected_root_logger_handler_class = QueueListenerHandler else: expected_root_logger_handler_class = importlib.import_module(expected_root_logger_handler_class_str) diff --git a/uv.lock b/uv.lock index 1f539da398..100704f454 100644 --- a/uv.lock +++ b/uv.lock @@ -1823,8 +1823,7 @@ full = [ { name = "picologging", marker = "python_full_version < '3.13'" }, { name = "prometheus-client" }, { name = "pydantic" }, - { name = "pydantic-extra-types", version = "2.9.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" }, - { name = "pydantic-extra-types", version = "2.10.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9'" }, + { name = "pydantic-extra-types" }, { name = "pyjwt" }, { name = "redis", extra = ["hiredis"] }, { name = "structlog" }, @@ -1860,8 +1859,7 @@ prometheus = [ pydantic = [ { name = "email-validator" }, { name = "pydantic" }, - { name = "pydantic-extra-types", version = "2.9.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.9'" }, - { name = "pydantic-extra-types", version = "2.10.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.9'" }, + { name = "pydantic-extra-types" }, ] redis = [ { name = "redis", extra = ["hiredis"] }, @@ -3145,39 +3143,14 @@ wheels = [ name = "pydantic-extra-types" version = "2.9.0" source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.8.1' and python_full_version < '3.9' and sys_platform != 'win32'", - "python_full_version < '3.8.1' and sys_platform != 'win32'", - "python_full_version >= '3.8.1' and python_full_version < '3.9' and sys_platform == 'win32'", - "python_full_version < '3.8.1' and sys_platform == 'win32'", -] dependencies = [ - { name = "pydantic", marker = "python_full_version < '3.9'" }, + { name = "pydantic" }, ] sdist = { url = "https://files.pythonhosted.org/packages/fb/95/d61dcadd933cb34461adc271c13bbe14a7080b9922b9e0dc3c1d18b421cb/pydantic_extra_types-2.9.0.tar.gz", hash = "sha256:e061c01636188743bb69f368dcd391f327b8cfbfede2fe1cbb1211b06601ba3b", size = 39578 } wheels = [ { url = "https://files.pythonhosted.org/packages/37/2f/efc4877d1a1536ec76ca0114c3e9dee7d0a10a262c53d384d50163f5684c/pydantic_extra_types-2.9.0-py3-none-any.whl", hash = "sha256:f0bb975508572ba7bf3390b7337807588463b7248587e69f43b1ad7c797530d0", size = 30544 }, ] -[[package]] -name = "pydantic-extra-types" -version = "2.10.1" -source = { registry = "https://pypi.org/simple" } -resolution-markers = [ - "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform != 'win32'", - "python_full_version >= '3.9' and python_full_version < '3.13' and sys_platform == 'win32'", - "python_full_version >= '3.13' and sys_platform != 'win32'", - "python_full_version >= '3.13' and sys_platform == 'win32'", -] -dependencies = [ - { name = "pydantic", marker = "python_full_version >= '3.9'" }, - { name = "typing-extensions", marker = "python_full_version >= '3.9'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/c3/12/844a4796dbbc814ef0a706f403cb0f3029bf324c2bca2bf0681f4f7d8618/pydantic_extra_types-2.10.1.tar.gz", hash = "sha256:e4f937af34a754b8f1fa228a2fac867091a51f56ed0e8a61d5b3a6719b13c923", size = 85694 } -wheels = [ - { url = "https://files.pythonhosted.org/packages/a8/f1/92f7b4711d3d0d08981c2677ec9cdde6cb114205a69814bf803e0be5ae9b/pydantic_extra_types-2.10.1-py3-none-any.whl", hash = "sha256:db2c86c04a837bbac0d2d79bbd6f5d46c4c9253db11ca3fdd36a2b282575f1e2", size = 35155 }, -] - [[package]] name = "pydata-sphinx-theme" version = "0.14.4"