DM-12454: Be explicit about which python pytest-xdist uses. #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When starting a Python interpreter, it will add its own site-packages
directory to sys.path if it's not already there.
Normally, this works fine. However, when the same interpreter can be accessed
through two different paths, it can cause both of those paths to be added to
sys.path.
For example, in our standard, newinstall.sh provided, environment, we might
refer to the Python interpreter either as:
/ssd/lsstsw/stack3_20171021/python/miniconda3-4.3.21/bin/python
or as:
/ssd/lsstsw/stack3_20171021/python/current/bin/python
If we include the former's site packages directory corresponding to the former
on our $PYTHONPATH and then run it, everything is fine. Howver, if we instead
invoke the latter, it will insert a new site-packages directory,
corresponding to that provided by Miniconda, to our sys.path. It doesn't add
it at the end of the list of paths, but rather inserts it at some (arbitrary?)
point in the middle.
This then causes confusion when there are packages installed by Miniconda
which shadow packages provided by EUPS: even if the latter are set up, they
can be overriden by this new entry on sys.path. Confusion ensues.
Here, we explicitly normalize the path used by pytest-xdist to invoke Python
so that we avoid this problem.