We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c6a14b commit 712a703Copy full SHA for 712a703
discovery.py
@@ -149,12 +149,22 @@ def is_python(path: pathlib.Path) -> bool:
149
return path.suffix == '.py'
150
151
152
+def base(module):
153
+ """
154
+ >>> base(pathlib.Path('foo/bar/bin.py'))
155
+ 'coherent.build.foo.bar'
156
+ >>> base(pathlib.Path('foo.py'))
157
+ 'coherent.build'
158
159
+ return '.'.join((best_name(),) + module.parent.parts)
160
+
161
162
def inferred_deps():
163
"""
164
Infer deps from module imports.
165
166
names = [
- (imp.relative_to(best_name()), module)
167
+ (imp.relative_to(base(module)), module)
168
for module in filter(is_python, source_files())
169
for imp in imports.get_module_imports(module)
170
if not imp.standard()
0 commit comments