{"record":{"id":"61763d54eb46d181","repo":"langflow-ai/langflow","slug":"no-py-files-under-in-tree-nothing-to-port","errorCode":null,"errorMessage":"No ``*.py`` files under {in_tree}; nothing to port.","messagePattern":"No ``\\*\\.py`` files under (.+?); nothing to port\\.","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"scripts/migrate/port_bundle.py","lineNumber":735,"sourceCode":"            nested_subdirs.append(src)\n            continue\n        if not src.is_file() or src.suffix != \".py\":\n            continue\n        text = src.read_text(encoding=\"utf-8\")\n        if \"from langflow\" in text:\n            msg = (\n                f\"{src} imports from ``langflow`` -- the bundle is installed \"\n                \"against the public BUNDLE_API surface (lfx), not Langflow \"\n                \"internals.  Either rewrite the import or leave the component \"\n                \"in-tree.  See src/bundles/PORTING.md § 0.\"\n            )\n            raise SystemExit(msg)\n        classes = () if src.name == \"__init__.py\" else _discover_classes(text)\n        component_files.append(ComponentFile(path=src, classes=classes))\n\n    if not component_files and not nested_subdirs:\n        msg = f\"No ``*.py`` files under {in_tree}; nothing to port.\"\n        raise SystemExit(msg)\n\n    if migration_release is not None and not re.fullmatch(r\"\\d+\\.\\d+\\.\\d+\", migration_release):\n        msg = f\"--migration-release {migration_release!r} must be a three-segment SemVer (e.g. 1.10.0).\"\n        raise SystemExit(msg)\n\n    resolved_display = display_name if display_name is not None else bundle.replace(\"_\", \" \").title()\n\n    shared_base = LFX_BASE / bundle\n    shared_base_dir = shared_base if shared_base.is_dir() else None\n\n    backend_test_dirs = _discover_backend_test_dirs(bundle)\n    ruff_ignores = _discover_ruff_ignores(bundle)\n    base_extra_present = _discover_base_extra(bundle)\n\n    legacy_dynamic, legacy_all = _parse_legacy_init(in_tree / \"__init__.py\")\n\n    consumer_rewrites: tuple[ConsumerRewrite, ...] = ()\n    if discover_consumers:","sourceCodeStart":717,"sourceCodeEnd":753,"githubUrl":"https://github.com/langflow-ai/langflow/blob/976ec789d2886a86de109c044d089d68e96c9a35/scripts/migrate/port_bundle.py#L717-L753","documentation":"After scanning the in-tree provider directory, port_bundle.py requires at least one porting unit: either a top-level *.py file or a nested subpackage. If the directory contains no Python files at all (only __pycache__, data files, or nothing), there is nothing to mechanically port and the script exits with 'No *.py files under <path>; nothing to port.'","triggerScenarios":"Running port_bundle.py --bundle <name> on an emptied or never-populated provider directory — e.g. one whose modules were already deleted in a prior cleanup but whose folder remained.","commonSituations":"Leftover empty directories after a partial migration; placeholder provider dirs; files with wrong extensions (.py.txt) after a bad merge.","solutions":["List the directory shown in the error: `ls -la <in-tree path>` to confirm it is empty of *.py.","If it is debris, delete the directory instead of porting it.","If modules should exist, restore them from git (`git checkout <ref> -- <dir>`) and re-run."],"exampleFix":"# before\nls src/lfx/src/lfx/components/legacy  # only __pycache__\npython scripts/migrate/port_bundle.py --bundle legacy\n# error: No ``*.py`` files under ...; nothing to port.\n\n# after\ngit rm -r src/lfx/src/lfx/components/legacy  # remove debris instead of porting","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef has_portable_units(provider_dir: Path) -> bool:\n    top = any(p.suffix == \".py\" for p in provider_dir.iterdir())\n    nested = any(p.is_dir() and p.name != \"__pycache__\" for p in provider_dir.iterdir())\n    return top or nested","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Delete empty provider directories as debris instead of trying to port them.","If modules are expected but missing, restore from git before running the script."],"tags":["migration","filesystem","validation","cli"],"backgroundTag":null,"analyzedSha":"976ec789d2886a86de109c044d089d68e96c9a35","analyzedAt":"2026-08-14T18:23:12.227Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}