pythonRequirements->vendor does not work if package->individually is set to true
from the code:
if (this.serverless.service.package.individually) {
...
} else {
installRequirements(
this.options.fileName,
'.serverless',
this.serverless,
this.servicePath,
this.options
);
if (this.options.vendor) {
// copy vendor libraries to requirements folder
copyVendors(this.options.vendor, '.serverless', this.serverless);
}
}
I think
if (this.options.vendor) {
// copy vendor libraries to requirements folder
copyVendors(this.options.vendor, '.serverless', this.serverless);
}
should be outside the if-else block as probably we want the general - "cross functions" vendor folder to be copied to each module, even if individuality was set to true
That seems right to me too. Feel free to make a PR :+1:
@dschep What if I have a vendor library with custom modules that some functions depend on also created by ourselves in below manner.
project-name
/vendor
...
__init__.py
/custom
__init__.py
package.py
/functions
/func1
__init__.py
handler.py
Here in my handler.py I have imported package like from vendor.custom import package and because of above issues I used function level vendoring. But when I deploy the code I get all the files in modules copied into function folder without the module structure. Any idea why this is happening or am I doing it in the right way?