diff options
author | Bernát Gábor <gaborjbernat@gmail.com> | 2023-01-04 16:10:30 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 16:10:30 -0800 |
commit | 4eed8d5135e6c2f04c7779354b262c86ae90d898 (patch) | |
tree | 28071101e33eaede9317322ff562413a05b1725e /src/tox/session | |
parent | 497c17c5c043801a9d61f63472feed24f0af7250 (diff) | |
download | tox-git-4eed8d5135e6c2f04c7779354b262c86ae90d898.tar.gz |
Fix devenv when package for env is wheel/editable (#2820)
Resolves https://github.com/tox-dev/tox/issues/2815
Diffstat (limited to 'src/tox/session')
-rw-r--r-- | src/tox/session/cmd/devenv.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/tox/session/cmd/devenv.py b/src/tox/session/cmd/devenv.py index ff98180a..5ff28ad5 100644 --- a/src/tox/session/cmd/devenv.py +++ b/src/tox/session/cmd/devenv.py @@ -17,31 +17,31 @@ from tox.session.state import State def tox_add_option(parser: ToxParser) -> None: help_msg = "sets up a development environment at ENVDIR based on the tox configuration specified " our = parser.add_command("devenv", ["d"], help_msg, devenv) - our.add_argument("devenv_path", metavar="path", default=Path("venv").absolute(), nargs="?") + our.add_argument("devenv_path", metavar="path", default=Path("venv"), nargs="?", type=Path) register_env_select_flags(our, default=CliEnv("py"), multiple=False) env_run_create_flags(our, mode="devenv") def devenv(state: State) -> int: opt = state.conf.options + opt.devenv_path = opt.devenv_path.absolute() opt.skip_missing_interpreters = False # the target python must exist opt.no_test = False # do not run the test suite opt.package_only = False opt.install_pkg = None # no explicit packages to install opt.skip_pkg_install = False # always install a package in this case opt.no_test = True # do not run the test phase + loader = MemoryLoader( # these configuration values are loaded from in-memory always (no file conf) + usedevelop=True, # dev environments must be of type dev + env_dir=opt.devenv_path, # move it in source + ) + state.conf.memory_seed_loaders[list(opt.env)[0]].append(loader) state.envs.ensure_only_run_env_is_active() envs = list(state.envs.iter()) if len(envs) != 1: raise HandledError(f"exactly one target environment allowed in devenv mode but found {', '.join(envs)}") - loader = MemoryLoader( # these configuration values are loaded from in-memory always (no file conf) - usedevelop=True, # dev environments must be of type dev - env_dir=Path(opt.devenv_path), # move it in source - ) - tox_env = state.envs[envs[0]] - tox_env.conf.loaders.insert(0, loader) result = run_sequential(state) if result == 0: - logging.warning(f"created development environment under {tox_env.conf['env_dir']}") + logging.warning(f"created development environment under {opt.devenv_path}") return result |