Skip to content

Commit

Permalink
Adding APPDATA as default passenv on Windows (#2404)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
niander and pre-commit-ci[bot] committed Apr 20, 2022
1 parent 9e5d720 commit 7818b3d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Expand Up @@ -92,6 +92,7 @@ Miro Hrončok
Monty Taylor
Morgan Fainberg
Naveen S R
Niander Assis
Nick Douma
Nick Prendergast
Nicolas Vivet
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2402.bugfix.rst
@@ -0,0 +1 @@
``sitepackages = true`` will add user's site-package to the python path on Windows as expected -- by :user:`niander`
2 changes: 1 addition & 1 deletion docs/config.rst
Expand Up @@ -468,7 +468,7 @@ Complete list of settings that you can put into ``testenv*`` sections:
``LD_LIBRARY_PATH``, ``PIP_INDEX_URL``, ``PIP_EXTRA_INDEX_URL``,
``REQUESTS_CA_BUNDLE``, ``SSL_CERT_FILE``,
``HTTP_PROXY``, ``HTTPS_PROXY``, ``NO_PROXY``
* Windows: ``SYSTEMDRIVE``, ``SYSTEMROOT``, ``PATHEXT``, ``TEMP``, ``TMP``
* Windows: ``APPDATA``, ``SYSTEMDRIVE``, ``SYSTEMROOT``, ``PATHEXT``, ``TEMP``, ``TMP``
``NUMBER_OF_PROCESSORS``, ``USERPROFILE``, ``MSYSTEM``,
``PROGRAMFILES``, ``PROGRAMFILES(X86)``, ``PROGRAMDATA``
* Others (e.g. UNIX, macOS): ``TMPDIR``
Expand Down
1 change: 1 addition & 0 deletions src/tox/config/__init__.py
Expand Up @@ -796,6 +796,7 @@ def passenv(testenv_config, value):
# but this leads to very long paths when run with jenkins
# so we just pass it on by default for now.
if tox.INFO.IS_WIN:
passenv.add("APPDATA") # needed to find user site-packages location
passenv.add("SYSTEMDRIVE") # needed for pip6
passenv.add("SYSTEMROOT") # needed for python's crypto module
passenv.add("PATHEXT") # needed for discovering executables
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/config/test_config.py
Expand Up @@ -1508,6 +1508,7 @@ def test_passenv_as_multiline_list(self, newconfig, monkeypatch, plat):
assert len(config.envconfigs) == 1
envconfig = config.envconfigs["python"]
if plat == "win32":
assert "APPDATA" in envconfig.passenv
assert "PATHEXT" in envconfig.passenv
assert "SYSTEMDRIVE" in envconfig.passenv
assert "SYSTEMROOT" in envconfig.passenv
Expand Down Expand Up @@ -1560,6 +1561,7 @@ def test_passenv_as_space_separated_list(self, newconfig, monkeypatch, plat):
assert len(config.envconfigs) == 1
envconfig = config.envconfigs["python"]
if plat == "win32":
assert "APPDATA" in envconfig.passenv
assert "PATHEXT" in envconfig.passenv
assert "SYSTEMDRIVE" in envconfig.passenv
assert "SYSTEMROOT" in envconfig.passenv
Expand Down

0 comments on commit 7818b3d

Please sign in to comment.