-
Notifications
You must be signed in to change notification settings - Fork 4k
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): Using poetry requirements results in requirements.txt written to 'entry' directory #19231
Comments
@huonw this might be a simple fix. Right now we run all our commands and then copy everything to the output directory. We might want to just copy first and then run the commands in the output directory. 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. |
@corymhall Would this be as simple as moving L98 to right after L93 here? What would make sense as a test for this? |
Yeah I think that would do it. I think we can update one of the integration tests to do an assertion that the function still executes successfully (see integ.bundling.ts as an example). |
…21967) When performing function bundling sometimes the bundling steps will write files. Currently all these commands are run from the `entry` which is the actually source code location. This leads to contaminating the source code with bundling artifacts. This PR re-orders the bundling steps to first move the `entry` to the `outputDir` and then perform the bundling steps there. I've also updated all of the integration tests to use the new integration test framework and assertions. fixes #19231 ---- ### All Submissions: * [ ] 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 * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] 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*
|
…ws#21967) When performing function bundling sometimes the bundling steps will write files. Currently all these commands are run from the `entry` which is the actually source code location. This leads to contaminating the source code with bundling artifacts. This PR re-orders the bundling steps to first move the `entry` to the `outputDir` and then perform the bundling steps there. I've also updated all of the integration tests to use the new integration test framework and assertions. fixes aws#19231 ---- ### All Submissions: * [ ] 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 * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] 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*
hello @corymhall, is this slated to be released soon? Not sure what your release cycle looks like. |
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
is written to the asset input volume directory, meaning it ends up written to theentry
directory next topyproject.toml
, which is a bit unexpected. This requires configuring.gitignore
correctly, and also may impact the fingerprinting procedure.aws-cdk/packages/@aws-cdk/aws-lambda-python/lib/packaging.ts
Line 49 in 6dfc254
(Looking at the code there, this likely applies to pipenv too)
Reproduction Steps
Directory tree of
entry
(before running anything):poetry.lock
:pyproject.toml
:__init__.py
: emptyWhat did you expect to happen?
Temporary files shouldn't be written to disk (or at least, not intermixed with real source). For instance, the generated
requirements.txt
could be placed into any other directory in the docker image and this probably won't occur.What actually happened?
After running
cdk synth
, a (empty, in this case)requirements.txt
file appears: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: