A quick question: if my python project depends on ...
# general
w
A quick question: if my python project depends on python39, can I use interpreter_constraints = [“>=3.7.*“] ? or the interpreter_constraints needs to align with the python dependency in the project?
h
Hi, can you clarify what you mean by "depends on python39"? Is this an explicit dependency? If so, how are you declaring it? Or do you just mean that your code uses Python 3.9 features?
w
Assume that I am using conda to manage my dependencies in the past where I specify the following, and my code uses Python 3.9 features
Copy code
dependencies:
  - python=3.9.5
My question is, to use pants, do I have to put interpreter_constraints = [“==3.9.*“]. Or I can put interpreter_constraints = [“>=3.6.*“] (for example). I guess, my question becomes, when pants run my codes, will it get (somehow : ) ) python39 instead of python36? If yes, how to make it do it? or it wont, it will just use the interpreter it found.
h
Ah I see. In that case, that is exactly what interpreter_constraints is for
That is what forces Pants to limit the interpreters it will use
1