Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
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
14 changes: 14 additions & 0 deletions lib/pip.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,20 @@ function installRequirementsIfNeeded(
// Our source requirements, under our service path, and our module path (if specified)
const fileName = path.join(servicePath, modulePath, options.fileName);

// Skip requirements generation, if requirements file doesn't exist
if (options.usePipenv) {
if (
!fse.existsSync(path.join(servicePath, 'Pipfile')) &&
!fse.existsSync(fileName)
) {
return false;
}
} else {
if (!fse.existsSync(fileName)) {
return false;
}
}

// First, generate the requirements file to our local .serverless folder
fse.ensureDirSync(path.join(servicePath, '.serverless'));
const slsReqsTxt = path.join(servicePath, '.serverless', 'requirements.txt');
Expand Down