Allow pipx run --pypackages
to function again.
#636
Merged
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.
docs/changelog.md
Summary of changes
Closes #623 .
Due to a regression with PR #252 in order to fix Issue #233, using pipx with pythonloc (using the local
__pypackages__
folder) stopped working.To use packages in the local
__pypackages__
folder withpipx run --pypackages
, pipx adds the appropriate folders toPYTHONPATH
. Unfortunately the code from the previous PR removesPYTHONPATH
before running it, nullifying the effect of pipx's own code.This PR selectively allows only the two paths added by the pypackages code in pipx to
PYTHONPATH
to remain, removingPYTHONPATH
or other directories inPYTHONPATH
otherwise.The code got a little less clean, but we should support operation of our own features (!)
Test plan
Tested by running
From report in Issue #623:
pipx 0.16.0.0 shows error, this PR runs as expected.