proud-dentist-22844
03/31/2023, 1:08 AMIf multiple fields are parametrized, a target will be created for each value in the Cartesian product, withBut, I want to parametrize twoas the delimiter in the address. See the next example.,
pex_binary
fields: interpreter_constraints
and output_path
. I want to use the named interpreter constraint in the output_path
. So, IC py36
has output_path="st2-py36.pex"
I tried the following, but that (of course) did the Cartesian product which does not make sense:
pex_binary(
...
interpreter_constraints=parametrize(
py36=["CPython==3.6.*"],
py37=["CPython==3.7.*"],
py38=["CPython==3.8.*"],
),
output_path=parametrize(
py36="st2-py36.pex",
py37="st2-py37.pex",
py38="st2-py38.pex",
),
)
proud-dentist-22844
03/31/2023, 1:13 AM_ics = dict(
py36=["CPython==3.6.*"],
py37=["CPython==3.7.*"],
py38=["CPython==3.8.*"],
)
for ic_name, ic in _ics.items():
pex_binary(
name=f"st2-{ic_name}",
output_path=f"st2-{ic_name}.pex",
interpreter_constraints=ic,
...
)
It doesn't look as clean as parametrize
. But it seems to work.curved-television-6568
03/31/2023, 2:14 PM