acoustic-carpenter-78188
02/28/2026, 2:49 AMload_python_modules with recursive=True used path.glob("**/*.py") which blindly recursed into .venv directories, attempting to import ~1800+ installed package files when running flyte deploy --all --recursive packages from a uv workspace
• Replaced glob with os.walk + IgnoreGroup(StandardIgnore, GitIgnore) filtering, matching the pattern already used in bundle.py and _packaging.py
• Resolved paths to absolute before passing to IgnoreGroup to handle the CLI's relative path arguments correctly
Test plan
• Added tests/flyte/utils/test_module_loader.py with two tests:
• test_load_python_modules_skips_venv — verifies .venv files are excluded with absolute paths
• test_load_python_modules_skips_venv_with_relative_paths — verifies the fix works with relative paths matching real CLI behavior (path=Path("packages"), root_dir=Path.cwd())
• Existing tests pass: pytest tests/flyte/code_bundle/test_ignore.py
• Manual: cd examples/project_structures/uv_workspace/albatross && flyte -vvv deploy --all --recursive packages should skip .venv files
flyteorg/flyte-sdkacoustic-carpenter-78188
03/01/2026, 5:02 AM