This stopped being valid BUILD file code in `2.17....
# general
h
This stopped being valid BUILD file code in
2.17.1
. I didn't see any mention of it in the release notes. Was that intended?
Copy code
# BUILD file code
__defaults__(python_sources=dict(skip_yapf=True))

# produces
MappingError: Failed to parse ./some/path/to/BUILD.pants:
TypeError: set_defaults() got an unexpected keyword argument 'python_sources'
2
c
aha! yea, that didn’t do what you thought it did. So before it got silently ignored, now we error 🙂 right is:
Copy code
__defaults__(dict(python_sources=dict(skip_yapf=True)))
or, we usually use dict literals for the enclosing one:
Copy code
__defaults__({python_sources: dict(skip_yapf=True)})
my apologies, the issue was reported here https://github.com/pantsbuild/pants/issues/19158 but the fix for it was applied along with the fix for another issue, so didn’t get a mention in the bugfixes section in the changelog. lesson learned. 🙂
👍 1