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

Allow Extra Args to be passed to FaaS Pex Build #20939

Merged
merged 5 commits into from
May 23, 2024

Conversation

TonySherman
Copy link
Contributor

@TonySherman TonySherman commented May 21, 2024

Similar to #20237, this allows passing arbitrary arguments to the first pex invocation when building a FaaS (AWS Lambda or Google Cloud Function) artifact.

This can serve as a stop-gap for #19256, because a user can write then pass --exclude themselves when they really need that (or similar) functionality.

Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

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

This looks really good, I think it's just some minor tweaks.

Thank you!

src/python/pants/backend/python/util_rules/faas_test.py Outdated Show resolved Hide resolved
src/python/pants/backend/python/util_rules/faas.py Outdated Show resolved Hide resolved
@huonw
Copy link
Contributor

huonw commented May 21, 2024

Ah, can you call this out in the release notes? Please add a sentence or paragraph to the Python section of docs/notes/2.22.x.md.

Here's how we phrased it for the pex3_venv_create_extra_args field in 2.19 https://github.com/pantsbuild/pants/blob/main/docs/notes/2.19.x.md#python:

Additional arguments can be passed to the underlying PEX invocations when building FaaS artifacts (AWS Lambda, Google Cloud Functions) via the new pex3_venv_create_extra_args field. For instance, if dependencies have packaged files in unexpected locations, passing pex3_venv_create_extra_args=["--collisions-ok"] can side-step collision errors.

@huonw huonw changed the title Allow Extra Args to be passed to Pex Build Allow Extra Args to be passed to FaaS Pex Build May 21, 2024
@huonw
Copy link
Contributor

huonw commented May 21, 2024

(I've updated the PR title and description too, to be a bit more specific about what and why, feel free to edit some more!)

add unit tests

internal: sort more tuples to potentially improve cache hit rates. (pantsbuild#20767)

I looked through most `tuple` uses in the Python backend, and added
`sorted(..)` where I think the order wasn't already stable and the
result ends up as a rule output.

update docs and test fixture
Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

@TonySherman
Copy link
Contributor Author

Linter passed for me locally but I think I fixed what was causing the fail in CI now.

@huonw
Copy link
Contributor

huonw commented May 22, 2024

There was another merge conflict on the release notes, so I took the liberty of resolving it.

@huonw huonw enabled auto-merge (squash) May 22, 2024 22:57
@huonw huonw merged commit 20b7210 into pantsbuild:main May 23, 2024
25 checks passed
@huonw
Copy link
Contributor

huonw commented May 23, 2024

Thanks for the contribution!

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.

None yet

2 participants