I’m a bit stuck on how to implement <https://githu...
# development
h
I’m a bit stuck on how to implement https://github.com/pantsbuild/pants/issues/9273 to deprecate
[python-setup].interpreter_constraints
being a list option. If a user sets
interpreter_constraints = '>=3.6'
, that means to add the constraints to the default, rather than to replace. Almost always, that’s an error to add. I don’t see how a user can avoid using list syntax while still overridding? The simplest I can think of is to deprecate
interpreter_constraints
and rename to
interpreter_compatibility
or
compatibility
, for closer alignment with the
compatibility
field. The complex, slow approach is: 1. Deprecate not setting constraints, so that we can set them to empty by default. 2. Deprecate the list syntax. You will still be appending, but you’re appending to the default of an empty list. 3. Change the type, add back our default. The downside is that we can’t finish this till 2.3.0, and we have no default in 2.2.0 for new users.
j
If you are changing the name of the config can’t you have them overlap where the existence of the newer one makes the older one ignored?
h
Indeed. If we change the name of the option, then this is easy to do
Idk what would be a good name though. It’s bad that the global option and the target field are not the same. But I think
interpreter_constraints
>
compatibility
j
Does TOML have a syntax for overriding lists instead of appending?
The word “interpreter” seems important in the global context. But if it is within python-setup maybe shorter would work.
h
For Pants options, that’s what the
interpreter_constraints = [">=3.7"]
is doing: overriding. We don’t have another mechanism to override, and I don’t think we want to invent one
The word “interpreter” seems important in the global context.
We could do
interpreter_compatibility
, possibly
j
Is “requires” a pip or pypi field? Would that work?
Image from iOS.jpg
h
We could possibly do it, but yeah overlaps with our options like
[python-setup].requirements_constraints
, which may be confusing
j
Isn’t that really
pip_contraints
?
w
The simplest I can think of is to deprecate 
interpreter_constraints
 and rename to 
interpreter_compatibility
 or 
compatibility
, for closer alignment with the 
compatibility
 field.
this makes sense to me, but mostly because it aligns with the field name on targets. making them align around some other new name would be good too though.
👍🏽 2