-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
(aws-lambda-python): Poetry requirements export fails when path + pypi dependencies due to lack of hashes on paths #19232
Comments
@huonw looks like this might be an easy fix. I am unassigning and marking this issue as We use +1s to help prioritize our work, and are happy to revaluate this issue based on community feedback. You can reach out to the cdk.dev community on Slack to solicit support for reprioritization. |
…2351) Export poetry dependencies without hashes to prevent bundling failures when a dependency provides a hash. Without this flag, users relying on the Poetry python dependency manager need to manually export their own `requirements.txt` file, as described in #14201 Fixes #19232 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…s#22351) Export poetry dependencies without hashes to prevent bundling failures when a dependency provides a hash. Without this flag, users relying on the Poetry python dependency manager need to manually export their own `requirements.txt` file, as described in aws#14201 Fixes aws#19232 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
…s#22351) Export poetry dependencies without hashes to prevent bundling failures when a dependency provides a hash. Without this flag, users relying on the Poetry python dependency manager need to manually export their own `requirements.txt` file, as described in aws#14201 Fixes aws#19232 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [x] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [x] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
What is the problem?
We're starting to use
PythonFunction
from@aws-cdk/aws-lambda-python-alpha
with poetry (apyproject.toml
andpoetry.lock
file in the directory specified byentry
), and it works pretty well, thanks.However, the exported
requirements.txt
includes hashes for external dependencies but not path deps, and if there's any hashes in the file, thenpip
requires a hash for every dep:This means that if a Poetry package depends on both a path and pypi package,
PythonFunction
won't be able to bundle the requirements.This is arguably a poetry and/or pip issue, but
poetry export
does provide a--without-hashes
argument to emit the hashes, which could be added to:aws-cdk/packages/@aws-cdk/aws-lambda-python/lib/packaging.ts
Line 49 in 6dfc254
Reproduction Steps
Directory tree of
parent
:parent/pyproject.toml
:parent/poetry.lock
:parent/child/pyproject.toml
What did you expect to happen?
The bundling should work when there's both pypi/external and path dependencies, similar to if there's only pypi deps.
What actually happened?
The bundling computes a requirements file like the following:
Note how
child
has no--hash
argument. The bundling then fails with output including:CDK CLI Version
2.14.0 (build 762d71b)
Framework Version
No response
Node.js Version
v14.17.5
OS
macOS
Language
Typescript
Language Version
TypeScript 4.1.6
Other information
No response
The text was updated successfully, but these errors were encountered: