billowy-tiger-59247
07/18/2023, 3:17 PMtest
only for sources that fit into some specific constraint)? Maybe some kind of --filter-python-interpreter
for python interpreters or something like that? Does that even make sense? 🤔
Context: we have introduced new sources with different Python constraints on our monorepo and are now trying to see what would be the best way to adjust our CI. The options we’ve considered are:
• Make sure the image in which our CI step runs has all Python versions available (similar to what we have on the local environment with pyenv)
• Have different steps that --filter
tests for specific constraints, each one running on an image with a single python version required for those testscurved-television-6568
07/18/2023, 3:19 PMtags
comes to mind…billowy-tiger-59247
07/18/2023, 4:11 PMcurved-television-6568
07/18/2023, 5:16 PMbillowy-tiger-59247
07/18/2023, 5:36 PM./pants --changed-since=origin/main
--changed-dependees=transitive
--filter-address-regex="folder/with/only/python310/code/*"
--filter-target-type=pex_binary
package
Assuming that all changed code (and their dependents) also live within the folder/with/only/python310/code
folder, I would expect this to work on an environment with Python 3.10 only. However, the behavior we see right now is that, even though the code that requires a different python version (3.8.*) has not changed and is also under a different folder, we still receive the No interpreter compatible
error 👇
Examined the following interpreters:
1.) /usr/local/bin/python3.10 CPython==3.10.12
2.) /usr/bin/python3.9 CPython==3.9.2
No interpreter compatible with the requested constraints was found:
Version matches CPython==3.8.*
It’s important to notice that we don’t have python_sources
or pex_binaries
that depend on any of the sources that require the 3.8.* interpreter.billowy-tiger-59247
07/18/2023, 5:39 PM--changed-since
and --changed-dependees
curved-television-6568
07/18/2023, 6:01 PMpeek
instead of package
(and then pipe through jq
):
❯ pants [all your options] peek | jq -r 'map(.interpreter_constraints)|.[]|.[]?' | sort | uniq
billowy-tiger-59247
07/18/2023, 6:14 PMpex_binaries
that result from these filters don’t have direct interpreter_constraints defined to them (they inherit the global defined on *<http://pants.to|pants.to>*ml
, so this command returns only nulls
billowy-tiger-59247
07/18/2023, 6:14 PMbillowy-tiger-59247
07/18/2023, 6:32 PM3.8.inexistentversion
, even though that shouldn’t be required for the changes on the debug branch.curved-television-6568
07/18/2023, 6:45 PMcurved-television-6568
07/18/2023, 6:51 PMpants list
with those options fails, while pants list ::
works… so it’s something in there that’s causing interpreters to be resolved prematurely it seems.curved-television-6568
07/18/2023, 6:51 PMbillowy-tiger-59247
07/19/2023, 9:00 AM