-
Notifications
You must be signed in to change notification settings - Fork 291
Open
Description
Are you certain it's a bug?
- Yes, it looks like a bug
Are you using the latest plugin release?
- Yes, I'm using the latest plugin release
Is there an existing issue for this?
- I have searched existing issues, it hasn't been reported yet
Issue description
The plugin can't handle multiple lines in the requirements.txt file that start with -r. For example:
-r games/requirements.txt
-r app/requirements.txt
My best guess is that the "source" variable is wrongfully overwritten when a line starting with -r is encountered in the following line:
serverless-python-requirements/lib/pip.js
Line 483 in b58ce60
source = path.join(path.dirname(source), req.replace(/^-r\s+/, '')); |
Service configuration (serverless.yml) content
N/A
Command name and used flags
serverless deploy
Command output
β Stack *****-prod failed to deploy (0s)
Environment: darwin, node 19.4.0, framework 3.38.0 (local) 3.38.0v (global), plugin 7.2.3, SDK 4.5.1
Credentials: Local, "default" profile
Docs: docs.serverless.com
Support: forum.serverless.com
Bugs: github.com/serverless/serverless/issues
Error:
Error: ENOENT: no such file or directory, open '/Users/kwellman/Projects/*****/games/app/requirements.txt'
at Object.openSync (node:fs:584:3)
at Object.readFileSync (node:fs:452:35)
at getRequirements (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:474:6)
at /Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:484:24
at Array.reduce (<anonymous>)
at getRequirements (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:478:23)
at filterRequirementsFile (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:501:24)
at generateRequirementsFile (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:90:5)
at installRequirementsIfNeeded (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:642:3)
at async ServerlessPythonRequirements.installAllRequirements (/Users/kwellman/Projects/*****/node_modules/serverless-python-requirements/lib/pip.js:782:29)
Environment information
Framework Core: 3.38.0 (local) 3.38.0 (global)
Plugin: 7.2.3
SDK: 4.5.1
serverless-python-requirements version 6.1.2
Metadata
Metadata
Assignees
Labels
No labels