summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorq0w <43147888+q0w@users.noreply.github.com>2022-12-26 07:00:34 +0300
committerGitHub <noreply@github.com>2022-12-26 04:00:34 +0000
commitbf87bea75f2becbbcb29346567e6bf249da2b063 (patch)
tree7565c2e22702fc4fb4f1fdc6252456155f4d9c00 /src
parenta36ff9dcf9457a56cf8e694b6dce40ac79566242 (diff)
downloadtox-git-bf87bea75f2becbbcb29346567e6bf249da2b063.tar.gz
Override toxworkdir with --workdir. (#2776)
* Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir. * Override toxworkdir with --workdir.
Diffstat (limited to 'src')
-rw-r--r--src/tox/config/sets.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tox/config/sets.py b/src/tox/config/sets.py
index e07f4bd4..98a31251 100644
--- a/src/tox/config/sets.py
+++ b/src/tox/config/sets.py
@@ -191,10 +191,14 @@ class CoreConfigSet(ConfigSet):
def work_dir_builder(conf: Config, env_name: str | None) -> Path: # noqa: U100
return (conf.work_dir if conf.work_dir is not None else cast(Path, self["tox_root"])) / ".tox"
+ def work_dir_post_process(value: Path) -> Path:
+ return self._conf.work_dir if self._conf.options.work_dir else value
+
self.add_config(
keys=["work_dir", "toxworkdir"],
of_type=Path,
default=work_dir_builder,
+ post_process=work_dir_post_process,
desc="working directory",
)
self.add_config(