https://pantsbuild.org/ logo
#general
Title
# general
a

ancient-france-42909

05/12/2023, 7:20 PM
Hey! We're in the process of upgrading our Python version, so we have tests for libs with a parametrized python interpreter constraint. We also tried to move away from a constraints file to a lockfile (resolve). And we're hitting a bug that's been reported (this). Are there any workarounds for this?
I disagree that it's an enhancement, I think it's a bug 🙂
w

witty-crayon-22786

05/12/2023, 7:38 PM
yes: the workaround is to create a macro or function that creates the targets you want
or a for-loop
i.e.
Copy code
for (interpreter_constraints, resolve, name_suffix) in ...:
  python_tests(
    name=f"the_name_{name_suffix}",
    interpreter_constraints=interpreter_constraints,
    resolve=resolve,
    ...
  )