Skip to content

Commit d6aa5a0

Browse files
committed
test proving bug #261 with pip-tools
1 parent 2d13f13 commit d6aa5a0

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

circle.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
# other deps
2525
- run: sudo apt -y update && sudo apt -y install python-pip python2.7 curl unzip
2626
# instal pipenv
27-
- run: sudo python3.6 -m pip install pipenv
27+
- run: sudo python3.6 -m pip install pipenv pip-tools
2828
# install nodejs
2929
- run: curl -sL https://deb.nodesource.com/setup_6.x | sudo bash - && sudo apt -y install nodejs
3030
# install serverless & depcheck

test.bats

+10-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ teardown() {
3535
npm i $(npm pack ../..)
3636
docker &> /dev/null || skip "docker not present"
3737
! uname -sm|grep Linux || groups|grep docker || id -u|egrep '^0$' || skip "can't dockerize on linux if not root & not in docker group"
38-
perl -p -i'.bak' -e 's/(pythonRequirements:$)/\1\n fileName: puck/' serverless.yml
3938
echo "requests" > puck
40-
sls package
39+
sls --fileName=puck package
4140
ls .serverless/requirements/requests
4241
! ls .serverless/requirements/flask
4342
}
@@ -50,6 +49,15 @@ teardown() {
5049
ls puck/flask
5150
}
5251

52+
@test "py3.6 can package flask with hashes" {
53+
cd tests/base
54+
npm i $(npm pack ../..)
55+
pip-compile --output-file requirements-w-hashes.txt --generate-hashes requirements.txt
56+
sls package --fileName requirements-w-hashes.txt
57+
unzip .serverless/sls-py-req-test.zip -d puck
58+
ls puck/flask
59+
}
60+
5361
@test "py3.6 can package flask & bottle with zip option" {
5462
cd tests/base
5563
npm i $(npm pack ../..)

tests/base/serverless.yml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ custom:
1313
slim: ${opt:slim, self:custom.defaults.slim}
1414
slimPatterns: ${file(./slimPatterns.yml):slimPatterns, self:custom.defaults.slimPatterns}
1515
vendor: ${opt:vendor, ''}
16+
fileName: ${opt:fileName, 'requirements.txt'}
1617
defaults:
1718
slim: false
1819
slimPatterns: false

0 commit comments

Comments
 (0)