Skip to content

Commit 30d5680

Browse files
committed
docs(developing): Update developer docs
Cherry-pick from #373
1 parent 61c4b8a commit 30d5680

1 file changed

Lines changed: 118 additions & 38 deletions

File tree

docs/developing.md

Lines changed: 118 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@ Install and [git] and [poetry]
1111

1212
Clone:
1313

14-
git clone https://github.com/vcs-python/vcspull.git
15-
cd vcspull
14+
```console
15+
$ git clone https://github.com/vcs-python/vcspull.git
16+
```
17+
18+
```console
19+
$ cd vcspull
20+
```
1621

1722
Install packages:
1823

19-
poetry install -E "docs test coverage lint format"
24+
```console
25+
$ poetry install -E "docs test coverage lint format"
26+
```
2027

2128
[installation documentation]: https://python-poetry.org/docs/#installation
2229
[git]: https://git-scm.com/
@@ -33,21 +40,29 @@ Install packages:
3340

3441
via [pytest-watcher] (works out of the box):
3542

36-
make start
43+
```console
44+
$ make start
45+
```
3746

3847
via [entr(1)] (requires installation):
3948

40-
make watch_test
49+
```console
50+
$ make watch_test
51+
```
4152

4253
[pytest-watcher]: https://github.com/olzhasar/pytest-watcher
4354

4455
#### Manual (just the command, please)
4556

46-
poetry run py.test
57+
```console
58+
$ poetry run py.test
59+
```
4760

4861
or:
4962

50-
make test
63+
```console
64+
$ make test
65+
```
5166

5267
#### pytest options
5368

@@ -58,16 +73,22 @@ information read [docs.pytest.com] for the latest documentation.
5873

5974
Verbose:
6075

61-
env PYTEST_ADDOPTS="-verbose" make start
76+
```console
77+
$ env PYTEST_ADDOPTS="-verbose" make start
78+
```
6279

6380
Drop into `pdb` on first error:
6481

65-
env PYTEST_ADDOPTS="-x -s --pdb" make start
82+
```console
83+
$ env PYTEST_ADDOPTS="-x -s --pdb" make start
84+
```
6685

6786
If you have [ipython] installed:
6887

69-
env PYTEST_ADDOPTS="--pdbcls=IPython.terminal.debugger:TerminalPdb" \
88+
```console
89+
$ env PYTEST_ADDOPTS="--pdbcls=IPython.terminal.debugger:TerminalPdb" \
7090
make start
91+
```
7192

7293
[ipython]: https://ipython.org/
7394

@@ -86,60 +107,115 @@ Default preview server: http://localhost:8022
86107
[sphinx-autobuild] will automatically build the docs, it also handles launching
87108
a server, rebuilding file changes, and updating content in the browser:
88109

89-
cd docs
90-
make start
110+
```console
111+
$ cd docs
112+
```
113+
114+
```console
115+
$ make start
116+
```
91117

92118
If doing css adjustments:
93119

94-
cd docs
95-
make design
120+
```console
121+
$ make design
122+
```
96123

97124
[sphinx-autobuild]: https://github.com/executablebooks/sphinx-autobuild
98125

99126
Rebuild docs on file change (requires [entr(1)]):
100127

101-
cd docs
102-
make dev
128+
```console
129+
$ cd docs
130+
```
103131

104-
# If not GNU Make / no -J support, use two terminals:
105-
cd docs
106-
make watch
132+
```console
133+
$ make dev
134+
```
107135

108-
cd docs
109-
make serve
136+
If not GNU Make / no -J support, use two terminals:
137+
138+
```console
139+
$ make watch
140+
```
141+
142+
```console
143+
$ make serve
144+
```
110145

111146
#### Manual (just the command, please)
112147

148+
```console
149+
$ cd docs
150+
```
151+
113152
Build:
114153

115-
cd docs
116-
make html
154+
```console
155+
$ make html
156+
```
117157

118158
Launch server:
119159

120-
cd docs
121-
make serve
160+
```console
161+
$ make serve
162+
```
122163

123-
### Formatting code
164+
## Linting
124165

125-
The project uses [black] and [isort] (one after the other) and runs [flake8] via
126-
CI. See the configuration in `pyproject.toml` and `setup.cfg`:
166+
[flake8] run via CI in our GitHub Actions. See the configuration in `pyproject.toml` and
167+
`setup.cfg`.
127168

128-
Run `black` first, then `isort` to handle import nuances:
169+
### flake8
129170

130-
make black isort
171+
[flake8] provides fast, reliable, barebones styling and linting.
131172

132-
[black]: https://github.com/psf/black
133-
[isort]: https://pypi.org/project/isort/
134-
[flake8]: https://flake8.pycqa.org/
173+
````{tab} Command
174+
175+
poetry:
176+
177+
```console
178+
$ poetry run flake8
179+
```
180+
181+
If you setup manually:
182+
183+
```console
184+
$ flake8
185+
```
135186
136-
### Linting code
187+
````
137188

138-
make flake8
189+
````{tab} make
139190
140-
to watch (requires [entr(1)])
191+
```console
192+
$ make flake8
193+
```
141194
142-
make watch_flake8
195+
````
196+
197+
````{tab} Watch
198+
199+
```console
200+
$ make watch_flake8
201+
```
202+
203+
requires [`entr(1)`].
204+
205+
````
206+
207+
````{tab} Configuration
208+
209+
See `[flake8]` in setup.cfg.
210+
211+
```{literalinclude} ../setup.cfg
212+
:language: ini
213+
:start-at: "[flake8]"
214+
:end-before: "[isort]"
215+
216+
```
217+
218+
````
143219

144220
## Publishing to PyPI
145221

@@ -155,5 +231,9 @@ Update `__version__` in `__about__.py` and `pyproject.toml`::
155231
poetry build
156232
poetry publish
157233

158-
[entr(1)]: http://eradman.com/entrproject/
159234
[poetry]: https://python-poetry.org/
235+
[entr(1)]: http://eradman.com/entrproject/
236+
[`entr(1)`]: http://eradman.com/entrproject/
237+
[black]: https://github.com/psf/black
238+
[isort]: https://pypi.org/project/isort/
239+
[flake8]: https://flake8.pycqa.org/

0 commit comments

Comments
 (0)