"sam build" feedback: Don't fail if dependency manifest (requirements.txt) is not found
Description:
sam build always looks for the presence of a dependency manifest like requirements.txt. If it is not present, the command fails. Customers without any dependencies might not have a manifest.
One recommendation was to resolve dependencies if a manifest is present, if not skip. This will create false-positives where customers can sam build and it didn't resolve dependencies because it was looking for manifest in the wrong location. We can print a warning if we did not find any dependency manifest so customers will know what is happening.
As a workaround, customers can always create an empty manifest - requirements.txt so SAM CLI continues to work.
I just hit this too testing out sam build. It shouldn't be assumed that every Lambda will have a requirements.txt file.
especially if the function refers to external sources
MyLambda:
Type: AWS::Serverless::Function
Properties:
Handler: requeue.handler
Runtime: python2.7
CodeUri:
Bucket: !Ref 'SharedSourcesBucket'
Key: 'sqs/requeue.zip'
Any updates on this?
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.