Skip to content

Commit 371f9ae

Browse files
Merge pull request #20 from fac/add-python-builder
Rename Python build package to lambda-package
2 parents 97a0286 + 8e87b4e commit 371f9ae

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
serverless-tools (0.4.0)
4+
serverless-tools (0.4.1)
55
aws-sdk-ecr
66
aws-sdk-lambda
77
aws-sdk-s3

lib/serverless-tools/deployer/python_builder.rb

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ def build
1111
# Poetry does not have an option to install dependencies to a specified target folder.
1212
# Workaround is generating a requirments.txt file using poetry
1313
`poetry export -f requirements.txt --without-hashes > requirements.txt`
14-
# And then installing them using pip to specified "package" target directory
15-
`pip install -r requirements.txt -t ./package`
16-
# Zipping contents of functions and package folders with the
14+
# And then installing them using pip to specified "lambda-package" target directory
15+
`pip install -r requirements.txt -t lambda-package`
16+
# Zipping contents of functions and lambda-package folders with the
1717
# handler file in a zip as required by AWS
18-
`zip -r "#{local_filename}" #{config.handler_file} src`
19-
`cd package && zip -r "../#{local_filename}" ./*`
18+
`zip -jr "#{local_filename}" #{config.handler_file}`
19+
`zip -r "#{local_filename}" src`
20+
`cd lambda-package && zip -r "../#{local_filename}" ./*`
2021
end
2122

2223
def output

lib/serverless-tools/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module ServerlessTools
2-
VERSION = "0.4.0"
2+
VERSION = "0.4.1"
33
end

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# a python project file structure
33
[tool.poetry]
44
name = "serverless-tools"
5-
version = "0.4.0"
5+
version = "0.4.1"
66
description = "FreeAgent Serverless Tools"
77
authors = ["yasser.bennani@freeagent.com"]
88

test/deployer/python_builder_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def assert_file_exists?(exists = true)
2222

2323
File.delete(subject.local_filename)
2424

25-
# Delete package directory created by Python deployer build method
25+
# Delete lambda-package directory created by Python deployer build method
2626
File.delete("requirements.txt")
27-
FileUtils.remove_dir("./package",true)
27+
FileUtils.remove_dir("./lambda-package",true)
2828
end
2929

3030
describe "#local_filename" do

0 commit comments

Comments
 (0)