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

Split the extras param by comma #46

Merged
merged 2 commits into from
Nov 28, 2017
Merged

Conversation

jac-stripe
Copy link
Contributor

When the bazel implementation calls into the wheel python script, it joins the extras arg by commas (

args += ["--extras", ",".join(repository_ctx.attr.extras)]
).

When that arg is parsed, it should be split by commas. In the case of multiple args being passed with the same argument name, we should continue to use an Append parser, but with modifications to split by comma.

@bazel-io
Copy link
Member

Can one of the admins verify this patch?

@mattmoor
Copy link
Contributor

This is a pretty easy fix in whl.bzl, which I prefer to relying on a private class in argparse.

I would change the line you linked to:

   args += [
       "--extras=%s" % extra
       for extra in repository_ctx.attr.extras
   ]

This should do the right thing for argparse. Switching between this and gflags all the time trips me up... :-/

@mattmoor
Copy link
Contributor

I should also have said: thanks for the PR!

@jac-stripe
Copy link
Contributor Author

Great suggestion, updated

@mattmoor
Copy link
Contributor

Test this please

(for the Bazel CI bot)

@mattmoor mattmoor self-requested a review November 28, 2017 21:53
@mattmoor mattmoor merged commit 346b898 into bazelbuild:master Nov 28, 2017
@mattmoor
Copy link
Contributor

thanks again for the PR.

alexeagle pushed a commit to alexeagle/rules_python that referenced this pull request Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants