From e1c6e5ccf523451d8a3d39cdf0863e965e737c2c Mon Sep 17 00:00:00 2001 From: Viicos <65306057+Viicos@users.noreply.github.com> Date: Tue, 1 Oct 2024 22:14:37 +0200 Subject: [PATCH] Remove `TypeAlias` import workaround pyright now seems to understand the `_compat` import properly. --- pyproject.toml | 2 +- src/jsonlogic/core.py | 3 --- src/jsonlogic/typing.py | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 5fe171c..89abfaf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,7 +46,7 @@ src = ["src"] target-version = "py38" [tool.ruff.lint] -typing-modules = ["_compat"] +typing-modules = ["jsonlogic._compat"] preview = true explicit-preview-rules = true select = [ diff --git a/src/jsonlogic/core.py b/src/jsonlogic/core.py index a018f55..3c36135 100644 --- a/src/jsonlogic/core.py +++ b/src/jsonlogic/core.py @@ -13,9 +13,6 @@ from .typing import JSON, JSONLogicPrimitive, JSONObject, OperatorArgument if TYPE_CHECKING: - # This is a hack to make Pylance think `TypeAlias` comes from `typing` - from typing import TypeAlias - from .evaluation import EvaluationContext from .registry import OperatorRegistry from .typechecking import TypecheckContext diff --git a/src/jsonlogic/typing.py b/src/jsonlogic/typing.py index e951633..46f8389 100644 --- a/src/jsonlogic/typing.py +++ b/src/jsonlogic/typing.py @@ -7,9 +7,6 @@ from ._compat import TypeAlias if TYPE_CHECKING: - # This is a hack to make Pylance think `TypeAlias` comes from `typing` - from typing import TypeAlias - from jsonlogic.core import Operator JSONPrimitive: TypeAlias = "str | int | float | bool | None"