Skip to content

Commit

Permalink
Supports importing modules in current path (#2830)
Browse files Browse the repository at this point in the history
Signed-off-by: Ketan Umare <[email protected]>
Co-authored-by: Ketan Umare <[email protected]>
  • Loading branch information
kumare3 and kumare3 committed Nov 8, 2024
1 parent b7c7c13 commit 9d8861b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flytekit/interaction/click_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import logging
import os
import pathlib
import sys
import typing
import typing as t
from typing import cast, get_args
Expand Down Expand Up @@ -149,6 +150,7 @@ def convert(
click.echo(f"Did not receive a string in the expected format <MODULE>:<VAR>, falling back to: {value}")
return value
try:
sys.path.insert(0, "")
m = importlib.import_module(parts[0])
return m.__getattribute__(parts[1])
except ModuleNotFoundError as e:
Expand Down

0 comments on commit 9d8861b

Please sign in to comment.