-
Notifications
You must be signed in to change notification settings - Fork 293
Per-function requirements cannot use package include #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hmm. I think it'd work if you do: cd function1
ln -s ../config
cd ../function2
ln -s ../config
cd ..
sls deploy I agree that's not optimal, but I think it should work. Any input @cgrimal, since you implemented the per-function requirements? |
I managed to reproduce the issue indeed. That said, the handling of linking (now injecting) has been completely reworked since i implemented this feature and I don't see where the include directive is supposed to be handled. It might be a bug I'm afraid. Even though @dschep's workaround should work, you can also use the vendor mechanism. With your exact folder structures, it works with this minimal service: issue_168
provider:
name: aws
runtime: python3.6
package:
individually: true
include: # not working :'(
- config/**
functions:
func1:
handler: index.handler
module: function1
vendor: ./config
func2:
handler: index.handler
module: function2
vendor: ./config
plugins:
- serverless-python-requirements You can run the |
Hi @cgrimal, I have a very similar structure to OP (the folder is called common instead of config) and I've tried to use vendor as you suggested but the folder does not get included.
I have also tried @dschep's suggestion to put a symlink, this works but it's not possible to use exclude or slimPatterns anymore (I have a few tests in there). Is there a way to make either include or vendor work again? |
Hi @antoniocaiazzo, I'm afraid I haven't been using (or working on) this project for too long now, and I don't think I can help you. You'll have better chances if you open a new issue (you may still reference this one). I hope you'll find a solution. |
I use per-function requirements
├── serverless.yml
├── config
│ └── settings.py
├── function1
│ ├── requirements.txt
│ └── index.py
└── function2
├── requirements.txt
└── index.py
serverless.yml is
package:
individually: true
functions:
func1:
handler: index.handler
module: function1
func2:
handler: index.handler
module: function2
package:
include:
- config/**
issuse is : the config/** wouldn't be include in func2. how can didi it
The text was updated successfully, but these errors were encountered: