Skip to content

Commit 77da1ea

Browse files
authored
Merge branch 'master' into remove-unnecessary-curly-braces
2 parents ef98c34 + f6009e3 commit 77da1ea

35 files changed

+157
-689
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "10:00"
8+
open-pull-requests-limit: 10
9+
ignore:
10+
- dependency-name: eslint
11+
versions:
12+
- "> 7.22.0"

.github/workflows/lint.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ on: [push, pull_request]
44

55
jobs:
66
build:
7-
runs-on: ${{ matrix.os }}
8-
strategy:
9-
fail-fast: false
10-
matrix:
11-
os: [ubuntu-latest]
12-
node-version: [12]
7+
runs-on: ubuntu-latest
138
steps:
149
- uses: actions/checkout@v2
1510

1611
- name: Set up Node ${{ matrix.node-version }}
1712
uses: actions/setup-node@v1
1813
with:
19-
node-version: ${{ matrix.node-version }}
14+
node-version: 14
2015

2116
- name: Install deps
2217
run: npm install

.github/workflows/publish.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ jobs:
66
publish-npm:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v1
10-
- uses: actions/setup-node@v1
9+
- uses: actions/checkout@v2
10+
11+
- uses: actions/setup-node@v2
1112
with:
12-
version: 12
13+
version: 14
1314
registry-url: https://registry.npmjs.org/
15+
1416
- run: npm publish
1517
env:
1618
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

.github/workflows/test.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
os: [ubuntu-latest, windows-latest, macOS-latest]
12-
python-version: [3.6, 2.7]
13-
node-version: [12]
12+
python-version: [2.7, 3.6]
1413
steps:
1514
- uses: actions/checkout@v2
1615

@@ -19,10 +18,10 @@ jobs:
1918
with:
2019
python-version: ${{ matrix.python-version }}
2120

22-
- name: Set up Node ${{ matrix.node-version }}
21+
- name: Set up Node
2322
uses: actions/setup-node@v1
2423
with:
25-
node-version: ${{ matrix.node-version }}
24+
node-version: 14
2625

2726
- name: Check python version
2827
run: |

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,35 @@ __pycache__
4545

4646
#NODE STUFF
4747
package-lock.json
48+
yarn.lock
49+
50+
# Lockfiles
51+
*.lock
52+
53+
# Distribution / packaging
54+
.Python
55+
env/
56+
build/
57+
develop-eggs/
58+
dist/
59+
downloads/
60+
eggs/
61+
.eggs/
62+
lib/
63+
lib64/
64+
parts/
65+
sdist/
66+
var/
67+
*.egg-info/
68+
.installed.cfg
69+
*.egg
70+
71+
# Serverless directories
72+
.serverless
73+
.requirements
74+
.requirements.zip
75+
unzip_requirements.py
76+
77+
# Project ignores
78+
puck/
79+
serverless.yml.bak

.tool-versions

Lines changed: 0 additions & 2 deletions
This file was deleted.

README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -528,17 +528,17 @@ package:
528528

529529
## Contributors
530530

