diff --git a/NEWS.rst b/NEWS.rst index 0786b15..6f0abb0 100644 --- a/NEWS.rst +++ b/NEWS.rst @@ -5,7 +5,9 @@ Version history 0.0.7 (unreleased) ==================== -- Nothing yet. +- tox plugin: Work around https://github.com/tox-dev/tox/issues/2372 by + telling ``tox`` to pass through lower-case ``http_proxy`` and + ``https_proxy`` environment variables. 0.0.6 (2022-04-05) ==================== diff --git a/lpcraft/plugin/tests/test_plugins.py b/lpcraft/plugin/tests/test_plugins.py index d8872a5..f7c2012 100644 --- a/lpcraft/plugin/tests/test_plugins.py +++ b/lpcraft/plugin/tests/test_plugins.py @@ -60,7 +60,7 @@ def test_tox_plugin(self, mock_get_host_architecture, mock_get_provider): "apache2", ], cwd=PosixPath("/root/project"), - env={"PLUGIN": "tox"}, + env={"TOX_TESTENV_PASSENV": "http_proxy https_proxy"}, stdout=ANY, stderr=ANY, ), @@ -73,7 +73,7 @@ def test_tox_plugin(self, mock_get_host_architecture, mock_get_provider): "python3 -m pip install tox==3.24.5; tox", ], cwd=PosixPath("/root/project"), - env={"PLUGIN": "tox"}, + env={"TOX_TESTENV_PASSENV": "http_proxy https_proxy"}, stdout=ANY, stderr=ANY, ), @@ -152,14 +152,14 @@ def test_run_command_from_configuration_takes_precedence( "apache2", ], cwd=PosixPath("/root/project"), - env={"PLUGIN": "tox"}, + env={"TOX_TESTENV_PASSENV": "http_proxy https_proxy"}, stdout=ANY, stderr=ANY, ), call( ["bash", "--noprofile", "--norc", "-ec", "ls"], cwd=PosixPath("/root/project"), - env={"PLUGIN": "tox"}, + env={"TOX_TESTENV_PASSENV": "http_proxy https_proxy"}, stdout=ANY, stderr=ANY, ), diff --git a/lpcraft/plugins/plugins.py b/lpcraft/plugins/plugins.py index 7708e35..880816e 100644 --- a/lpcraft/plugins/plugins.py +++ b/lpcraft/plugins/plugins.py @@ -34,10 +34,10 @@ def lpcraft_execute_run(self) -> str: @hookimpl # type: ignore def lpcraft_set_environment(self) -> dict[str, str | None]: - # XXX jugmac00 2021-12-17: this was added to raise coverage and is not - # necessary. Let's remove this once we have a plugin which actually - # needs to set environment variables. - return {"PLUGIN": "tox"} + # Work around https://github.com/tox-dev/tox/issues/2372: without + # this, tox won't pass through the lower-case proxy environment + # variables set by launchpad-buildd. + return {"TOX_TESTENV_PASSENV": "http_proxy https_proxy"} @register(name="pyproject-build")