Skip to content

fix #1207 #1208

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

Merged
merged 2 commits into from
Mar 28, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changelog/1207.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Isolated build environment dependency overrides were not taken in consideration (and such it inherited the deps
from the testenv section) - by :user:`gaborbernat`
15 changes: 7 additions & 8 deletions src/tox/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,14 +1130,13 @@ def parse_build_isolation(self, config, reader):
config.isolated_build_env = reader.getstring("isolated_build_env", ".package")
if config.isolated_build is True:
name = config.isolated_build_env
if name not in config.envconfigs:
section_name = "testenv:{}".format(name)
if name not in self._cfg.sections:
self._cfg.sections[section_name] = {}
self._cfg.sections[section_name]["description"] = "isolated packaging environment"
config.envconfigs[name] = self.make_envconfig(
name, "{}{}".format(testenvprefix, name), reader._subs, config
)
section_name = "testenv:{}".format(name)
if section_name not in self._cfg.sections:
self._cfg.sections[section_name] = {}
self._cfg.sections[section_name]["description"] = "isolated packaging environment"
config.envconfigs[name] = self.make_envconfig(
name, "{}{}".format(testenvprefix, name), reader._subs, config
)

def _list_section_factors(self, section):
factors = set()
Expand Down
16 changes: 16 additions & 0 deletions tests/unit/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2930,6 +2930,22 @@ def test_isolated_build_env_cannot_be_in_envlist(newconfig, capsys):
assert not out


def test_isolated_build_overrides(newconfig, capsys):
inisource = """
[tox]
isolated_build = True

[testenv]
deps = something crazy here

[testenv:.package]
deps =
"""
config = newconfig([], inisource)
deps = config.envconfigs.get(".package").deps
assert deps == []


def test_config_via_pyproject_legacy(initproj):
initproj(
"config_via_pyproject_legacy-0.5",
Expand Down