Skip to content

Poetry #400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
khornberg opened this issue Aug 19, 2019 · 5 comments · Fixed by #477
Closed

Poetry #400

khornberg opened this issue Aug 19, 2019 · 5 comments · Fixed by #477
Assignees
Labels

Comments

@khornberg
Copy link

This is related to #324
When I have a pyproject.toml file I must explicitly say usePoetry: false to package the requirements.

In the current versions of things I get ENOENT: no such file or directory, open '/Users/kyle/projects/serverless-python-requirements-bug/.serverless/requirements.txt'

The above error results from falling into https://github.com/UnitedIncome/serverless-python-requirements/blob/c9d910cc40d95163f8894abfdefaf9c4fc33b505/lib/pip.js#L66

Whatever the logic is to determine if usePoetry is true seems to be at fault.

A working example is at https://github.com/khornberg/serverless-python-requirements-bug

  • Clone and run sls package to get the error
  • Uncomment the custom section in the serverless.yaml file. Running sls package again works.

There is a work around but it seems unintuitive

@dschep
Copy link
Contributor

dschep commented Aug 21, 2019

What version of the plugin are you using?

@khornberg
Copy link
Author

[email protected]

@Lewuathe
Copy link

I faced the same problem with 5.0.0. As @khornberg suggested, setting usePoetry: false resolved the issue.

@bsamuel-ui
Copy link
Contributor

I haven't directly confirmed this, but we're seeing multiple reports with the same remedy.

@miketheman miketheman self-assigned this Feb 25, 2020
miketheman added a commit to miketheman/serverless-python-requirements that referenced this issue Feb 25, 2020
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]>
miketheman added a commit to miketheman/serverless-python-requirements that referenced this issue Feb 25, 2020
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]>
miketheman added a commit to miketheman/serverless-python-requirements that referenced this issue Feb 28, 2020
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]>
@revmischa
Copy link

I am using poetry and see this issue, 5.1.0

  Error: ENOENT: no such file or directory, open '/Users/cyber/dev/project/.serverless/requirements.txt'
      at Object.openSync (fs.js:439:3)
      at Object.readFileSync (fs.js:344:35)
      at getRequirements (/Users/cyber/dev/project/node_modules/serverless-python-requirements/lib/pip.js:354:6)
      at filterRequirementsFile (/Users/cyber/dev/project/node_modules/serverless-python-requirements/lib/pip.js:381:24)
      at generateRequirementsFile (/Users/cyber/dev/project/node_modules/serverless-python-requirements/lib/pip.js:67:5)
      at installRequirementsIfNeeded (/Users/cyber/dev/project/node_modules/serverless-python-requirements/lib/pip.js:501:3)

bsamuel-ui pushed a commit that referenced this issue May 4, 2020
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 #324
Refs #344
Fixes #400

Signed-off-by: Mike Fiedler <[email protected]>
Aubtin pushed a commit to Aubtin/serverless-python-requirements that referenced this issue Sep 16, 2020
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants