Skip to content

Commit

Permalink
Fix incorrectly setting name on python_requirements macro (#14065)
Browse files Browse the repository at this point in the history
Closes #14061. Oopsies.

Note that this code path will be removed soon once we finish #12915.

[ci skip-rust]
  • Loading branch information
Eric-Arellano authored Jan 4, 2022
1 parent 0b1ef20 commit ee723d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/python/pants/core/goals/tailor.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ def fmt_val(v) -> str:
return f"[{val_str}\n{indent}]"
return repr(v)

is_default_name = self.name == os.path.basename(self.path)
if self.kwargs or not is_default_name:
has_name = self.addressable and self.name != os.path.basename(self.path)
if self.kwargs or has_name:
_kwargs = {
**({} if is_default_name else {"name": self.name}),
**({"name": self.name} if has_name else {}),
**self.kwargs, # type: ignore[arg-type]
}
_kwargs_str_parts = [f"\n{indent}{k}={fmt_val(v)}" for k, v in _kwargs.items()]
Expand Down

0 comments on commit ee723d0

Please sign in to comment.