pythonfinder
pythonfinder copied to clipboard
Non-deterministic result of pythonfinder
For example, Finder().find_python_version(3, minor=6, patch=6) could return .../.pyenv/versions/3.6.6/bin/python3 or .../.pyenv/versions/3.6.6/bin/python3.6 or.../.pyenv/versions/3.6.6/bin/python3.6m
It looks like the first item which is the path is not sorted in https://github.com/sarugaku/pythonfinder/blob/3126cf2dbb55216402a7f42deffaf8512b03c56d/src/pythonfinder/models/mixins.py#L298. But I don't know why the pytest-xdist still doesn't work even with that fixed by key=operator.itemgetter(1, 0).
This is only going to be true in a multiprocessing situation isn’t it? Xdist may hit this branch of the code and fork function calls (not sure how it works), but it could be that the sort function only sees partial results sometimes.
It doesn’t actually matter in this particular case but I’m curious if there is a case where it does
Actually I think there are two cases. The first case is that it also affects normal API without multiple process. The above case happens when I called the API normally.
The second case is about xdist, even I fixed the first case, the xdist still doesn't work. Probably there is somewhere else where versions are not sorted correctly.
Hi. Is this still reproducible in a more recent version of pythonfinder?
Stale issue