|
1 | | -**Development** |
| 1 | +# Development |
| 2 | + |
2 | 3 | After cloning the project, you'll need to set up the development environment. Here are the guidelines on how to do this. |
3 | 4 |
|
4 | | -## Virtual Environment with [pdm](https://pdm-project.org/en/latest/) |
| 5 | +The development workflow should look like this: |
| 6 | +- Add feature/fix bug |
| 7 | +- Run tests |
| 8 | +- Add tests |
| 9 | +- Run tests |
| 10 | +- Lint |
| 11 | +- Add docs |
| 12 | +- Open PR |
5 | 13 |
|
6 | | -Create a virtual environment in a directory using Python's `.venv` module: |
| 14 | +## Create venv with [PDM](https://pdm-project.org/en/latest/) |
7 | 15 |
|
8 | 16 | ```bash |
9 | | -pdm use |
| 17 | +pdm venv create 3.10 |
10 | 18 | ``` |
11 | | -That will create a `./.venv/` directory with Python binaries, allowing you to install packages in an isolated environment. |
12 | 19 |
|
13 | | -# Activate the Environment |
| 20 | +## Activate venv |
14 | 21 |
|
15 | 22 | ```bash |
16 | | -source ./.venv/bin/activate |
| 23 | +source .venv/bin/activate |
17 | 24 | ``` |
18 | | -## Installing Dependencies |
19 | 25 |
|
20 | | -After activating the virtual environment as described above, run: |
| 26 | +## Install dependencies with [just](https://github.com/casey/just) |
21 | 27 |
|
22 | 28 | ```bash |
23 | 29 | just install |
24 | 30 | ``` |
25 | | -The link to install [just](https://github.com/casey/just). |
26 | | - |
27 | | -If you do not want to install just, then follow these steps: |
| 31 | +or |
28 | 32 | ```bash |
29 | | - pdm install -G:all |
30 | | - pip install -r docs/requirements.txt |
31 | | - pre-commit install |
| 33 | +pdm install -G:all |
| 34 | +pip install -r docs/requirements.txt |
| 35 | +pre-commit install |
32 | 36 | ``` |
33 | | -## Running Tests |
34 | | -To run tests with your current **ASGI Monitor** application and Python environment, use: |
| 37 | + |
| 38 | +## Running tests |
35 | 39 |
|
36 | 40 | ```bash |
37 | 41 | just test |
38 | 42 | ``` |
39 | | -or: |
40 | | - |
| 43 | +or |
41 | 44 | ```bash |
42 | 45 | pytest tests --cov=asgi_monitor --cov-append --cov-report term-missing -v |
43 | 46 | ``` |
44 | 47 |
|
45 | 48 | ## Running lint |
46 | | -To run lints with your current **ASGI Monitor** application and Python environment, use: |
| 49 | + |
47 | 50 | ```bash |
48 | 51 | just lint |
49 | 52 | ``` |
50 | | -or: |
51 | | - |
| 53 | +or |
52 | 54 | ```bash |
53 | 55 | pre-commit run --all-files |
54 | 56 | ``` |
| 57 | + |
| 58 | +## Build documentation |
| 59 | + |
| 60 | +```bash |
| 61 | +just doc |
| 62 | +``` |
| 63 | +or |
| 64 | +```bash |
| 65 | +sphinx-build -M html docs docs-build |
| 66 | +echo "Open file://`pwd`/docs-build/html/index.html" |
| 67 | +``` |
| 68 | + |
| 69 | +## We look forward to your contribution! |
0 commit comments