Skip to content

Commit aeaec83

Browse files
committed
docs: Update development docs
1 parent e827150 commit aeaec83

File tree

1 file changed

+37
-83
lines changed

1 file changed

+37
-83
lines changed

docs/developing.md

Lines changed: 37 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,106 +1,60 @@
11
# Development
22

3-
## Testing
3+
`poetry`\_ is a required package to develop.
44

5-
Our tests are inside `tests/`. Tests are implemented using
6-
[pytest](http://pytest.org/).
5+
`git clone https://github.com/vcs-python/libvcs.git`
76

8-
## Install the latest code from git
7+
`cd libvcs`
98

10-
### Using pip
9+
`poetry install -E "docs test coverage lint format"`
1110

12-
To begin developing, check out the code from github:
11+
Makefile commands prefixed with `watch_` will watch files and rerun.
1312

14-
$ git clone git@github.com:vcs-python/libvcs.git
15-
$ cd libvcs
13+
## Tests
1614

17-
Now create a virtualenv, if you don't know how to, you can create a
18-
virtualenv with:
15+
`poetry run py.test`
1916

20-
$ virtualenv .venv
17+
Helpers: `make test`
18+
Rerun tests on file change: `make watch_test` (requires [entr(1)])
2119

22-
Then activate it to current tty / terminal session with:
20+
## Documentation
2321

24-
$ source .venv/bin/activate
22+
Default preview server: http://localhost:8068
2523

26-
Good! Now let's run this:
24+
`cd docs/` and `make html` to build. `make serve` to start http server.
2725

28-
$ pip install -r requirements/test.txt -e .
26+
Helpers:
27+
`make build_docs`, `make serve_docs`
2928

30-
This has `pip`, a python package manager install the python package in
31-
the current directory. `-e` means `--editable`, which means you can
32-
adjust the code and the installed software will reflect the changes.
29+
Rebuild docs on file change: `make watch_docs` (requires [entr(1)])
3330

34-
### Using poetry
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)
3533

36-
To begin developing, check out the code from github:
34+
## Formatting / Linting
3735

38-
$ git clone git@github.com:vcs-python/libvcs.git
39-
$ cd libvcs
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`:
4038

41-
You can create a virtualenv, and install all of the locked packages as
42-
listed in poetry.lock:
39+
`make black isort`: Run `black` first, then `isort` to handle import nuances
40+
`make flake8`, to watch (requires `entr(1)`): `make watch_flake8`
4341

44-
$ poetry install
42+
## Releasing
4543

46-
If you ever need to update packages during your development session, the
47-
following command can be used to update all packages as per poetry
48-
settings or individual package (second command):
44+
As of 0.10, `poetry`\_ handles virtualenv creation, package requirements, versioning,
45+
building, and publishing. Therefore there is no setup.py or requirements files.
4946

50-
$ poetry update
51-
$ poetry update requests
47+
Update `__version__` in `__about__.py` and `pyproject.toml`::
5248

53-
Then activate it to your current tty / terminal session with:
49+
git commit -m 'build(libvcs): Tag v0.1.1'
50+
git tag v0.1.1
51+
git push
52+
git push --tags
53+
poetry build
54+
poetry deploy
5455

55-
$ poetry shell
56-
57-
That is it! You are now ready to code!
58-
59-
## Test Runner
60-
61-
As you seen above, the `libvcs` command will now be available to you,
62-
since you are in the virtual environment, your <span
63-
class="title-ref">PATH</span> environment was updated to include a
64-
special version of `python` inside your `.venv` folder with its own
65-
packages.
66-
67-
$ make test
68-
69-
You probably didn't see anything but tests scroll by.
70-
71-
If you found a problem or are trying to write a test, you can file an
72-
[issue on github](https://github.com/vcs-python/libvcs/issues).
73-
74-
#### Test runner options
75-
76-
Test only a file:
77-
78-
$ py.test tests/test_util.py
79-
80-
will test the `tests/test_util.py` tests.
81-
82-
$ py.test tests/test_util.py::test_mkdir_p
83-
84-
tests `test_mkdir_p` inside of `tests/test_util.py`.
85-
86-
Multiple can be separated by spaces:
87-
88-
$ py.test tests/test_{git,svn}.py tests/test_util.py::test_mkdir_p
89-
90-
## Docs
91-
92-
Build docs to _site/_:
93-
94-
$ make build_docs
95-
96-
Serve docs from http://localhost:8000:
97-
98-
$ make serve_docs
99-
100-
Rebuild docs when files are edited (requires [`entr(1)`](http://eradman.com/entrproject/)):
101-
102-
$ make watch_docs
103-
104-
Serve + watch w/ rebuild (requires `make(1)` w/ `-j` support, usually GNU Make):
105-
106-
$ make dev_docs
56+
[poetry]: https://python-poetry.org/
57+
[entr(1)]: http://eradman.com/entrproject/
58+
[black]: https://github.com/psf/black
59+
[isort]: https://pypi.org/project/isort/
60+
[flake8]: https://flake8.pycqa.org/

0 commit comments

Comments
 (0)