diff options
Diffstat (limited to 'src/tox/config')
-rw-r--r-- | src/tox/config/main.py | 6 | ||||
-rw-r--r-- | src/tox/config/source/api.py | 2 | ||||
-rw-r--r-- | src/tox/config/source/ini.py | 6 | ||||
-rw-r--r-- | src/tox/config/source/ini_section.py | 2 |
4 files changed, 9 insertions, 7 deletions
diff --git a/src/tox/config/main.py b/src/tox/config/main.py index 38efb600..00aaaed8 100644 --- a/src/tox/config/main.py +++ b/src/tox/config/main.py @@ -152,10 +152,10 @@ class Config: :param loaders: loaders to use for this configuration (only used for creation) :return: the tox environments config """ - section, base = self._src.get_tox_env_section(item) + section, base_test, base_pkg = self._src.get_tox_env_section(item) conf_set = self.get_section_config( section, - base=None if package else base, + base=base_pkg if package else base_test, of_type=EnvConfigSet, for_env=item, loaders=loaders, @@ -163,7 +163,7 @@ class Config: return conf_set def clear_env(self, name: str) -> None: - section, _ = self._src.get_tox_env_section(name) + section, _, __ = self._src.get_tox_env_section(name) del self._key_to_conf_set[(section.key, name)] diff --git a/src/tox/config/source/api.py b/src/tox/config/source/api.py index 3b95d504..e762d479 100644 --- a/src/tox/config/source/api.py +++ b/src/tox/config/source/api.py @@ -98,7 +98,7 @@ class Source(ABC): raise NotImplementedError @abstractmethod - def get_tox_env_section(self, item: str) -> tuple[Section, list[str]]: + def get_tox_env_section(self, item: str) -> tuple[Section, list[str], list[str]]: """:returns: the section for a tox environment""" raise NotImplementedError diff --git a/src/tox/config/source/ini.py b/src/tox/config/source/ini.py index f3e0c083..df6c2876 100644 --- a/src/tox/config/source/ini.py +++ b/src/tox/config/source/ini.py @@ -14,7 +14,7 @@ from ..loader.ini import IniLoader from ..loader.section import Section from ..sets import ConfigSet from .api import Source -from .ini_section import CORE, TEST_ENV_PREFIX, IniSection +from .ini_section import CORE, PKG_ENV_PREFIX, TEST_ENV_PREFIX, IniSection class IniSource(Source): @@ -62,8 +62,8 @@ class IniSource(Source): if in_section.prefix is not None: # no prefix specified, so this could imply our own prefix yield IniSection(in_section.prefix, a_base) - def get_tox_env_section(self, item: str) -> tuple[Section, list[str]]: - return IniSection.test_env(item), [TEST_ENV_PREFIX] + def get_tox_env_section(self, item: str) -> tuple[Section, list[str], list[str]]: + return IniSection.test_env(item), [TEST_ENV_PREFIX], [PKG_ENV_PREFIX] def envs(self, core_config: ConfigSet) -> Iterator[str]: seen = set() diff --git a/src/tox/config/source/ini_section.py b/src/tox/config/source/ini_section.py index 33a71863..a155dc1f 100644 --- a/src/tox/config/source/ini_section.py +++ b/src/tox/config/source/ini_section.py @@ -20,10 +20,12 @@ class IniSection(Section): TEST_ENV_PREFIX = "testenv" +PKG_ENV_PREFIX = "pkgenv" CORE = IniSection(None, "tox") __all__ = [ "IniSection", "CORE", "TEST_ENV_PREFIX", + "PKG_ENV_PREFIX", ] |