2
2
3
3
[ poetry] is a required package to develop.
4
4
5
- ` git clone https://github.com/tmux-python/libtmux.git `
5
+ ``` console
6
+ $ git clone https://github.com/tmux-python/libtmux.git
7
+ ```
6
8
7
- ` cd libtmux `
9
+ ``` console
10
+ $ cd libtmux
11
+ ```
8
12
9
- ` poetry install -E "docs test coverage lint format" `
13
+ ``` console
14
+ $ poetry install -E " docs test coverage lint format"
15
+ ```
10
16
11
17
Makefile commands prefixed with ` watch_ ` will watch files and rerun.
12
18
@@ -21,23 +27,122 @@ Rerun tests on file change: `make watch_test` (requires [entr(1)])
21
27
22
28
Default preview server: http://localhost:8023
23
29
30
+ [ sphinx-autobuild] will automatically build the docs, watch for file changes and launch a server.
31
+
32
+ From home directory: ` make start_docs ` From inside ` docs/ ` : ` make start `
33
+
34
+ [ sphinx-autobuild ] : https://github.com/executablebooks/sphinx-autobuild
35
+
36
+ ### Manual documentation (the hard way)
37
+
24
38
` cd docs/ ` and ` make html ` to build. ` make serve ` to start http server.
25
39
26
- Helpers:
27
- ` make build_docs ` , ` make serve_docs `
40
+ Helpers: ` make build_docs ` , ` make serve_docs `
28
41
29
42
Rebuild docs on file change: ` make watch_docs ` (requires [ entr(1)] )
30
43
31
- Rebuild docs and run server via one terminal: ` make dev_docs ` (requires above, and a
32
- ` make(1) ` with ` -J ` support, e.g. GNU Make)
44
+ Rebuild docs and run server via one terminal: ` make dev_docs ` (requires above, and a ` make(1) ` with
45
+ ` -J ` support, e.g. GNU Make)
46
+
47
+ ## Formatting
48
+
49
+ The project uses [ black] and [ isort] (one after the other). Configurations are in ` pyproject.toml `
50
+ and ` setup.cfg ` :
51
+
52
+ - ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
53
+
54
+ ## Linting
55
+
56
+ [ flake8] and [ mypy] run via CI in our GitHub Actions. See the configuration in ` pyproject.toml ` and
57
+ ` setup.cfg ` .
58
+
59
+ ### flake8
60
+
61
+ [ flake8] provides fast, reliable, barebones styling and linting.
62
+
63
+ ```` {tab} Command
64
+
65
+ poetry:
66
+
67
+ ```console
68
+ $ poetry run flake8
69
+ ```
70
+
71
+ If you setup manually:
72
+
73
+ ```console
74
+ $ flake8
75
+ ```
76
+
77
+ ````
78
+
79
+ ```` {tab} make
80
+
81
+ ```console
82
+ $ make flake8
83
+ ```
84
+
85
+ ````
86
+
87
+ ```` {tab} Watch
88
+
89
+ ```console
90
+ $ make watch_flake8
91
+ ```
92
+
93
+ requires [`entr(1)`].
94
+
95
+ ````
96
+
97
+ ```` {tab} Configuration
98
+
99
+ See `[flake8]` in setup.cfg.
100
+
101
+ ```{literalinclude} ../setup.cfg
102
+ :language: ini
103
+ :start-at: "[flake8]"
104
+ :end-before: "[isort]"
105
+
106
+ ```
107
+
108
+ ````
109
+
110
+ ### mypy
111
+
112
+ [ mypy] is used for static type checking.
113
+
114
+ ```` {tab} Command
115
+
116
+ poetry:
117
+
118
+ ```console
119
+ $ poetry run mypy .
120
+ ```
121
+
122
+ If you setup manually:
123
+
124
+ ```console
125
+ $ mypy .
126
+ ```
127
+
128
+ ````
129
+
130
+ ```` {tab} make
131
+
132
+ ```console
133
+ $ make mypy
134
+ ```
135
+
136
+ ````
33
137
34
- ## Formatting / Linting
138
+ ```` {tab} Watch
35
139
36
- The project uses [ black] and [ isort] (one after the other) and runs [ flake8] via
37
- CI. See the configuration in ` pyproject.toml ` and ` setup.cfg ` :
140
+ ```console
141
+ $ make watch_mypy
142
+ ```
38
143
39
- ` make black isort ` : Run ` black ` first, then ` isort ` to handle import nuances
40
- ` make flake8 ` , to watch (requires ` entr(1) ` ): ` make watch_flake8 `
144
+ requires [`entr(1)`].
145
+ ``` `
41
146
42
147
## Releasing
43
148
0 commit comments