Imports for microservices (AWS Lambda)

 Pycharm works well enough with AWS Lambda. My one question though is, is there a way to specify that the files in a particular folder should have different module import settings than files in other folders?

For example, I might have micro-services, ie, code I'll zip-up and send to AWS Lambda or Google Compute, etc.

All the files are stored in a folder (except for the packages, which I'll grab from the site-packages folder of my virtual environment when I deploy). For example, if I have microservices "foo" and "bar" below, 

foo/lambda_fuction.py

foo/helpers.py

bar/lambda_function.py

bar/helpers.py

Is there a way to specify that all imports for files in folder "foo" should be done as if the application was being run from the directory "foo"? Or is there some way to do imports so that the "unresolved reference" warning doesn't appear and Python knows that I'm importing from the directory that lambda_function is stored in?

Either solutions works. Love Pycharm!

0

请先登录再写评论。