531-
- [@dschep](https://github.com/dschep) - Lead developer & maintainer
531+
- [@dschep](https://github.com/dschep) - Lead developer & original maintainer
532532
- [@azurelogic](https://github.com/azurelogic) - logging & documentation fixes
533533
- [@abetomo](https://github.com/abetomo) - style & linting
534534
- [@angstwad](https://github.com/angstwad) - `deploy --function` support
535535
- [@mather](https://github.com/mather) - the cache invalidation option
536536
- [@rmax](https://github.com/rmax) - the extra pip args option
537-
- [@bsamuel-ui](https://github.com/bsamuel-ui) - Python 3 support
537+
- [@bsamuel-ui](https://github.com/bsamuel-ui) - Python 3 support, current maintainer
538538
- [@suxor42](https://github.com/suxor42) - fixing permission issues with Docker on Linux
539539
- [@mbeltran213](https://github.com/mbeltran213) - fixing docker linux -u option bug
540540
- [@Tethik](https://github.com/Tethik) - adding usePipenv option
541-
- [@miketheman](https://github.com/miketheman) - fixing bug with includes when using zip option
541+
- [@miketheman](https://github.com/miketheman) - fixing bug with includes when using zip option, update eslint,
542542
- [@wattdave](https://github.com/wattdave) - fixing bug when using `deploymentBucket`
543543
- [@heri16](https://github.com/heri16) - fixing Docker support in Windows
544544
- [@ryansb](https://github.com/ryansb) - package individually support
@@ -551,5 +551,12 @@ package:
551551
- [@alexjurkiewicz](https://github.com/alexjurkiewicz) - [docs about docker workflows](#native-code-dependencies-during-build)
552552
- [@andrewfarley](https://github.com/andrewfarley) - Implemented download caching and static caching
553553
- [@bweigel](https://github.com/bweigel) - adding the `slimPatternsAppendDefaults` option & fixing per-function packaging when some functions don't have requirements & Porting tests from bats to js!
554-
- [@squaresurf](https://github.com/squaresurf) - adding usePoetry option
554+
- Poetry support
555+
- [@squaresurf](https://github.com/squaresurf)
556+
- [@drice](https://github.com/drice)
557+
- [@ofercaspi](https://github.com/ofercaspi)
558+
- [@tpansino](https://github.com/tpansino)
555559
- [@david-mk-lawrence](https://github.com/david-mk-lawrence) - added Lambda Layer support
560+
- [@bryantbriggs](https://github.com/bryantbiggs) - Fixing CI/CD
561+
- [@jacksgt](https://github.com/jacksgt) - Fixing pip issues
562+
- [@lephuongbg](https://github.com/lephuongbg) - Fixing single function deployment

example/.gitignore

Lines changed: 0 additions & 25 deletions
This file was deleted.

example_native_deps/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

lib/clean.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function cleanup() {
1414
const artifacts = ['.requirements'];
1515
if (this.options.zip) {
1616
if (this.serverless.service.package.individually) {
17-
this.targetFuncs.forEach(f => {
17+
this.targetFuncs.forEach((f) => {
1818
artifacts.push(path.join(f.module, '.requirements.zip'));
1919
artifacts.push(path.join(f.module, 'unzip_requirements.py'));
2020
});
@@ -25,7 +25,7 @@ function cleanup() {
2525
}
2626

2727
return BbPromise.all(
28-
artifacts.map(artifact =>
28+
artifacts.map((artifact) =>
2929
fse.removeAsync(path.join(this.servicePath, artifact))
3030
)
3131
);
@@ -47,7 +47,7 @@ function cleanupCache() {
4747
const promises = [];
4848
glob
4949
.sync([path.join(cacheLocation, '*slspyc/')], { mark: true, dot: false })
50-
.forEach(file => {
50+
.forEach((file) => {
5151
promises.push(fse.removeAsync(file));
5252
});
5353
return BbPromise.all(promises);

lib/docker.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function tryBindPath(serverless, bindPath, testFile) {
8181
`${bindPath}:/test`,
8282
'alpine',
8383
'ls',
84-
`/test/${testFile}`
84+
`/test/${testFile}`,
8585
];
8686
try {
8787
if (debug) serverless.cli.log(`Trying bindPath ${bindPath} (${options})`);
@@ -167,7 +167,7 @@ function getDockerUid(bindPath) {
167167
'stat',
168168
'-c',
169169
'%u',
170-
'/bin/sh'
170+
'/bin/sh',
171171
];
172172
const ps = dockerCommand(options);
173173
return ps.stdout.trim();

lib/inject.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ function injectRequirements(requirementsPath, packagePath, options) {
2121

2222
return fse
2323
.readFileAsync(packagePath)
24-
.then(buffer => JSZip.loadAsync(buffer))
25-
.then(zip =>
24+
.then((buffer) => JSZip.loadAsync(buffer))
25+
.then((zip) =>
2626
BbPromise.resolve(
2727
glob.sync([path.join(requirementsPath, '**')], {
2828
mark: true,
29-
dot: true
29+
dot: true,
3030
})
3131
)
32-
.map(file => [file, path.relative(requirementsPath, file)])
32+
.map((file) => [file, path.relative(requirementsPath, file)])
3333
.filter(
3434
([file, relativeFile]) =>
3535
!file.endsWith('/') &&
@@ -42,7 +42,7 @@ function injectRequirements(requirementsPath, packagePath, options) {
4242
.mapSeries(([file, relativeFile, fileStat]) =>
4343
zipFile(zip, relativeFile, fse.readFileAsync(file), {
4444
unixPermissions: fileStat.mode,
45-
createFolders: false
45+
createFolders: false,
4646
})
4747
)
4848
.then(() => writeZip(zip, packagePath))
@@ -61,16 +61,16 @@ function moveModuleUp(source, target, module) {
6161

6262
return fse
6363
.readFileAsync(source)
64-
.then(buffer => JSZip.loadAsync(buffer))
65-
.then(sourceZip =>
64+
.then((buffer) => JSZip.loadAsync(buffer))
65+
.then((sourceZip) =>
6666
sourceZip.filter(
67-
file =>
67+
(file) =>
6868
file.startsWith(module + '/') ||
6969
file.startsWith('serverless_sdk/') ||
7070
file.match(/^s_.*\.py/) !== null
7171
)
7272
)
73-
.map(srcZipObj =>
73+
.map((srcZipObj) =>
7474
zipFile(
7575
targetZip,
7676
srcZipObj.name.startsWith(module + '/')
@@ -96,18 +96,18 @@ function injectAllRequirements(funcArtifact) {
9696

9797
if (this.serverless.service.package.individually) {
9898
return BbPromise.resolve(this.targetFuncs)
99-
.filter(func =>
99+
.filter((func) =>
100100
(func.runtime || this.serverless.service.provider.runtime).match(
101101
/^python.*/
102102
)
103103
)
104-
.map(func => {
104+
.map((func) => {
105105
if (!get(func, 'module')) {
106106
set(func, ['module'], '.');
107107
}
108108
return func;
109109
})
110-
.map(func => {
110+
.map((func) => {
111111
if (func.module !== '.') {
112112
const artifact = func.package ? func.package.artifact : funcArtifact;
113113
const newArtifact = path.join(
@@ -122,7 +122,7 @@ function injectAllRequirements(funcArtifact) {
122122
return func;
123123
}
124124
})
125-
.map(func => {
125+
.map((func) => {
126126
return this.options.zip
127127
? func
128128
: injectRequirements(

lib/layer.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function createLayers() {
3636
}-${this.serverless.providers.aws.getStage()}-python-requirements`,
3737
description:
3838
'Python requirements generated by serverless-python-requirements.',
39-
compatibleRuntimes: [this.serverless.service.provider.runtime]
39+
compatibleRuntimes: [this.serverless.service.provider.runtime],
4040
},
4141
this.options.layer
4242
);
@@ -55,11 +55,9 @@ function layerRequirements() {
5555

5656
this.serverless.cli.log('Packaging Python Requirements Lambda Layer...');
5757

58-
return BbPromise.bind(this)
59-
.then(zipRequirements)
60-
.then(createLayers);
58+
return BbPromise.bind(this).then(zipRequirements).then(createLayers);
6159
}
6260

6361
module.exports = {
64-
layerRequirements
62+
layerRequirements,
6563
};

0 commit comments

Comments
 (0)