<#707 Fix(deploy): improve duplicate environment e...
# flyte-github
a
#707 Fix(deploy): improve duplicate environment error message to hint at --root-dir Pull request opened by AdilFayyaz Summary: When a project uses a src/ layout and flyte deploy is run from the project root without
--root-dir src
, the same module gets imported twice under different names (my_module.envs and src.my_module.envs), creating two distinct TaskEnvironment objects with the same name. This produces a cryptic "Duplicate environment name" error with no guidance on the cause. This PR: 1. Improves the error messages in _deploy.py to explain the dual-import root cause and suggest passing
--root-dir src
2. Adds a new example
(examples/project_structures/uv_project_src_layout/)
that reproduces the issue To reproduce with the new example:
cd examples/project_structures/uv_project_src_layout/my_project && uv sync
flyte deploy --dry-run --recursive src/my_module
# fails with improved error
flyte deploy --dry-run --recursive --root-dir src src/my_module
# succeeds flyteorg/flyte-sdk