Skip to content

Commit 9167e2e

Browse files
mikethemanAubtin
authored andcommitted
fix: check if pyproject has poetry earlier
During the evaluation in the package phase, we determine whether a `requirements.txt` file exists, or whether we need to generate one. Since the `pyproject.toml` file is used by poetry, but only if a stanza is contained inside the file, use the function `isPoetryProject()` along with the configuration value, thereby reducing the need for a project to have to declare a configuration override. Refs serverless#324 Refs serverless#344 Fixes serverless#400 Signed-off-by: Mike Fiedler <[email protected]>
1 parent 36e2e82 commit 9167e2e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/pip.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,9 @@ function generateRequirementsFile(
6363
) {
6464
if (
6565
options.usePoetry &&
66-
fse.existsSync(path.join(servicePath, 'pyproject.toml')) &&
67-
isPoetryProject(servicePath)
66+
fse.existsSync(
67+
path.join(servicePath, 'pyproject.toml') && isPoetryProject(servicePath)
68+
)
6869
) {
6970
filterRequirementsFile(
7071
path.join(servicePath, '.serverless/requirements.txt'),

0 commit comments

Comments
 (0)