Serverless-python-requirements: Per-function requirements does not work

Created on 5 Mar 2018  Β·  8Comments  Β·  Source: UnitedIncome/serverless-python-requirements

I followed the exact instructions from the docs but it does not work. The per function requirements.txt files are not being picked up

Is this broken?

My project structure:

β”œβ”€β”€ serverless.yml
β”œβ”€β”€ contact_events_get
β”‚      β”œβ”€β”€ requirements.txt
β”‚      └── index.py
└── contact_events_post
       β”œβ”€β”€ requirements.txt
       └── index.py**

Serverless.yml excerpt:

`package:
  individually: true
  exclude:
    - "**/*"

functions:
  fn-contactgegevens-events-get:
    handler: contactgegevens_events_get/index.handler
    package:
        include:
          - contactgegevens_events_get/index.py
  fn-contactgegevens-events-post:
    handler: contactgegevens_events_post/index.handler
    package:
        include:
          - contactgegevens_events_post/index.py

It does work with a requirements.txt at top level. Also note that the docs are off because specifying the handler without the dir name doesn't do it - the lambda function still expects the file at the root level but it is in a subir

Most helpful comment

Just now!

All 8 comments

Did you install latest(the default) or beta? Per function requirements are only available in 4.0.0-beta.

Ow there is a 4.0.0-beta ... :)

Yup. I'm gonna leave this open in case others have the same issue and as a reminder to update the readme if I get a chance. More likely I'll just close this once v4 is out of beta.

Hello @dschep,
do you have an idea when you're going to release v4? We are using the per-function requirements feature in production now, and I'm updating our deployment procedure, so I want to know if I should add a section on how to get this specific beta version or not.
Many thanks,
ClΓ©ment

Next week hopefully, I've been on vacation :skier:

Might I be so bold as to inquire into the status of release v4?

Thanks

Just now!

Great!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

IanTayler picture IanTayler  Β·  4Comments

ceefour picture ceefour  Β·  3Comments

calclavia picture calclavia  Β·  5Comments

JulienMarliac picture JulienMarliac  Β·  3Comments

amitm02 picture amitm02  Β·  6Comments