You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #678, we changed --interpreter-constraint to OR between multiple values. This is useful for disjoint constraints, e.g. CPython==2.7.* OR CPython>=3.5.
We explained that you can AND by using a single constraint, e.g. CPython>=3.5,<3.6.
However, there is no way to AND with the entire requirement string, e.g. there is no way to say CPython==3.7.* AND CPython==3.8.0 without manually merging the constraints into one.
While this may be fine for most usages, Pants needs to be able to AND the entire requirement string. Specifically, in Pants, constraints should be ANDed accross targets (but ORed within the target). For example, the below results in CPython==3.7.* AND CPython==3.6.*.
It's not clear what the API should look like for this. --interpreter-constraint should certainly still OR. Possibly, we introduce a new flag?
Possibly we parametrize whether --interpreter-constraint should OR vs. AND? (Although, we may likely need to support both. It's unclear to me if we can use static analysis to avoid this by having Pants pre-process the constraints.)
The text was updated successfully, but these errors were encountered:
I think I saw a library last week that understands requirement strings and can do algebra between them, such as merging them. I'm going to first explore if we can use that approach of static analysis before having to resort to this change to Pex.
In #678, we changed
--interpreter-constraint
to OR between multiple values. This is useful for disjoint constraints, e.g.CPython==2.7.*
ORCPython>=3.5
.We explained that you can AND by using a single constraint, e.g.
CPython>=3.5,<3.6
.However, there is no way to AND with the entire requirement string, e.g. there is no way to say
CPython==3.7.*
ANDCPython==3.8.0
without manually merging the constraints into one.While this may be fine for most usages, Pants needs to be able to AND the entire requirement string. Specifically, in Pants, constraints should be ANDed accross targets (but ORed within the target). For example, the below results in
CPython==3.7.* AND CPython==3.6.*
.It's not clear what the API should look like for this.
--interpreter-constraint
should certainly still OR. Possibly, we introduce a new flag?Possibly we parametrize whether
--interpreter-constraint
should OR vs. AND? (Although, we may likely need to support both. It's unclear to me if we can use static analysis to avoid this by having Pants pre-process the constraints.)The text was updated successfully, but these errors were encountered: