From b9fdd40af6fa616fd5bdc8f890c859fd3e92e051 Mon Sep 17 00:00:00 2001 From: Bernat Gabor Date: Tue, 2 Apr 2019 18:09:38 -0400 Subject: [PATCH] fix --- docs/changelog/1239.bugfix.rst | 2 ++ src/tox/config/__init__.py | 2 ++ tests/unit/config/test_config.py | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 docs/changelog/1239.bugfix.rst diff --git a/docs/changelog/1239.bugfix.rst b/docs/changelog/1239.bugfix.rst new file mode 100644 index 000000000..3787919d2 --- /dev/null +++ b/docs/changelog/1239.bugfix.rst @@ -0,0 +1,2 @@ +the isolated build env now ignores :conf:`sitepackages`, :conf:`deps` and :conf:`description` as these do not make +sense - by :user:`gaborbernat` diff --git a/src/tox/config/__init__.py b/src/tox/config/__init__.py index 53e4003a4..ea6d96763 100644 --- a/src/tox/config/__init__.py +++ b/src/tox/config/__init__.py @@ -1135,6 +1135,8 @@ def parse_build_isolation(self, config, reader): section_name = "testenv:{}".format(name) if section_name not in self._cfg.sections: self._cfg.sections[section_name] = {} + self._cfg.sections[section_name]["deps"] = "" + self._cfg.sections[section_name]["sitepackages"] = "False" self._cfg.sections[section_name]["description"] = "isolated packaging environment" config.envconfigs[name] = self.make_envconfig( name, "{}{}".format(testenvprefix, name), reader._subs, config diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 55cbb547e..ccb8200f0 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -2946,6 +2946,27 @@ def test_isolated_build_overrides(newconfig, capsys): assert deps == [] +@pytest.mark.parametrize( + "key, set_value, default", [("deps", "crazy", []), ("sitepackages", "True", False)] +) +def test_isolated_build_ignores(newconfig, capsys, key, set_value, default): + config = newconfig( + [], + """ + [tox] + isolated_build = True + + [testenv] + {} = {} + """.format( + key, set_value + ), + ) + package_env = config.envconfigs.get(".package") + value = getattr(package_env, key) + assert value == default + + def test_config_via_pyproject_legacy(initproj): initproj( "config_via_pyproject_legacy-0.5",