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

Adding APPDATA as default passenv on Windows #2404

Merged
merged 3 commits into from Apr 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -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