Can i keep a general requirements.txt file in the root folder for all general functions and an additional unique requirements.txt for a specific function in a module folder?
e.g
โโโ serverless.yml
โโโ requirements.txt
โโโ functions.py
โโโ specialFunctionWithAdditionalRequirments
โ โโโ requirements.txt
โ โโโ specialFunction.py
package:
individually: true
functions:
func1:
handler: functions.func1
func2:
handler: functions.func2
special:
handler: specialFunction.handler
module: specialFunctionWithAdditionalRequirments
attempting to do "sls deploy -f func1" in this configuration resulted me in:
Cannot read property 'artifact' of undefined error
TypeError: Cannot read property 'artifact' of undefined
at values.forEach (.../node_modules/serverless-python-requirements/lib/inject.js:113:21)
at Array.forEach (<anonymous>)
at ServerlessPythonRequirements.injectAllRequirements (.../node_modules/serverless-python-requirements/lib/inject.js:99:8)
Edit: there is an high chance that the error (bug) is more general to 4.0.0 and unrelated to the per-function feature, as it happens to me also after reverting back to one requirement.txt file
There isn't currently anyway to do that afaik. As for the errors. I suspect that's #161
Thanks, can you please mark as a feature request.
I believe it is a very common scenario for many.
Yup, I consider #161 a bug since this is behavior that should be supported. As you can see on that issue, it's actually the result of an upstream bug in serverless itself. I'm going to close this issue since it's a duplicate and I don't want too much clutter in the issue backlog. Subscribe to #161 and serverless/serverless#4898 to get updates on progress.
What i meant was a request for a feature that support a general (root directory) requirements.txt file with optional additional requirement.txt files in modules.
Ohhh, right!! Yes, I'll reopen and add the right tag.