File tree 3 files changed +16
-1
lines changed
3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -416,6 +416,18 @@ functions:
416
416
vendor: ./hello-vendor # The option is also available at the function level
417
417
` ` `
418
418
419
+ # ## Copy dependencies instead of linking
420
+
421
+ Before final packaging, a link is created in .serverless folder for python dependencies.
422
+ If it is not possible to create a symbolic link, dependencies can be copied instead of linked
423
+ whith the foloowing option :
424
+
425
+ ` ` ` yaml
426
+ custom:
427
+ pythonRequirements:
428
+ useFinalCopy: true
429
+ ` ` `
430
+
419
431
# # Manual invocations
420
432
421
433
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 @@ -778,7 +778,9 @@ async function installAllRequirements() {
778
778
reqsInstalledAt != symlinkPath
779
779
) {
780
780
// Windows can't symlink so we have to use junction on Windows
781
- if ( process . platform == 'win32' ) {
781
+ if ( this . serverless . service . custom . pythonRequirements . useFinalCopy ) {
782
+ fse . copySync ( reqsInstalledAt , symlinkPath ) ;
783
+ } else if ( process . platform == 'win32' ) {
782
784
fse . symlink ( reqsInstalledAt , symlinkPath , 'junction' ) ;
783
785
} else {
784
786
fse . symlink ( reqsInstalledAt , symlinkPath ) ;
You can’t perform that action at this time.
0 commit comments