@@ -416,7 +416,12 @@ def tox_addoption(parser):
416
416
help = "work against specified environments (ALL selects all)." ,
417
417
)
418
418
parser .add_argument (
419
- "--devenv" , help = "sets up a development environment based on the tox configuration."
419
+ "--devenv" ,
420
+ metavar = "ENVDIR" ,
421
+ help = (
422
+ "sets up a development environment at ENVDIR based on the env's tox "
423
+ "configuration specified by `-e` (-e defaults to py)."
424
+ ),
420
425
)
421
426
parser .add_argument ("--notest" , action = "store_true" , help = "skip invoking test commands." )
422
427
parser .add_argument (
@@ -501,7 +506,7 @@ def tox_addoption(parser):
501
506
)
502
507
503
508
def _set_envdir_from_devenv (testenv_config , value ):
504
- if testenv_config .config .option .devenv :
509
+ if testenv_config .config .option .devenv is not None :
505
510
return py .path .local (testenv_config .config .option .devenv )
506
511
else :
507
512
return value
@@ -761,7 +766,7 @@ def pip_pre(testenv_config, value):
761
766
762
767
def develop (testenv_config , value ):
763
768
option = testenv_config .config .option
764
- return not option .installpkg and (value or option .develop or bool ( option .devenv ) )
769
+ return not option .installpkg and (value or option .develop or option .devenv is not None )
765
770
766
771
parser .add_testenv_attribute (
767
772
name = "usedevelop" ,
@@ -1116,10 +1121,10 @@ def run(name, section, subs, config):
1116
1121
1117
1122
config .skipsdist = reader .getbool ("skipsdist" , all_develop )
1118
1123
1119
- if config .option .devenv :
1124
+ if config .option .devenv is not None :
1120
1125
config .option .notest = True
1121
1126
1122
- if config .option .devenv and len (config .envlist ) != 1 :
1127
+ if config .option .devenv is not None and len (config .envlist ) != 1 :
1123
1128
feedback ("--devenv requires only a single -e" , sysexit = True )
1124
1129
1125
1130
def handle_provision (self , config , reader ):
@@ -1267,7 +1272,7 @@ def _getenvdata(self, reader, config):
1267
1272
(os .environ .get (PARALLEL_ENV_VAR_KEY ), True ),
1268
1273
(from_option , True ),
1269
1274
(from_environ , True ),
1270
- ("py" if self .config .option .devenv else None , False ),
1275
+ ("py" if self .config .option .devenv is not None else None , False ),
1271
1276
(from_config , False ),
1272
1277
)
1273
1278
env_str , envlist_explicit = next (((i , e ) for i , e in candidates if i ), ([], False ))
0 commit comments