Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null out pythonpath #252

Merged
merged 11 commits into from
Nov 11, 2019
Merged

null out pythonpath #252

merged 11 commits into from
Nov 11, 2019

Conversation

AlJohri
Copy link
Contributor

@AlJohri AlJohri commented Oct 24, 2019

pipx/util.py Outdated Show resolved Hide resolved
pipx/util.py Outdated
@@ -94,11 +94,12 @@ def get_site_packages(python: Path) -> Path:
def run(cmd: Sequence[Union[str, Path]], check=True) -> int:
"""Run arbitrary command as subprocess"""

env = {k:v for k,v in os.environ.items() if k.upper() != 'PYTHONPATH'}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cs01 Should we add some changelog for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done eed7ff8

@laixintao
Copy link

LGTM, but the test case you added failed.

@AlJohri
Copy link
Contributor Author

AlJohri commented Oct 24, 2019

Let me fix the test before merging. Let me know if there’s an easier way to test this.

@AlJohri
Copy link
Contributor Author

AlJohri commented Oct 28, 2019

@laixintao I fixed the tests for python 3.6, added a changelog entry for 0.14.0.1, and bumped the version correspondingly.

@cs01
Copy link
Member

cs01 commented Nov 3, 2019

A force push was recently done, so this PR will have to be rebased onto origin/master. Apologies for the inconvenience. See #270.

Copy link

@michaeljoseph michaeljoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides black complaining
and your branch having some conflicts now, this looks 👌 to me.

assert 'None' in subprocess.run(
[sys.executable, "-m", "pipx", "run", "ipython", "-c", "import os; print(os.environ.get('PYTHONPATH'))"],
universal_newlines=True,
env={'PYTHONPATH': 'test'},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the windows test run, you'll need to update the existing environment here.
mgedmin/check-manifest@90b8961 👀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done, waiting for tests 826afdd

@@ -1,3 +1,7 @@
0.14.0.1

- Null out the PYTHONPATH when executing any command to prevent conflicts between pipx dependencices and package dependenies when pipx is installed via homebrew. Homebrew can use pythonpath manipulation instead of virtual environments. (#233)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps: Remove the PYTHONPATH environment variable when...?
Also, dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done c1ad487

@AlJohri
Copy link
Contributor Author

AlJohri commented Nov 11, 2019

@cs01 @michaeljoseph @laixintao just bumping this PR. tests now pass. anything left to fix?

@cs01
Copy link
Member

cs01 commented Nov 11, 2019

Looks good to me! Thanks

@cs01 cs01 merged commit 8011c12 into pypa:master Nov 11, 2019
@@ -2,6 +2,7 @@ dev

- Handle missing interpreters more gracefully (#146)
- Change `reinstall-all` to use system python by default for apps. Now use `--python` option to specify a different python version.
- Remove the PYTHONPATH environment variable when executing any command to prevent conflicts between pipx dependencies and package dependenies when pipx is installed via homebrew. Homebrew can use pythonpath manipulation instead of virtual environments. (#233)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package dependencies

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, thought I fixed this. pushed again in my branch but looks like the PR is already merged.

Copy link
Member

@cs01 cs01 Nov 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to create another PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

issue with pipx dependency conflicting with package dependency, Click
6 participants