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

Method ensure_python_env

src/tox/tox_env/python/api.py:336–342  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

334 self._paths = self.prepend_env_var_path() # now that the environment exist we can add them to the path
335
336 def ensure_python_env(self) -> None:
337 conf = self.python_cache()
338 with self.cache.compare(conf, Python.__name__) as (eq, old):
339 if old is None: # does not exist -> create
340 self.create_python_env()
341 elif eq is False: # pragma: no branch # exists but changed -> recreate
342 raise Recreate(self._diff_msg(conf, old))
343
344 @staticmethod
345 def _diff_msg(conf: dict[str, Any], old: dict[str, Any]) -> str:

Callers 1

_setup_envMethod · 0.95

Calls 5

python_cacheMethod · 0.95
create_python_envMethod · 0.95
_diff_msgMethod · 0.95
RecreateClass · 0.90
compareMethod · 0.80

Tested by

no test coverage detected