Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dest_dir into pythonpath before loading modules #2692

Merged
merged 13 commits into from
Sep 23, 2024
3 changes: 3 additions & 0 deletions flytekit/bin/entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import pathlib
import signal
import subprocess
import sys
import tempfile
import traceback
from sys import exit
Expand Down Expand Up @@ -376,6 +377,8 @@ def _execute_task(
dynamic_addl_distro,
dynamic_dest_dir,
) as ctx:
if all(os.path.realpath(path) != dynamic_dest_dir for path in sys.path):
sys.path.append(dynamic_dest_dir)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add dest_dir to PYTHONPATH instead of dynamic_dest_dir

resolver_obj = load_object_from_module(resolver)
# Use the resolver to load the actual task object
_task_def = resolver_obj.load_task(loader_args=resolver_args)
Expand Down
Loading