@@ -53,6 +53,7 @@ def py_console_script_binary(
5353 script = None ,
5454 binary_rule = py_binary ,
5555 shebang = "" ,
56+ main = None ,
5657 ** kwargs ):
5758 """Generate a py_binary for a console_script entry_point.
5859
@@ -66,20 +67,22 @@ def py_console_script_binary(
6667 package as the `pkg` Label.
6768 script: {type}`str`, The console script name that the py_binary is going to be
6869 generated for. Defaults to the normalized name attribute.
70+ main: {type}`str`, the python file to be generated, defaults to `<name>_entry_point.py` to
71+ be compatible with symbolic macros.
6972 binary_rule: {type}`callable`, The rule/macro to use to instantiate
7073 the target. It's expected to behave like {obj}`py_binary`.
7174 Defaults to {obj}`py_binary`.
7275 shebang: {type}`str`, The shebang to use for the entry point python file.
7376 Defaults to empty string.
7477 **kwargs: Extra parameters forwarded to `binary_rule`.
7578 """
76- main = name + "_entry_point.py"
79+ main = main or name + "_entry_point.py"
7780
7881 if kwargs .pop ("srcs" , None ):
7982 fail ("passing 'srcs' attribute to py_console_script_binary is unsupported" )
8083
8184 py_console_script_gen (
82- name = name + "_gen " ,
85+ name = name + "_gen__ " ,
8386 entry_points_txt = entry_points_txt or _dist_info (pkg ),
8487 out = main ,
8588 console_script = script ,
0 commit comments