Skip to content

Commit

Permalink
Remove TypeAlias import workaround
Browse files Browse the repository at this point in the history
pyright now seems to understand the `_compat` import properly.
  • Loading branch information
Viicos committed Oct 1, 2024
1 parent 534830e commit 1545cc0
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "python-jsonlogic"
description = "An extensible and sane implementation of JsonLogic"
version = "0.1.0"
version = "0.2.0"
readme = "README.rst"
authors = [
{name = "Victorien", email = "contact@vctrn.dev"}
Expand Down Expand Up @@ -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 = [
Expand Down
3 changes: 0 additions & 3 deletions src/jsonlogic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/jsonlogic/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1545cc0

Please sign in to comment.