We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bfdfa62 commit a320f5dCopy full SHA for a320f5d
1 file changed
src/fastapi_cli/discover.py
@@ -44,24 +44,19 @@ class ModuleData:
44
def get_module_data_from_path(path: Path) -> ModuleData:
45
use_path = path.resolve()
46
module_path = use_path
47
-
48
if use_path.is_file() and use_path.stem == "__init__":
49
module_path = use_path.parent
50
51
module_paths = [module_path]
52
extra_sys_path = module_path.parent
53
54
for parent in module_path.parents:
55
init_path = parent / "__init__.py"
56
57
if init_path.is_file():
58
module_paths.insert(0, parent)
59
extra_sys_path = parent.parent
60
else:
61
break
62
63
module_str = ".".join(p.stem for p in module_paths)
64
65
return ModuleData(
66
module_import_str=module_str,
67
extra_sys_path=extra_sys_path.resolve(),
0 commit comments