1HATCH-ENV-RUN(1) User Commands HATCH-ENV-RUN(1)
2
3
4
6 hatch env run – Run commands within project environments
7
9 hatch env run [OPTIONS] [ARGS]...
10
12 The -e /--env option overrides the equivalent root option and the
13 HATCH_ENV environment variable.
14
15 If environments provide matrices, then you may use the -i / --include
16 and -x / --exclude options to select or exclude certain variables, op‐
17 tionally followed by specific comma-separated values.
18
20 -e, --env TEXT
21 The environments to target
22
23 -i, --include TEXT
24 The matrix variables to include
25
26 -x, --exclude TEXT
27 The matrix variables to exclude
28
29 -f, --filter TEXT
30 The JSON data used to select environments
31
32 --force-continue
33 Run every command and if there were any errors exit with the
34 first code
35
36 --ignore-compat
37 Ignore incompatibility when selecting specific environments
38
39 -h, --help
40 Show a help message and exit
41
43 For example, if you have the following configuration:
44
45 pyproject.toml
46 [[tool.hatch.envs.test.matrix]]
47 python = ["39", "310"]
48 version = ["42", "3.14", "9000"]
49
50 hatch.toml
51 [[envs.test.matrix]]
52 python = ["39", "310"]
53 version = ["42", "3.14", "9000"]
54
55 then running:
56
57 hatch env run -i py=310 -x -version=9000 test:pytest
58
59 would execute pytest in the environments test.py310-42 and
60 test.py310-3.14. Note that py may be used as an alias for python.
61
63 hatch-run(1)
64
65 hatch-env-create(1), hatch-env-find(1), hatch-env-prune(1),
66 hatch-env-remove(1), hatch-env-show(1)
67
68 hatch-env(1), hatch(1)
69
70
71
72 October 2022 HATCH-ENV-RUN(1)