Skip to content

Commit 6feee0b

Browse files
ssbarneagaborbernat
authored andcommitted
Adds SSL proxy variables to default passenv (#1439)
This shouls avoid SSL failures with HTTP requests from pip, requests or other libraries. Also sorts existing values in order to make it easier to update the list in the future. Fixes: #1437
1 parent 5582194 commit 6feee0b

File tree

6 files changed

+22
-5
lines changed

6 files changed

+22
-5
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Pierre-Luc Tessier Gagné
7373
Ronald Evers
7474
Ronny Pfannschmidt
7575
Selim Belhaouane
76+
Sorin Sbarnea
7677
Sridhar Ratnakumar
7778
Stephen Finucane
7879
Sviatoslav Sydorenko

docs/changelog/1437.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Adds ``CURL_CA_BUNDLE``, ``REQUESTS_CA_BUNDLE``, ``SSL_CERT_FILE`` to the default passenv values. - by :user:`ssbarnea`

docs/config.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,10 @@ Complete list of settings that you can put into ``testenv*`` sections:
385385
Some variables are always passed through to ensure the basic functionality
386386
of standard library functions or tooling like pip:
387387

388-
* passed through on all platforms: ``PATH``, ``LANG``, ``LANGUAGE``,
389-
``LD_LIBRARY_PATH``, ``PIP_INDEX_URL``
388+
* passed through on all platforms: ``CURL_CA_BUNDLE`, ``PATH``,
389+
``LANG``, ``LANGUAGE``,
390+
``LD_LIBRARY_PATH``, ``PIP_INDEX_URL``,
391+
``REQUESTS_CA_BUNDLE``, ``SSL_CERT_FILE``
390392
* Windows: ``SYSTEMDRIVE``, ``SYSTEMROOT``, ``PATHEXT``, ``TEMP``, ``TMP``
391393
``NUMBER_OF_PROCESSORS``, ``USERPROFILE``, ``MSYSTEM``
392394
* Others (e.g. UNIX, macOS): ``TMPDIR``

src/tox/config/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,11 +664,14 @@ def passenv(testenv_config, value):
664664
value = list(itertools.chain.from_iterable([x.split(" ") for x in value]))
665665

666666
passenv = {
667-
"PATH",
668-
"PIP_INDEX_URL",
667+
"CURL_CA_BUNDLE",
669668
"LANG",
670669
"LANGUAGE",
671670
"LD_LIBRARY_PATH",
671+
"PATH",
672+
"PIP_INDEX_URL",
673+
"REQUESTS_CA_BUNDLE",
674+
"SSL_CERT_FILE",
672675
"TOX_WORK_DIR",
673676
str(REPORTER_TIMESTAMP_ON_ENV),
674677
str(PARALLEL_ENV_VAR_KEY_PUBLIC),

tests/unit/config/test_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,11 @@ def test_passenv_as_multiline_list(self, newconfig, monkeypatch, plat):
10691069
assert "MSYSTEM" in envconfig.passenv
10701070
else:
10711071
assert "TMPDIR" in envconfig.passenv
1072+
assert "CURL_CA_BUNDLE" in envconfig.passenv
10721073
assert "PATH" in envconfig.passenv
10731074
assert "PIP_INDEX_URL" in envconfig.passenv
1075+
assert "REQUESTS_CA_BUNDLE" in envconfig.passenv
1076+
assert "SSL_CERT_FILE" in envconfig.passenv
10741077
assert "LANG" in envconfig.passenv
10751078
assert "LANGUAGE" in envconfig.passenv
10761079
assert "LD_LIBRARY_PATH" in envconfig.passenv

tox.ini

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ description = run the tests with pytest under {basepython}
1919
setenv = PIP_DISABLE_VERSION_CHECK = 1
2020
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
2121
VIRTUALENV_NO_DOWNLOAD = 1
22-
passenv = http_proxy https_proxy no_proxy SSL_CERT_FILE PYTEST_*
22+
passenv =
23+
CURL_CA_BUNDLE
24+
http_proxy
25+
https_proxy
26+
no_proxy
27+
REQUESTS_CA_BUNDLE
28+
SSL_CERT_FILE
29+
PYTEST_*
2330
deps = pip == 19.1.1
2431
extras = testing
2532
commands = pytest \

0 commit comments

Comments
 (0)