You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, when having the following example directory structure:
src/benchmarks.py/main.py
executing runner.run("benchmarks.py", ...) from inside the src directory results in an importlib error:
Apparently, the ismodule check falls through to the very last import attempt, which fails since the found module does not have a __path__ set.
This is an indication that the discovery branch is backwards - to fix, we can try calling path.is_{file,dir}() on the input first, and only then try to understand it as a module name.
This should be safe since the Python file has a suffix .py, which eliminates collisions between e.g. __main__ (the module name) and __main__.py.
Also, once it's fixed, docs should be updated.
The text was updated successfully, but these errors were encountered:
Currently, when having the following example directory structure:
executing
runner.run("benchmarks.py", ...)
from inside thesrc
directory results in an importlib error:Apparently, the
ismodule
check falls through to the very last import attempt, which fails since the found module does not have a__path__
set.This is an indication that the discovery branch is backwards - to fix, we can try calling
path.is_{file,dir}()
on the input first, and only then try to understand it as a module name.This should be safe since the Python file has a suffix
.py
, which eliminates collisions between e.g.__main__
(the module name) and__main__.py
.Also, once it's fixed, docs should be updated.
The text was updated successfully, but these errors were encountered: