Skip to content

Commit eb5a554

Browse files
committed
remove useless usePipenv local vars & document the option
1 parent 132352f commit eb5a554

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ custom:
3535
This must be the full image name and tag to use, including the runtime specific tag if applicable.
3636

3737
## Pipenv support :sparkles::cake::sparkles:
38-
If you include a `Pipfile` and have `pipenv` installed instead of a
39-
`requirements.txt` this will use `pipenv lock --r` to generate
40-
them. It is fully compatible with all options such as `zip` and `dockerizePip`.
38+
If you include a `Pipfile` and have `pipenv` installed instead of a `requirements.txt` this will use
39+
`pipenv lock --r` to generate them. It is fully compatible with all options such as `zip` and
40+
`dockerizePip`. If you don't want this plugin to generate it for you, set the following option:
41+
```yaml
42+
custom:
43+
pythonRequirements:
44+
usePipenv: false
45+
```
4146

4247

4348
## Dealing with Lambda's size limitations

lib/pip.js

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

lib/pipenv.js

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

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

0 commit comments

Comments
 (0)