@@ -1025,12 +1025,51 @@ For example, given this config:
1025
1025
1026
1026
You could enable ``ignore_errors `` by running::
1027
1027
1028
- tox --override testenv.ignore_errors=True
1028
+ .. code-block :: bash
1029
+
1030
+ tox --override testenv.ignore_errors=True
1029
1031
1030
1032
You could add additional dependencies by running::
1031
1033
1032
- tox --override testenv.deps+=pytest-xdist,pytest-cov
1034
+ .. code-block :: bash
1035
+
1036
+ tox --override testenv.deps+=pytest-xdist,pytest-cov
1033
1037
1034
1038
You could set additional environment variables by running::
1035
1039
1036
- tox --override testenv.setenv+=baz=quux
1040
+ .. code-block :: bash
1041
+
1042
+ tox --override testenv.setenv+=baz=quux
1043
+
1044
+ Set CLI flags via environment variables
1045
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1046
+ All CLI flags can be set via environment variables too, the naming convention here is ``TOX_<option> ``. E.g.
1047
+ ``TOX_WORKDIR `` sets the ``--workdir `` flag, or ``TOX_OVERRIDE `` sets the ``--override `` flag. For flags accepting more
1048
+ than one arguments (such as override) use the ``; `` character to separate these values:
1049
+
1050
+ .. code-block :: bash
1051
+
1052
+ # set FOO and bar as passed environment variable
1053
+ $ env ' TOX_OVERRIDE=testenv.pass_env=FOO,BAR' tox c -k pass_env -e py
1054
+ [testenv:py]
1055
+ pass_env =
1056
+ BAR
1057
+ FOO
1058
+ < default pass_envs>
1059
+
1060
+ # append FOO and bar as passed environment variable to the list already defined in
1061
+ # the tox configuration
1062
+ $ env ' TOX_OVERRIDE=testenv.pass_env+=FOO,BAR' tox c -k pass_env -e py
1063
+ [testenv:py]
1064
+ pass_env =
1065
+ BAR
1066
+ FOO
1067
+ < pass_envs defined in configuration>
1068
+ < default pass_envs>
1069
+
1070
+ # set httpx and deps to and 3.12 as base_python
1071
+ $ env ' TOX_OVERRIDE=testenv.deps=httpx;testenv.base_python=3.12' .tox/dev/bin/tox c \
1072
+ -k deps base_python -e py
1073
+ [testenv:py]
1074
+ deps = httpx
1075
+ base_python = 3.12
0 commit comments