Skip to content

Commit

Permalink
fix: omit supports under Python 3.8
Browse files Browse the repository at this point in the history
  • Loading branch information
hiro-o918 committed Sep 23, 2024
1 parent a0d8d2b commit 4744560
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion luigi/mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from __future__ import annotations

import re
import sys
from typing import Callable, Dict, Final, Iterator, List, Literal, Optional

from mypy.expandtype import expand_type, expand_type_by_instance
Expand Down Expand Up @@ -60,7 +61,13 @@

METADATA_TAG: Final[str] = "task"

PARAMETER_FULLNAME_MATCHER: Final = re.compile(r"^luigi(\.parameter)?\.\w*Parameter$")
PARAMETER_FULLNAME_MATCHER: Final[re.Pattern] = re.compile(
r"^luigi(\.parameter)?\.\w*Parameter$"
)

if sys.version_info[:2] < (3, 8):
# This plugin uses the walrus operator, which is only available in Python 3.8+
raise RuntimeError("This plugin requires Python 3.8+")


class TaskPlugin(Plugin):
Expand Down

0 comments on commit 4744560

Please sign in to comment.