happy-kitchen-89482
05/11/2022, 7:13 PMhappy-kitchen-89482
05/11/2022, 7:14 PMCPython==3.8.*
and PyPy==3.7.*
happy-kitchen-89482
05/11/2022, 7:14 PMhappy-kitchen-89482
05/11/2022, 7:14 PMhappy-kitchen-89482
05/11/2022, 7:16 PMinterpreter_constraints=["CPython==3.8.*", "PyPy==3.7.*"]
. These are ORed, which is fine, but as soon as you try to select one via more specific interpreter_constraints on a target (e.g., via parametrization) we try to AND the more specific constraints with both of these, and one will fail because we can't AND across interpreter types (we check for this and fail)happy-kitchen-89482
05/11/2022, 7:17 PMinterpreter_constraints=[]
. I.e., no global constraints at all, and let the target constraints determine the interpreter. The problem here is that the ANDing leads to the merged interpreter constraints being []
themselves, i.e., no constraints at all.happy-kitchen-89482
05/11/2022, 7:18 PMancient-vegetable-10556
05/11/2022, 7:18 PMancient-vegetable-10556
05/11/2022, 7:19 PMancient-vegetable-10556
05/11/2022, 7:19 PMCPython==3.8.* AND (target interpreter constraints)
then PyPy==etc etc etc
.happy-kitchen-89482
05/11/2022, 7:20 PMhappy-kitchen-89482
05/11/2022, 7:21 PMhappy-kitchen-89482
05/11/2022, 7:21 PMancient-vegetable-10556
05/11/2022, 7:22 PMancient-vegetable-10556
05/11/2022, 7:24 PM*
as an interpreter constraint, do we?happy-kitchen-89482
05/11/2022, 7:26 PMCPython==*
?hundreds-father-404
05/11/2022, 7:35 PMwitty-crayon-22786
05/11/2022, 7:35 PMwitty-crayon-22786
05/11/2022, 7:37 PMOR
, you shouldn’t need to parametrize every single target (…although that would be a workaround i think?)… you should be able to rely on OR
herewitty-crayon-22786
05/11/2022, 7:39 PMAND
s to doing `contains`… so it’s only relevant if contains does the right thing for: ["CPython==3.8.*", "PyPy==3.7.*"].contains(["CPython==3.8.*"])
witty-crayon-22786
05/11/2022, 7:40 PMwitty-crayon-22786
05/11/2022, 7:48 PMwitty-crayon-22786
05/11/2022, 7:48 PMhappy-kitchen-89482
05/11/2022, 8:09 PMhappy-kitchen-89482
05/11/2022, 8:10 PMwitty-crayon-22786
05/11/2022, 8:15 PMwitty-crayon-22786
05/11/2022, 8:16 PMwitty-crayon-22786
05/11/2022, 8:17 PMhappy-kitchen-89482
05/11/2022, 8:19 PMhappy-kitchen-89482
05/11/2022, 8:19 PMwitty-crayon-22786
05/11/2022, 9:14 PMIC.merge
filters out empty sets: https://github.com/pantsbuild/pants/blob/8e986aa84e98a76761c2e1a93af0ec34e41ddda4/[…]thon/pants/backend/python/util_rules/interpreter_constraints.py … but not merge_constraints
, which is what most codepaths usewitty-crayon-22786
05/11/2022, 9:15 PMhappy-kitchen-89482
05/11/2022, 9:29 PMhappy-kitchen-89482
05/11/2022, 9:29 PMmerge_constraints
happy-kitchen-89482
05/11/2022, 9:30 PMwitty-crayon-22786
05/11/2022, 9:30 PMhappy-kitchen-89482
05/11/2022, 11:03 PM