Skip to content
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

fix: Validate if pip is installed in the runtime path #549

Merged
merged 7 commits into from
Sep 28, 2023

Conversation

lucashuy
Copy link
Contributor

@lucashuy lucashuy commented Sep 26, 2023

Issue #, if available:
N/A.

Description of changes:
Previously, the Python runtime validator would only validate if the runtime contained the correct Python for the workflow. It did not validate whether or not this runtime had pip installed inside of it or not.

This lead to a case where in a list of Python runtimes, it would select the first one that had Python without checking for pip. The correct runtime in this case would be the one that contains both Python and pip.

This change updates the build action to find and validate all the possible Python execution paths to find one that contains the correct version of Python while also containing pip.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@lucashuy lucashuy changed the title Validate if pip is installed in the current env feat: Validate if pip is installed in the runtime path Sep 26, 2023
@lucashuy lucashuy marked this pull request as ready for review September 26, 2023 18:41
@lucashuy lucashuy requested a review from a team as a code owner September 26, 2023 18:41
Copy link
Contributor

@mndeveci mndeveci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this issue. I have one general question, how this change will behave when customer tries to build a python lambda which doesn't have requirements.txt file?

@lucashuy lucashuy marked this pull request as draft September 26, 2023 22:30
@lucashuy
Copy link
Contributor Author

lucashuy commented Sep 26, 2023

build a python lambda which doesn't have requirements.txt file

Thats a good call out. I'll move that validation logic out of the general pip validator and into the build action, that way this validation+setting of runtime will only apply to projects that the workflow has identified to build.

@lucashuy lucashuy marked this pull request as ready for review September 26, 2023 23:36
@lucashuy lucashuy changed the title feat: Validate if pip is installed in the runtime path fix: Validate if pip is installed in the runtime path Sep 28, 2023
Copy link
Contributor

@mildaniel mildaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this fix!

@lucashuy lucashuy added this pull request to the merge queue Sep 28, 2023
Merged via the queue into aws:develop with commit 704f7ec Sep 28, 2023
123 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants