(lambda-python): requirements.txt
created in the entry folder when using Poetry
#20296
Labels
@aws-cdk/aws-lambda-python
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
lambda-python
supportsrequirements.txt
,poetry.lock
andpipfile
to define the function dependencies. If usingpoetry.lock
, arequirements.txt
file is created in the entry folder after bundling. This is an unexpected side effect.Expected Behavior
cdk synth
does not modify the contents of the function entry folder.Current Behavior
requirements.txt
is created in the entry folder alongsidepyproject.toml
andpoetry.lock
.Reproduction Steps
Create a
PythonFunction
that points to a directory withpyproject.toml
andpoetry.lock
. Runcdk synth
. Inspect the contents of the directory.Possible Solution
Don't create files in the entry directory, or clean them up after bundling. Or better yet, do the packaging in a docker container. Unless this is already supposed to be happening?
Additional Information/Context
No response
CDK CLI Version
2.23.0
Framework Version
2.23.0
Node.js Version
18.1.0
OS
Linux
Language
Python
Language Version
No response
Other information
The docs mention this somewhat:
I believe the code that does this is here:
aws-cdk/packages/@aws-cdk/aws-lambda-python/lib/packaging.ts
Line 49 in c3c4a97
The text was updated successfully, but these errors were encountered: