Skip to content

Commit 132352f

Browse files
author
Joakim Uddholm
committed
Add a hidden option to enable/disable pipenv support.
1 parent 8e0a2e3 commit 132352f

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ServerlessPythonRequirements {
2525
cleanupZipHelper: true,
2626
invalidateCaches: false,
2727
fileName: 'requirements.txt',
28+
usePipenv: true,
2829
pythonBin: this.serverless.service.provider.runtime,
2930
dockerImage: `lambci/lambda:build-${this.serverless.service.provider.runtime}`,
3031
pipCmdExtraArgs: [],

lib/pip.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const {spawnSync} = require('child_process');
88
*/
99
function installRequirements() {
1010
let fileName = this.options.fileName;
11-
if (fse.existsSync(path.join(this.servicePath, 'Pipfile'))) {
11+
let usePipenv = this.options.usePipenv;
12+
if (usePipenv && fse.existsSync(path.join(this.servicePath, 'Pipfile'))) {
1213
fileName = '.serverless/requirements.txt';
1314
}
1415

lib/pipenv.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ const {spawnSync} = require('child_process');
77
* @return {Promise}
88
*/
99
function pipfileToRequirements() {
10-
if (!fse.existsSync(path.join(this.servicePath, 'Pipfile')))
10+
let usePipenv = this.options.usePipenv;
11+
if (!usePipenv || !fse.existsSync(path.join(this.servicePath, 'Pipfile')))
1112
return;
1213

1314
this.serverless.cli.log('Generating requirements.txt from Pipfile...');

0 commit comments

Comments
 (0)