Hi metaflow team. I am wondering what is the best ...
# dev-metaflow
w
Hi metaflow team. I am wondering what is the best way to change the behavior of how metaflow packages the scripts when it’s running a job. Specifically, I’d like to know if there’s a way to customize the working directory in
metaflow/package.py
(code):
Copy code
# the user's working directory
            flowdir = os.path.dirname(os.path.abspath(sys.argv[0])) + '/'
            for path_tuple in self._walk(flowdir):
                yield path_tuple
What I’m trying to do is to allow the script to import modules in parent directories during a metaflow run. For example, if I have the following modules, and want to run metaflow with
metaflow_flows/my_flow.py
Copy code
transformations/
  summation.py
metaflow_flows/
  my_flow.py
I’d like to be able to be able to write
from transformations import summation
inside
my_flow.py
1
s
unfortunately parent directories are not supported currently. In your case
my_flow.py
needs to be at the root. If you want to keep the file under
metaflow_flows
, you can create a symlink like this
Copy code
transformations/
  summation.py
metaflow_flows/
  my_flow.py
my_flow.py -> metaflow_flows/my_flow.py
🙌 1