I’ve got a proposal for how to group target parame...
# development
c
I’ve got a proposal for how to group target parametrizations here: https://github.com/pantsbuild/pants/pull/20065 More feedback appreciated before we merge this. Thanks for your review so far, @proud-dentist-22844
🚀 1
just bumping this so it’s not forgotten.. 😉 cc @witty-crayon-22786 if you have the chance, would be great to get your feedback on this (no rush..)
w
commented: thanks!
🙏 1
c
@witty-crayon-22786 positional vs splatting addressed, ptal 😉
Now also with support for providing default parametrization groups using
__defaults__
and optionally override them per target.
e.g.
Copy code
__defaults__({python_sources: dict(**parametrize("default", resolve="py37", interpreter_constraints=["==3.7"])})

python_sources(
  resolve="py38",
  interpreter_constraints=["==3.8"],
  **parametrize("default"),
  **parametrize("py39", resolve="py39", interpreter_constraints=["==3.9"])
)
Will create two parametrized targets:
@parametrize=default
wich cancels out the values provided by
__defaults__
so resolve “py38" and
@parmetrize=py39
with the provided fields, so resolve “py39”.
while a target that doesn’t provide it’s own
"default"
group, will get the “py37" resolve from the defaults parametrization group
@witty-crayon-22786 I assume you’re happy with the UX of this.. do you want to review the implementation as well before we merge? (just so I know if I should wait for it..)
w
Let me know if review gets delayed but no: otherwise I won't review
c
ok cool. @proud-dentist-22844 has been very active reviewing this feature, so I’ll go ahead once he’s had a chance commenting on these final changes then.
thanks 🙏
p
Looks great! This is a nice addition!
❤️ 1