add check for lower bound of lark (#4287)

This commit is contained in:
Harrison Chase 2023-05-08 08:31:05 -07:00 committed by GitHub
parent c8b0b6e6c1
commit f510940bde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,13 @@
from typing import Any, Optional, Sequence, Union from typing import Any, Optional, Sequence, Union
try: try:
import lark
from packaging import version
if version.parse(lark.__version__) < version.parse("1.1.5"):
raise ValueError(
f"Lark should be at least version 1.1.5, got {lark.__version__}"
)
from lark import Lark, Transformer, v_args from lark import Lark, Transformer, v_args
except ImportError: except ImportError:
pass pass