use run_pip of env in executor (#2701) #2747
Closed
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.
This ensures to use the correct python executable.
Using
run
simply usessys.prefix
with a bin suffix, which is not necessarily the currently used python executable.E.g. when linking a specific python version to a custom directory, using
sys.prefix
may point to the wrong python version:sys.prefix
is/usr
in this case, which is correct, but thepython
executable there points to the wrong version.run_pip
in the env fixes this already by usingsys.executable
, see https://github.com/python-poetry/poetry/blob/develop/poetry/utils/env.py#L964This should be used in the executor as well.
This change landed on the
develop
branch by mistake in #2701