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

Fix PYTHONPATH passed to envreport / "pip freeze" #2529

Merged
merged 3 commits into from Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -33,6 +33,7 @@ Cyril Roelandt
Dane Hillard
David Staheli
David Diaz
Dmitrii Sutiagin a.k.a. f3flight
Ederag
Eli Collins
Eugene Yunak
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2528.bugfix.rst
@@ -0,0 +1 @@
Add env cleanup to envreport - fix PYTHONPATH leak into "envreport" -- by :user:`f3flight`.
6 changes: 5 additions & 1 deletion src/tox/venv.py
Expand Up @@ -840,7 +840,11 @@ def tox_runtest_post(venv):
def tox_runenvreport(venv, action):
# write out version dependency information
args = venv.envconfig.list_dependencies_command
output = venv._pcall(args, cwd=venv.envconfig.config.toxinidir, action=action, returnout=True)
env = venv._get_os_environ()
venv.ensure_pip_os_environ_ok(env)
output = venv._pcall(
args, cwd=venv.envconfig.config.toxinidir, action=action, returnout=True, env=env
)
# the output contains a mime-header, skip it
output = output.split("\n\n")[-1]
packages = output.strip().split("\n")
Expand Down