https://pantsbuild.org/ logo
a

ambitious-xylophone-5772

04/10/2023, 8:45 PM
Hi all - I’m trying to see if there’s a way in pants to use a different interpreter constraint in pants based on the github runner python version matrix?
The problem is that if I have my python interpreter constraint set to something like >=3.8, pants chooses the first satisfiable component, but I really want it to be testing 3.10. Of course, if I try setting the constraint to 3.10, then I can’t run tests with 3.8.
Will I have to do something with environment variables here?
h

happy-kitchen-89482

04/10/2023, 10:15 PM
Yeah, you might want to set PANTS_PYTHON_INTERPRETER_CONSTRAINTS based on the matrix value
a

ambitious-xylophone-5772

04/10/2023, 10:15 PM
If I keep the interpreter_constraint in pants.toml will the env variable take precedence?
h

happy-kitchen-89482

04/10/2023, 10:16 PM
Yes, the order of precedence for every option is command line flag > env var > config
👍 1