You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,57 @@ We use Black (code formatter), isort (code formatter), flake8 (linter) and mypy
36
36
$ make lint
37
37
```
38
38
39
+
### Using Docker for development
40
+
41
+
You can also use Docker to run tests and linters without setting up a local Python environment. This is especially useful for ensuring consistent behavior across different environments.
42
+
43
+
#### Available Docker targets
44
+
45
+
-`lint_with_docker`: Run linters in Docker
46
+
-`lint-fix_with_docker`: Fix linting issues in Docker
47
+
-`test_with_docker`: Run tests in Docker
48
+
-`check_with_docker`: Run both linters and tests in Docker
49
+
50
+
#### Specifying Python version
51
+
52
+
You can specify which Python version to use by setting the `PYTHON_VERSION` environment variable:
53
+
54
+
```shell
55
+
$ PYTHON_VERSION=3.9 make lint_with_docker
56
+
```
57
+
58
+
The default Python version is 3.8 if not specified.
59
+
60
+
#### Accessing host services from Docker
61
+
62
+
When running tests in Docker, the container needs to access services running on your host machine (like a local Stream Chat server). The Docker targets use `host.docker.internal` to access the host machine, which is automatically configured with the `--add-host=host.docker.internal:host-gateway` flag.
63
+
64
+
> ⚠️ **Note**: The `host.docker.internal` DNS name works on Docker for Mac, Docker for Windows, and recent versions of Docker for Linux. If you're using an older version of Docker for Linux, you might need to use your host's actual IP address instead.
65
+
66
+
For tests that need to access a Stream Chat server running on your host machine, the Docker targets automatically set `STREAM_HOST=http://host.docker.internal:3030`.
67
+
68
+
#### Examples
69
+
70
+
Run linters in Docker:
71
+
```shell
72
+
$ make lint_with_docker
73
+
```
74
+
75
+
Fix linting issues in Docker:
76
+
```shell
77
+
$ make lint-fix_with_docker
78
+
```
79
+
80
+
Run tests in Docker:
81
+
```shell
82
+
$ make test_with_docker
83
+
```
84
+
85
+
Run both linters and tests in Docker:
86
+
```shell
87
+
$ make check_with_docker
88
+
```
89
+
39
90
## Commit message convention
40
91
41
92
Since we're autogenerating our [CHANGELOG](./CHANGELOG.md), we need to follow a specific commit message convention.
0 commit comments