<#835 account for duplicate env deployment> Pull r...
# flyte-github
a
#835 account for duplicate env deployment Pull request opened by dansola when env_data depends on env_train:
Copy code
env_train = flyte.TaskEnvironment(name="training", image=env_train_image)
env_data = flyte.TaskEnvironment(name="data-prep", image=env_data_image, depends_on=[env_train])
Copy code
flyte.deploy(env_data, copy_style="none", version="3.0.0")
will deploy both.
Copy code
flyte.deploy(env_data, copy_style="none", version="3.0.0")
flyte.deploy(env_train, copy_style="none", version="3.0.0")
also works. but
Copy code
flyte.deploy(env_data, env_train, copy_style="none", version="3.0.0")
gives:
Copy code
ValueError: Environment 'training' is defined in '/Users/danielsola/repos/multi_image_repro/v2_guide/remote_builder/main.py' but was imported twice under different module names ('__main__' and '__main__'). This is usually caused by running `flyte deploy` from the project root of a src/ layout project without --root-dir. Try adding --root-dir src (or your source root directory)
I think that we should be able to accommodate this pattern by adding
_check_duplicate_env
to each env in
plan_deploy
flyteorg/flyte-sdk