Skip to content

Commit 7818b3d

Browse files
Adding APPDATA as default passenv on Windows (#2404)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 9e5d720 commit 7818b3d

File tree

5 files changed

+6
-1
lines changed

5 files changed

+6
-1
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Miro Hrončok
9292
Monty Taylor
9393
Morgan Fainberg
9494
Naveen S R
95+
Niander Assis
9596
Nick Douma
9697
Nick Prendergast
9798
Nicolas Vivet

docs/changelog/2402.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``sitepackages = true`` will add user's site-package to the python path on Windows as expected -- by :user:`niander`

docs/config.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ Complete list of settings that you can put into ``testenv*`` sections:
468468
``LD_LIBRARY_PATH``, ``PIP_INDEX_URL``, ``PIP_EXTRA_INDEX_URL``,
469469
``REQUESTS_CA_BUNDLE``, ``SSL_CERT_FILE``,
470470
``HTTP_PROXY``, ``HTTPS_PROXY``, ``NO_PROXY``
471-
* Windows: ``SYSTEMDRIVE``, ``SYSTEMROOT``, ``PATHEXT``, ``TEMP``, ``TMP``
471+
* Windows: ``APPDATA``, ``SYSTEMDRIVE``, ``SYSTEMROOT``, ``PATHEXT``, ``TEMP``, ``TMP``
472472
``NUMBER_OF_PROCESSORS``, ``USERPROFILE``, ``MSYSTEM``,
473473
``PROGRAMFILES``, ``PROGRAMFILES(X86)``, ``PROGRAMDATA``
474474
* Others (e.g. UNIX, macOS): ``TMPDIR``

src/tox/config/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ def passenv(testenv_config, value):
796796
# but this leads to very long paths when run with jenkins
797797
# so we just pass it on by default for now.
798798
if tox.INFO.IS_WIN:
799+
passenv.add("APPDATA") # needed to find user site-packages location
799800
passenv.add("SYSTEMDRIVE") # needed for pip6
800801
passenv.add("SYSTEMROOT") # needed for python's crypto module
801802
passenv.add("PATHEXT") # needed for discovering executables

tests/unit/config/test_config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,6 +1508,7 @@ def test_passenv_as_multiline_list(self, newconfig, monkeypatch, plat):
15081508
assert len(config.envconfigs) == 1
15091509
envconfig = config.envconfigs["python"]
15101510
if plat == "win32":
1511+
assert "APPDATA" in envconfig.passenv
15111512
assert "PATHEXT" in envconfig.passenv
15121513
assert "SYSTEMDRIVE" in envconfig.passenv
15131514
assert "SYSTEMROOT" in envconfig.passenv
@@ -1560,6 +1561,7 @@ def test_passenv_as_space_separated_list(self, newconfig, monkeypatch, plat):
15601561
assert len(config.envconfigs) == 1
15611562
envconfig = config.envconfigs["python"]
15621563
if plat == "win32":
1564+
assert "APPDATA" in envconfig.passenv
15631565
assert "PATHEXT" in envconfig.passenv
15641566
assert "SYSTEMDRIVE" in envconfig.passenv
15651567
assert "SYSTEMROOT" in envconfig.passenv

0 commit comments

Comments
 (0)