@@ -33,8 +33,7 @@ class ServerlessPythonRequirements {
33
33
'-t' , '.requirements' ,
34
34
'-r' , 'requirements.txt' ,
35
35
] ;
36
- if ( this . serverless . service . custom &&
37
- this . serverless . service . custom . dockerizePip ) {
36
+ if ( this . custom . dockerizePip ) {
38
37
cmd = 'docker' ;
39
38
options = [
40
39
'run' , '--rm' ,
@@ -56,7 +55,7 @@ class ServerlessPythonRequirements {
56
55
packRequirements ( ) {
57
56
return this . installRequirements ( ) . then ( ( ) => {
58
57
return new BbPromise ( ( resolve , reject ) => {
59
- if ( this . serverless . service . custom && this . serverless . service . custom . zipImport ) {
58
+ if ( this . custom . zipImport ) {
60
59
const zip = new Zip ( ) ;
61
60
zip . addLocalFolder ( '.requirements' , '' ) ;
62
61
zip . writeZip ( '.requirements.zip' ) ;
@@ -68,7 +67,7 @@ class ServerlessPythonRequirements {
68
67
69
68
cleanup ( ) {
70
69
const artifacts = [ 'requirements.py' ] ;
71
- if ( this . serverless . service . custom && this . serverless . service . custom . zipImport )
70
+ if ( this . custom . zipImport )
72
71
artifacts . push ( '.requirements.zip' )
73
72
else
74
73
artifacts . push ( '.requirements' )
@@ -94,6 +93,7 @@ class ServerlessPythonRequirements {
94
93
constructor ( serverless , options ) {
95
94
this . serverless = serverless ;
96
95
this . options = options ;
96
+ this . custom = this . serverless . service . custom && this . serverless . service . custom . pythonRequirements || { } ;
97
97
98
98
this . commands = {
99
99
'requirements' : {
0 commit comments