File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,18 @@ functions:
428
428
vendor: ./hello-vendor # The option is also available at the function level
429
429
` ` `
430
430
431
+ # ## Copy dependencies instead of linking
432
+
433
+ Before final packaging, a link is created in .serverless folder for python dependencies.
434
+ If it is not possible to create a symbolic link, dependencies can be copied instead of linked
435
+ whith the foloowing option :
436
+
437
+ ` ` ` yaml
438
+ custom:
439
+ pythonRequirements:
440
+ useFinalCopy: true
441
+ ` ` `
442
+
431
443
# # Manual invocations
432
444
433
445
The `.requirements` and `requirements.zip`(if using zip support) files are left
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ class ServerlessPythonRequirements {
58
58
pipCmdExtraArgs : [ ] ,
59
59
noDeploy : [ ] ,
60
60
vendor : '' ,
61
+ useFinalCopy : false ,
61
62
} ,
62
63
( this . serverless . service . custom &&
63
64
this . serverless . service . custom . pythonRequirements ) ||
Original file line number Diff line number Diff line change @@ -782,7 +782,9 @@ async function installAllRequirements() {
782
782
reqsInstalledAt != symlinkPath
783
783
) {
784
784
// Windows can't symlink so we have to use junction on Windows
785
- if ( process . platform == 'win32' ) {
785
+ if ( this . serverless . service . custom . pythonRequirements . useFinalCopy ) {
786
+ fse . copySync ( reqsInstalledAt , symlinkPath ) ;
787
+ } else if ( process . platform == 'win32' ) {
786
788
fse . symlink ( reqsInstalledAt , symlinkPath , 'junction' ) ;
787
789
} else {
788
790
fse . symlink ( reqsInstalledAt , symlinkPath ) ;
You can’t perform that action at this time.
0 commit comments