8
8
```
9
9
10
10
Our tests are inside ` tests/ ` . Tests are implemented using
11
- [ pytest] [ pytest ] .
11
+ [ pytest] .
12
12
13
13
` make test ` will create a tmux server on a separate ` socket_name `
14
14
using ` $ tmux -L test_case ` .
@@ -24,97 +24,88 @@ using `$ tmux -L test_case`.
24
24
To begin developing, check out the code from github:
25
25
26
26
``` console
27
-
28
27
$ git clone git@github.com:tmux-python/tmuxp.git
29
- $ cd tmuxp
30
-
31
28
```
32
29
33
- ### Advanced: Manual virtual
34
-
35
- Now create a virtualenv, if you don't know how to, you can create a
36
- virtualenv with:
37
-
38
30
``` console
39
-
40
- $ virtualenv .venv
41
-
42
- ```
43
-
44
- Then activate it to your current tty / terminal session with:
45
-
46
- ``` console
47
-
48
- $ source .venv/bin/activate
49
-
50
- ```
51
-
52
- Good! Now let's run this:
53
-
54
- ``` console
55
-
56
- $ pip install -e .
57
-
58
- ```
59
-
60
- This has ` pip ` , a python package manager install the python package
61
- in the current directory. ` -e ` means ` --editable ` , which means you can
62
- adjust the code and the installed software will reflect the changes.
63
-
64
- ``` console
65
-
66
- $ tmuxp
67
-
31
+ $ cd tmuxp
68
32
```
69
33
70
- ### Simple: Using poetry
34
+ ### Bootstrap
71
35
72
- The easiest way to configure a dev environment is through [ poetry] [ poetry ] . This
36
+ The easiest way to configure a dev environment is through [ poetry] . This
73
37
automatically will manage virtualenv and python dependencies for tmuxp.
74
- For information on installing poetry visit the [ poetry's documentation] [ poetry's documentation ] .
38
+ For information on installing poetry visit the [ poetry's documentation] .
75
39
76
40
To begin developing, check out the code from github:
77
41
78
42
``` console
79
-
80
43
$ git clone git@github.com:tmux-python/tmuxp.git
81
- $ cd tmuxp
44
+ ```
82
45
46
+ ``` console
47
+ $ cd tmuxp
83
48
```
84
49
85
50
You can create a virtualenv, and install all of the locked
86
51
packages as listed in poetry.lock:
87
52
88
53
``` console
89
-
90
54
$ poetry install
91
-
92
55
```
93
56
94
57
If you ever need to update packages during your development session, the
95
58
following command can be used to update all packages as per poetry settings or
96
59
individual package (second command):
97
60
98
61
``` console
99
-
100
62
$ poetry update
101
- $ poetry update requests
63
+ ```
102
64
65
+ ``` console
66
+ $ poetry update requests
103
67
```
104
68
105
69
Then activate it to your current tty / terminal session with:
106
70
107
71
``` console
108
-
109
72
$ poetry shell
110
-
111
73
```
112
74
113
75
That is it! You are now ready to code!
114
76
115
77
[ poetry ] : https://python-poetry.org/
116
78
[ poetry's documentation ] : https://python-poetry.org/docs/
117
79
80
+ ### Advanced: Manual virtualenv
81
+
82
+ Now create a virtualenv, if you don't know how to, you can create a
83
+ virtualenv with:
84
+
85
+ ``` console
86
+ $ virtualenv .venv
87
+ ```
88
+
89
+ Then activate it to your current tty / terminal session with:
90
+
91
+ ``` console
92
+ $ source .venv/bin/activate
93
+ ```
94
+
95
+ Good! Now let's run this:
96
+
97
+ ``` console
98
+ $ pip install -e .
99
+ ```
100
+
101
+ This has ` pip ` , a python package manager install the python package
102
+ in the current directory. ` -e ` means ` --editable ` , which means you can
103
+ adjust the code and the installed software will reflect the changes.
104
+
105
+ ``` console
106
+ $ tmuxp
107
+ ```
108
+
118
109
## Test Runner
119
110
120
111
[ pytest] is used for tests.
@@ -204,11 +195,11 @@ $ make test
204
195
You probably didn't see anything but tests scroll by.
205
196
206
197
If you found a problem or are trying to write a test, you can file an
207
- [ issue on github] [ issue on github ] .
198
+ [ issue on github] .
208
199
209
200
(test-specific-tests)=
210
201
211
- ### Test runner options
202
+ ### Manual invocation
212
203
213
204
Test only a file:
214
205
@@ -232,7 +223,7 @@ $ py.test tests/test_{window,pane}.py tests/test_config.py::test_export_json
232
223
233
224
(test-builder-visually)=
234
225
235
- ## Visual testing
226
+ ### Visual testing
236
227
237
228
You can watch tmux testsuite build sessions visually by keeping a client
238
229
open in a separate terminal.
@@ -252,7 +243,7 @@ Create two terminals:
252
243
Terminal 1 should have flickered and built the session before your eyes.
253
244
tmuxp hides this building from normal users.
254
245
255
- ## Run tests on save
246
+ ### Run tests on save (old method)
256
247
257
248
You can re-run tests automatically on file edit.
258
249
@@ -272,7 +263,7 @@ $ make watch_test
272
263
```
273
264
274
265
You can also re-run a specific test file or any other [ py.test usage
275
- argument] [ py.test usage argument ] :
266
+ argument] :
276
267
277
268
``` console
278
269
$ make watch_test test=tests/test_config.py
@@ -282,7 +273,21 @@ $ make watch_test test=tests/test_config.py
282
273
$ make watch_test test=' -x tests/test_config.py tests/test_util.py'
283
274
```
284
275
285
- ## Rebuild sphinx docs on save
276
+ ### Testing options
277
+
278
+ ` RETRY_TIMEOUT_SECONDS ` can be toggled if certain workspace builder
279
+ tests are being stubborn.
280
+
281
+ e.g. ` RETRY_TIMEOUT_SECONDS=10 py.test `
282
+
283
+ ``` {literalinclude} ../.github/workflows/tests.yml
284
+ :language: yaml
285
+
286
+ ```
287
+
288
+ ## Documentation
289
+
290
+ ### Rebuild on save
286
291
287
292
Rebuild the documentation when an ` .rst ` file is edited:
288
293
@@ -312,9 +317,7 @@ $ make SPHINXBUILD='poetry run sphinx-build' watch
312
317
After you {ref}` install-dev-env ` , when inside the tmuxp checkout:
313
318
314
319
``` console
315
-
316
320
$ tmuxp load .
317
-
318
321
```
319
322
320
323
this will load the ` .tmuxp.yaml ` in the root of the project.
@@ -333,26 +336,16 @@ this will load the `.tmuxp.yaml` in the root of the project.
333
336
334
337
(gh-actions)=
335
338
336
- ## Github Actions
339
+ ## Continuous integration
340
+
341
+ ### Github Actions
337
342
338
- tmuxp uses [ github actions] [ github actions ] for continuous integration / automatic unit
343
+ tmuxp uses [ github actions] for continuous integration / automatic unit
339
344
testing.
340
345
341
- To view the tmux and python versions tested see the [ .github/workflows/tests.yml] [ .github/workflows/tests.yml ] .
346
+ To view the tmux and python versions tested see the [ .github/workflows/tests.yml] .
342
347
Builds are done on ` master ` and pull requests and can be viewed on
343
- the [ gh build site] [ gh build site ] .
344
-
345
- ## Testing options
346
-
347
- ` RETRY_TIMEOUT_SECONDS ` can be toggled if certain workspace builder
348
- tests are being stubborn.
349
-
350
- e.g. ` RETRY_TIMEOUT_SECONDS=10 py.test `
351
-
352
- ``` {literalinclude} ../.github/workflows/tests.yml
353
- :language: yaml
354
-
355
- ```
348
+ the [ gh build site] .
356
349
357
350
[ py.test usage argument ] : https://pytest.org/latest/usage.html
358
351
[ entr ] : http://entrproject.org/
0 commit comments