Skip to content

Commit 5360505

Browse files
author
bweigel
committed
merge master
1 parent 910b3e5 commit 5360505

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,4 +385,4 @@ zipinfo .serverless/xxx.zip
385385
* [@dee-me-tree-or-love](https://github.com/dee-me-tree-or-love) - the `slim` package option
386386
* [@alexjurkiewicz](https://github.com/alexjurkiewicz) - [docs about docker workflows](#native-code-dependencies-during-build)
387387
* [@andrewfarley](https://github.com/andrewfarley) - Implemented download caching and static caching
388-
* [@bweigel](https://github.com/bweigel) - migrating tests from bats to tape, additional configuration for slim-option
388+
* [@bweigel](https://github.com/bweigel) - adding the `slimPatternsAppendDefaults` option & fixing per-function packaging when some functions don't have requirements

lib/pip.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,20 @@ function installRequirementsIfNeeded(
381381
// Our source requirements, under our service path, and our module path (if specified)
382382
const fileName = path.join(servicePath, modulePath, options.fileName);
383383

384+
// Skip requirements generation, if requirements file doesn't exist
385+
if (options.usePipenv) {
386+
if (
387+
!fse.existsSync(path.join(servicePath, 'Pipfile')) &&
388+
!fse.existsSync(fileName)
389+
) {
390+
return false;
391+
}
392+
} else {
393+
if (!fse.existsSync(fileName)) {
394+
return false;
395+
}
396+
}
397+
384398
// First, generate the requirements file to our local .serverless folder
385399
fse.ensureDirSync(path.join(servicePath, '.serverless'));
386400
const slsReqsTxt = path.join(servicePath, '.serverless', 'requirements.txt');

0 commit comments

Comments
 (0)