aws / aws-lambda-builders

Python library to compile, build & package AWS Lambda functions for several runtimes & framework
Apache License 2.0
334 stars 139 forks source link

Skip PythonPipBuilder:Validation if no requirements.txt exists #678

Open Downchuck opened 3 weeks ago

Downchuck commented 3 weeks ago

Skip Validation on langauge when not building dependencies

When only using PythonPipBuilder:CopySource, the Python version installed on the machine should not matter.

requirements.txt file not found. Continuing the build without dependencies.
 Running PythonPipBuilder:CopySource

For situations where the dependencies are being packaged into a layer, it's unnecessary to have Python installed at all - or at least the python version could be relaxed so as not to require the same version the lambda is targeting:

Error: PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations  : ['/usr/bin/python', '/bin/python', '/usr/bin/python3', '/bin/python3'] which did not satisfy constraints for runtime: python3.12. Do you have python for runtime: python3.12 on your PATH?
mildaniel commented 3 weeks ago

That suggestion makes a lot of sense to me. Thanks for the request, I'll bring it to the team for prioritization.