shy-musician-55524
12/13/2021, 5:13 PMbillowy-army-68599
12/13/2021, 5:27 PMshy-musician-55524
12/13/2021, 6:52 PMconfig
locates in the same folder as ___main___
in my case I’m trying to import package from level above
typically you can do relative import like from ..models import ModelItem
, but with pulumi it doesn’t workcolossal-boots-62227
12/14/2021, 1:13 AMsys.path.append
trick:
sys.path.append(os.fsdecode(Path(__file__).resolve().parent.parent.parent))
from path.to.whatever import *
__main__
for the main Pulumi module, if you override it in config then it doesn’t work. It also only works with the from x import y
form of importshy-musician-55524
12/17/2021, 12:07 PM