1HATCH-RUN(1) User Commands HATCH-RUN(1)
2
3
4
6 hatch run – Run commands within project environments
7
9 hatch run [OPTIONS] [ENV:]ARGS...
10
12 This is a convenience wrapper around the hatch-env-run(1) command.
13
14 If the first argument contains a colon, then the preceding component
15 will be interpreted as the name of the environment to target, overrid‐
16 ing the -e/--env root option and the HATCH_ENV environment variable.
17
18 If the environment provides matrices, then you may also provide leading
19 arguments starting with a + or - to select or exclude certain vari‐
20 ables, optionally followed by specific comma-separated values.
21
23 For example, if you have the following configuration:
24
25 pyproject.toml
26 [[tool.hatch.envs.test.matrix]]
27 python = ["39", "310"]
28 version = ["42", "3.14", "9000"]
29
30 hatch.toml
31 [[envs.test.matrix]]
32 python = ["39", "310"]
33 version = ["42", "3.14", "9000"]
34
35 then running:
36
37 hatch run +py=310 -version=9000 test:pytest
38
39 would execute pytest in the environments test.py310-42 and
40 test.py310-3.14. Note that py may be used as an alias for python.
41
43 hatch-build(1), hatch-clean(1), hatch-config(1), hatch-dep(1),
44 hatch-env(1), hatch-new(1), hatch-project(1), hatch-publish(1),
45 hatch-shell(1), hatch-status(1), hatch-version(1)
46
47 hatch(1)
48
49 hatch-env-run(1)
50
51
52
53 October 2022 HATCH-RUN(1)