full-artist-27215
06/22/2021, 2:45 PMpulumi
CLI to interact with these projects and their stacks (e.g., if something goes wrong, I'd like to be easily do something like pulumi export
-> edit file -> pulumi import
, without having to also encode that via the Automation API). The best I've managed so far (though I'm still investigating) is to manipulate the sys.path
in my various __main__.py
in order to get the shared code importing correctly, but that seems like a hack I'd rather avoid.
Is there any guidance for how to structure things (with directory structures, configuration parameters, etc.) to be able to juggle multiple related Pulumi Python projects that share code? Thanks in advance.nutritious-shampoo-16116
07/01/2021, 2:36 PMpythonpath-add:
@if [ -f ~/.zshrc ]; then\
if [ $(shell cat ~/.zshrc | grep "export PYTHONPATH=\$$PYTHONPATH:$$(pwd)" | wc -l) -eq 0 ]; then\
echo "export PYTHONPATH=\$$PYTHONPATH:$$(pwd)" >> ~/.zshrc;\
fi;\
elif [ -f ~/.bashrc ]; then\
if [ $(shell cat ~/.bashrc | grep "export PYTHONPATH=\$$PYTHONPATH:$$(pwd)" | wc -l) -eq 0 ]; then\
echo "export PYTHONPATH=\$$PYTHONPATH:$$(pwd)" >> ~/.bashrc;\
fi;\
else\
echo "No shell recognized, append `export PYTHONPATH=$PYTHONPATH:/path/to/this/folder` to your shell configuration file";\
fi