Python package novice here. I'm working in Python and using the serverless framework for stack config and deployment. I have a file structure like this:
libs/
__init__.py
mylib.py
services/
service1/
handler.py
handler.py needs to reference mylib.py, so it includes it:
from libs.mylib include MyLib
My virtual env is set up to add the project root to PYTHONPATH, so this works on my local dev, but libs/mylib.py doesn't get included when I package it up for Lambda. How do I tell serverless to include the libs file in the package?
I've tried including a relative path in my requirements.txt file from both the services/service1/ path and from the root path - both have resulted in an error like this:
STDERR: ERROR: Invalid requirement: './libs' (from line 1 of /var/task/requirements.txt)
Hint: It looks like a path. File './libs' does not exist.
I've also tried including libs without a path, and that just installs the pypi package.