Commit 6450988
authored
π fix(pip): set PIP_USER=0 to prevent --user installs in virtualenvs (#3719)
Users with `pip config --user` configured globally experienced
installation failures in tox virtualenvs. π When pip attempted to honor
the `--user` flag inside virtualenvs, it crashed because user
site-packages aren't visible in isolated environments.
This regression was introduced during the tox 4 rewrite. Tox 3 correctly
set `PIP_USER=0` to override user configuration, but this protection was
lost in the rewrite. The fix restores this behavior by setting the
environment variable in all virtualenv-based Python environments.
The solution follows pip's documented environment variable precedence
where `PIP_USER=0` explicitly disables `--user` installs regardless of
config file settings. This preserves user workflows while ensuring tox
virtualenvs remain isolated. β¨
Fixes #30101 parent f17313e commit 6450988
5 files changed
Lines changed: 25 additions & 2 deletions
File tree
- docs
- changelog
- reference
- src/tox/tox_env/python/virtual_env
- tests/tox_env/python/virtual_env
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
| 116 | + | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
822 | 825 | | |
823 | 826 | | |
824 | 827 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
0 commit comments