fix(py_console_script_binary): only create _script_gen for the exec cfg (#4219)

Without this, `py_console_script_gen` exists for both the target and
exec config which causes issues when cross-compiling.

I use py_console_script_binary for glad2 which I pass as a tool to a
genrule, but starting with rules_python 2.0.0 I get the following error
when e.g. cross-compiling to wasm:
```
DEBUG: /home/runner/.cache/bazel/_bazel_runner/a9f0723b1e9e47cd91eaa9d5188be59d/external/rules_python+/python/private/config_settings.bzl:248:14: The current configuration rules_python config flags is:
    @@rules_python+//python/config_settings:pip_whl_osx_version: ""
    @@rules_python+//python/config_settings:py_freethreaded: "no"
    @@rules_python+//python/config_settings:py_linux_libc: "glibc"
    @@rules_python+//python/config_settings:python_version: "3.14"

If the value is missing, then the default value is being used, see documentation:
https://rules-python.readthedocs.io/en/latest/api/rules_python/python/config_settings
ERROR: /home/runner/.cache/bazel/_bazel_runner/a9f0723b1e9e47cd91eaa9d5188be59d/external/rules_python++pip+hastur_pypi/glad2/BUILD.bazel:6:12: configurable attribute "actual" in @@rules_python++pip+hastur_pypi//glad2:_no_matching_repository doesn't match this configuration: No matching wheel for current configuration's Python version and platform.

The current build configuration's Python version doesn't match any of the Python
wheels available for this distribution. This distribution supports the following Python
configuration settings:
    //_config:is_cp314_linux_x86_64

As configured by the `pip.parse.target_platforms` attribute. Note that
`requirements_by_platform` only affects the Bazel host platform unless
`target_platforms` is also set.

To determine the current configuration's Python version, run:
    `bazel config <config id>` (shown further below)

For the current configuration value see the debug message above that is
printing the current flag values. If you can't see the message, then re-run the
build to make it a failure instead by running the build with:
    --@@rules_python+//python/config_settings:current_config=fail

However, the command above will hide the `bazel config <config id>` message.


This instance of @@rules_python++pip+hastur_pypi//glad2:_no_matching_repository has configuration identifier 98696d4. To inspect its configuration, run: bazel config 98696d4.

For more help, see https://bazel.build/docs/configurable-attributes#faq-select-choose-condition.
```

With this change, Bazel seems happy to only run the
`py_console_script_gen` bits for the exec config and my
cross-compilation works again.

---------

Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
diff --git a/news/4219.changed.md b/news/4219.changed.md
new file mode 100644
index 0000000..bf20cf3
--- /dev/null
+++ b/news/4219.changed.md
@@ -0,0 +1,2 @@
+(rules) {obj}`py_console_script_binary` now creates the main script only for the `exec`
+configuration.
diff --git a/python/private/py_console_script_gen.bzl b/python/private/py_console_script_gen.bzl
index de01603..091193d 100644
--- a/python/private/py_console_script_gen.bzl
+++ b/python/private/py_console_script_gen.bzl
@@ -77,6 +77,7 @@
         "entry_points_txt": attr.label(
             doc = "The filegroup to search for entry_points.txt.",
             mandatory = True,
+            cfg = "exec",
         ),
         "out": attr.output(
             doc = "Output file location.",