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
As dynamic module import are performed in import_submodules in the migrate cli tool, the project root needs to be in sys.path for the dynamic imports to work. In the case where pyenv is used, as the binaries are not stored with the project, the cli tool is not able to find the project root and ìmport_submodules` will always fail.
My current fix is to change import submodules to:
defimport_submodules(root_module_name: str):
"""Import all submodules of a module, recursively."""# TODO: Call this without specifying a module name, to import everything?# --- Added code ---importosimportsyssys.path.insert(0, os.getcwd())
# --- Existing code ---root_module=importlib.import_module(root_module_name)
The text was updated successfully, but these errors were encountered:
As dynamic module import are performed in
import_submodules
in themigrate
cli tool, the project root needs to be insys.path
for the dynamic imports to work. In the case where pyenv is used, as the binaries are not stored with the project, the cli tool is not able to find the project root and ìmport_submodules` will always fail.My current fix is to change import submodules to:
The text was updated successfully, but these errors were encountered: