MCPcopy
hub / github.com/tox-dev/tox / get_env

Method get_env

src/tox/config/main.py:178–204  ·  view source on GitHub ↗

Return the configuration for a given tox environment (will create if not exist yet). :param item: the name of the environment is :param package: a flag indicating if the environment is of type packaging or not (only used for creation) :param loaders: loaders to use for this

(
        self,
        item: str,
        package: bool = False,  # noqa: FBT001, FBT002
        loaders: Sequence[Loader[Any]] | None = None,
    )

Source from the content-addressed store, hash-verified

176 return conf_set
177
178 def get_env(
179 self,
180 item: str,
181 package: bool = False, # noqa: FBT001, FBT002
182 loaders: Sequence[Loader[Any]] | None = None,
183 ) -> EnvConfigSet:
184 """Return the configuration for a given tox environment (will create if not exist yet).
185
186 :param item: the name of the environment is
187 :param package: a flag indicating if the environment is of type packaging or not (only used for creation)
188 :param loaders: loaders to use for this configuration (only used for creation)
189
190 :returns: the tox environments config
191
192 """
193 if item in self._env_to_conf_set:
194 return self._env_to_conf_set[item]
195 section, base_test, base_pkg = self._src.get_tox_env_section(item)
196 result = self.get_section_config(
197 section,
198 base=base_pkg if package else base_test,
199 of_type=EnvConfigSet,
200 for_env=item,
201 loaders=loaders,
202 )
203 self._env_to_conf_set[item] = result
204 return result
205
206 def clear_env(self, name: str) -> None:
207 section, _, __ = self._src.get_tox_env_section(name)

Callers 15

exampleFunction · 0.95
env_confMethod · 0.80
_build_run_envMethod · 0.80
_get_package_envMethod · 0.80
load_posargsFunction · 0.80
replace_envFunction · 0.80
_config_value_sourcesMethod · 0.80
_replace_refMethod · 0.80
_config_value_sourcesMethod · 0.80
test_custom_work_dirFunction · 0.80
test_custom_root_dirFunction · 0.80

Calls 2

get_section_configMethod · 0.95
get_tox_env_sectionMethod · 0.45

Tested by 15

exampleFunction · 0.76
env_confMethod · 0.64
test_custom_work_dirFunction · 0.64
test_custom_root_dirFunction · 0.64
_makeFunction · 0.64
test_empty_conf_getFunction · 0.64
test_config_some_envsFunction · 0.64
test_config_overridesFunction · 0.64