From 131bc2300e7c6956463d5e01fb5676b90c8615ed Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Thu, 22 Aug 2024 14:03:58 -0400 Subject: [PATCH] fix: Fix a mypy failure in the generate action The `import uvloop` line here needs to: * Ignore a pylint `import-outside-toplevel` warning * Ignore a mypy error if stubs are not present (uvloop is not a dependency, so it's not actually installed in CI) These comments were not ignoring both errors, turns out we need to flip the order. --- src/unstructured_client/_hooks/custom/split_pdf_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unstructured_client/_hooks/custom/split_pdf_hook.py b/src/unstructured_client/_hooks/custom/split_pdf_hook.py index 1f280c82..221fc2cf 100644 --- a/src/unstructured_client/_hooks/custom/split_pdf_hook.py +++ b/src/unstructured_client/_hooks/custom/split_pdf_hook.py @@ -76,7 +76,7 @@ async def run_tasks(coroutines: list[Coroutine], allow_failed: bool = False) -> def context_is_uvloop(): """Return true if uvloop is installed and we're currently in a uvloop context. Our asyncio splitting code currently doesn't work under uvloop.""" try: - import uvloop # pylint: disable=import-outside-toplevel # type: ignore + import uvloop # type: ignore[import] # pylint: disable=import-outside-toplevel loop = asyncio.get_event_loop() return isinstance(loop, uvloop.Loop) except (ImportError, RuntimeError):