File tree Expand file tree Collapse file tree 7 files changed +19
-22
lines changed Expand file tree Collapse file tree 7 files changed +19
-22
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,10 @@ function cleanupCache() {
40
40
if ( fse . existsSync ( cacheLocation ) ) {
41
41
let cleanupProgress ;
42
42
if ( this . serverless ) {
43
- if ( this . progress ) {
43
+ if ( this . progress && this . log ) {
44
44
cleanupProgress = this . progress . get ( 'python-cleanup-cache' ) ;
45
- cleanupProgress . notice ( `Removing static caches at: ${ cacheLocation } ` , {
46
- isMainEvent : true ,
47
- } ) ;
45
+ cleanupProgress . notice ( 'Removing static caches' ) ;
46
+ this . log . info ( `Removing static caches at: ${ cacheLocation } ` ) ;
48
47
} else {
49
48
this . serverless . cli . log ( `Removing static caches at: ${ cacheLocation } ` ) ;
50
49
}
Original file line number Diff line number Diff line change @@ -93,11 +93,10 @@ function injectAllRequirements(funcArtifact) {
93
93
}
94
94
95
95
let injectProgress ;
96
- if ( this . progress ) {
96
+ if ( this . progress && this . log ) {
97
97
injectProgress = this . progress . get ( 'python-inject-requirements' ) ;
98
- injectProgress . update ( 'Injecting required Python packages to package' , {
99
- isMainEvent : true ,
100
- } ) ;
98
+ injectProgress . update ( 'Injecting required Python packages to package' ) ;
99
+ this . log . info ( 'Injecting required Python packages to package' ) ;
101
100
} else {
102
101
this . serverless . cli . log ( 'Injecting required Python packages to package...' ) ;
103
102
}
Original file line number Diff line number Diff line change @@ -54,11 +54,10 @@ function layerRequirements() {
54
54
}
55
55
56
56
let layerProgress ;
57
- if ( this . progress ) {
57
+ if ( this . progress && this . log ) {
58
58
layerProgress = this . progress . get ( 'python-layer-requirements' ) ;
59
- layerProgress . update ( 'Packaging Python Requirements Lambda Layer' , {
60
- isMainEvent : true ,
61
- } ) ;
59
+ layerProgress . update ( 'Packaging Python Requirements Lambda Layer' ) ;
60
+ this . log . info ( 'Packaging Python Requirements Lambda Layer' ) ;
62
61
} else {
63
62
this . serverless . cli . log ( 'Packaging Python Requirements Lambda Layer...' ) ;
64
63
}
Original file line number Diff line number Diff line change @@ -716,7 +716,7 @@ async function installAllRequirements() {
716
716
const reqsInstalledAt = await installRequirementsIfNeeded (
717
717
f . module ,
718
718
f ,
719
- this . serverless
719
+ this
720
720
) ;
721
721
// Add modulePath into .serverless for each module so it's easier for injecting and for users to see where reqs are
722
722
let modulePath = path . join (
Original file line number Diff line number Diff line change @@ -15,14 +15,14 @@ async function pipfileToRequirements() {
15
15
}
16
16
17
17
let generateRequirementsProgress ;
18
- if ( this . progress ) {
18
+ if ( this . progress && this . log ) {
19
19
generateRequirementsProgress = this . progress . get (
20
20
'python-generate-requirements-pipfile'
21
21
) ;
22
22
generateRequirementsProgress . update (
23
- 'Generating requirements.txt from Pipfile' ,
24
- { isMainEvent : true }
23
+ 'Generating requirements.txt from Pipfile'
25
24
) ;
25
+ this . log . info ( 'Generating requirements.txt from Pipfile' ) ;
26
26
} else {
27
27
this . serverless . cli . log ( 'Generating requirements.txt from Pipfile...' ) ;
28
28
}
Original file line number Diff line number Diff line change @@ -14,14 +14,14 @@ async function pyprojectTomlToRequirements() {
14
14
}
15
15
16
16
let generateRequirementsProgress ;
17
- if ( this . progress ) {
17
+ if ( this . progress && this . log ) {
18
18
generateRequirementsProgress = this . progress . get (
19
19
'python-generate-requirements-toml'
20
20
) ;
21
21
generateRequirementsProgress . update (
22
- 'Generating requirements.txt from "pyproject.toml"' ,
23
- { isMainEvent : true }
22
+ 'Generating requirements.txt from "pyproject.toml"'
24
23
) ;
24
+ this . log . info ( 'Generating requirements.txt from "pyproject.toml"' ) ;
25
25
} else {
26
26
this . serverless . cli . log (
27
27
'Generating requirements.txt from pyproject.toml...'
Original file line number Diff line number Diff line change @@ -123,14 +123,14 @@ function packRequirements() {
123
123
. then ( ( funcs ) => uniqBy ( funcs , ( f ) => f . module ) )
124
124
. map ( ( f ) => {
125
125
let packProgress ;
126
- if ( this . progress ) {
126
+ if ( this . progress && this . log ) {
127
127
packProgress = this . progress . get (
128
128
`python-pack-requirements-${ f . module } `
129
129
) ;
130
130
packProgress . update (
131
- `Zipping required Python packages for ${ f . module } ` ,
132
- { isMainEvent : true }
131
+ `Zipping required Python packages for ${ f . module } `
133
132
) ;
133
+ this . log . info ( `Zipping required Python packages for ${ f . module } ` ) ;
134
134
} else {
135
135
this . serverless . cli . log (
136
136
`Zipping required Python packages for ${ f . module } ...`
You can’t perform that action at this time.
0 commit comments