Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,18 @@ functions:
vendor: ./hello-vendor # The option is also available at the function level
```

### Copy dependencies instead of linking

Before final packaging, a link is created in .serverless folder for python dependencies.
If it is not possible for the OS to create a symbolic link, dependencies can be copied,
instead of linked, with the following option:

```yaml
custom:
pythonRequirements:
useSymlinks: false
```

## Manual invocations

The `.requirements` and `requirements.zip`(if using zip support) files are left
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class ServerlessPythonRequirements {
pipCmdExtraArgs: [],
noDeploy: [],
vendor: '',
useSymlinks: true,
},
(this.serverless.service.custom &&
this.serverless.service.custom.pythonRequirements) ||
Expand Down
4 changes: 3 additions & 1 deletion lib/pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,9 @@ async function installAllRequirements() {
reqsInstalledAt != symlinkPath
) {
// Windows can't symlink so we have to use junction on Windows
if (process.platform == 'win32') {
if (!this.serverless.service.custom.pythonRequirements.useSymlinks) {
fse.copySync(reqsInstalledAt, symlinkPath);
} else if (process.platform == 'win32') {
fse.symlink(reqsInstalledAt, symlinkPath, 'junction');
} else {
fse.symlink(reqsInstalledAt, symlinkPath);
Expand Down