-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
What happened?
If exec_properties
for a py_binary
or py_test
is explicitly set to None
, an error of the form
Error: 'NoneType' value has no field or method 'items'
is raised on this line:
Line 67 in 5968bcb
non_test_exec_properties = {k: v for k, v in exec_properties.items() if not k.startswith("test.")} |
In our case, the explicit value of None
came from a symbolic macro that used inherit_attrs = "common"
. This regression was found when trying upgrade from version 1.3.2 to version 1.6.0. Our workaround is to use
if kwargs.get("exec_properties", None) == None:
kwargs["exec_properties"] = {}
in symbolic macro implementations that create py_*
targets.
This regression appears to have been introduced in #529; CC @keith.
Version
Development (host) and target OS/architectures: irrelevant
Output of bazel --version
: bazel 8.1.1
Version of the Aspect rules, or other relevant rules from your
WORKSPACE
or MODULE.bazel
file: 1.6.0
Language(s) and/or frameworks involved: irrelevant
How to reproduce
py_binary(
name = "foo",
srcs = ["foo.py"],
exec_properties = None,
)
Any other information?
No response