Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow users to request a fixed python interpreter #4930
In some situations, the automatic python picker logic picks the wrong version of Python and we don't have much control over that beyond being able to specify version constraints (which sometimes aren't sufficient).
I added an option to explicitly specify a list of paths to search.
Users can now pass in
@kwlzn I wasn't sure how best to test it, since I can't really assume multiple python versions will be present on the test box (or can I?) so it's hard for me to throw together a sample project that would make sure the resolution logic uses the python I want. I could set it to an empty search path and ensure that it complains that it can't find any pythons, but that feels kinda weak.
@kwlzn @benjyw @stuhood one thing I'm not sure about is how this should interact with the .pants.d cache of the python interpreter. If I change pants.ini to look for a different python version, I assume the cached python path will get updated, but I don't understand the cache more broadly to figure out how it should know about this option getting passed in. Any of you have any advice?