@@ -239,12 +239,12 @@ def _env_name_to_active(self) -> dict[str, bool]:
239
239
def _defined_envs (self ) -> dict [str , _ToxEnvInfo ]: # noqa: C901, PLR0912
240
240
# The problem of classifying run/package environments:
241
241
# There can be two type of tox environments: run or package. Given a tox environment name there's no easy way to
242
- # find out which it is. Intuitively a run environment is any environment that's not used for packaging by
243
- # another run environment. To find out what are the packaging environments for a run environment you have to
244
- # first construct it. This implies a two phase solution: construct all environments and query their packaging
245
- # environments. The run environments are the ones not marked as of packaging type. This requires being able
246
- # to change tox environments type , if it was earlier discovered as a run environment and is marked as packaging
247
- # we need to redefine it, e .g. when it shows up in config as [testenv:.package] and afterwards by a run env is
242
+ # find out which it is. Intuitively, a run environment is any environment not used for packaging by another run
243
+ # environment. To find out what are the packaging environments for a run environment, you have to first
244
+ # construct it. This implies a two- phase solution: construct all environments and query their packaging
245
+ # environments. The run environments are the ones not marked as of packaging type. This requires being able to
246
+ # change tox environments types , if it was earlier discovered as a run environment and is marked as packaging,
247
+ # we need to redefine it. E .g., when it shows up in config as [testenv:.package] and afterward by a run env is
248
248
# marked as package_env.
249
249
250
250
if self ._defined_envs_ is None : # noqa: PLR1702
@@ -267,7 +267,7 @@ def _defined_envs(self) -> dict[str, _ToxEnvInfo]: # noqa: C901, PLR0912
267
267
try :
268
268
run_env .package_env = self ._build_pkg_env (pkg_name_type , name , env_name_to_active )
269
269
except Exception as exception : # noqa: BLE001
270
- # if it's not a run environment, wait to see if ends up being a packaging one -> rollback
270
+ # if it's not a run environment, wait to see if ends up being a packaging one -> rollback
271
271
failed [name ] = exception
272
272
for key in self ._pkg_env_counter - start_package_env_use_counter :
273
273
del self ._defined_envs_ [key ]
@@ -320,6 +320,7 @@ def _build_run_env(self, name: str) -> RunToxEnv | None:
320
320
journal = self ._journal .get_env_journal (name )
321
321
args = ToxEnvCreateArgs (env_conf , self ._state .conf .core , self ._state .conf .options , journal , self ._log_handler )
322
322
run_env = runner (args )
323
+ run_env .register_config ()
323
324
self ._manager .tox_add_env_config (env_conf , self ._state )
324
325
return run_env
325
326
@@ -363,6 +364,7 @@ def _get_package_env(self, packager: str, name: str, is_active: bool) -> Package
363
364
journal = self ._journal .get_env_journal (name )
364
365
args = ToxEnvCreateArgs (pkg_conf , self ._state .conf .core , self ._state .conf .options , journal , self ._log_handler )
365
366
pkg_env : PackageToxEnv = package_type (args )
367
+ pkg_env .register_config ()
366
368
self ._defined_envs_ [name ] = _ToxEnvInfo (pkg_env , is_active )
367
369
self ._manager .tox_add_env_config (pkg_conf , self ._state )
368
370
return pkg_env
0 commit comments