-
-
Notifications
You must be signed in to change notification settings - Fork 594
fix(multi-versions): correctly default 'main' arg for transition rules #1316
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(multi-versions): correctly default 'main' arg for transition rules #1316
Conversation
bffc8b1
to
5946109
Compare
Some fun trivia about how py_binary finds main: it's basically a suffix search. e.g.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly lgtm, but one bug to fix and some nits
Before the change the version-aware py_binary and py_test rules would not default the 'main' argument correctly and this change adds unit tests and a helper function to do the defaulting. Work towards bazel-contrib#1262
5946109
to
482c45a
Compare
@rickeylev, yeah, the fact that As for the comment about modification in place test, it is there already because the |
This fixes a bug where the version-aware rules required
main
to always be explicitlyspecified. This was necessary because the main file is named after the outer target
(e.g. "foo"), but usage of the main file is done by the inner target ("_foo"). The net
effect is the inner target looks for "_foo.py", while only "foo.py" is in srcs.
To fix, the wrappers set main, if it isn't already set, to their name + ".py"
Work towards #1262