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
{{ message }}
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/development/contributing_guide.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,19 +48,28 @@ can find many good git tutorials on the web.
48
48
49
49
# 4. Install the dependencies
50
50
51
-
Once you have installed Python 3 and added the source, please open a terminal and
52
-
setup a *virtualenv*, as follows:
51
+
Synapse uses the [poetry](https://python-poetry.org/) project to manage its dependencies
52
+
and development environment. Once you have installed Python 3 and added the
53
+
source, you should install `poetry`.
54
+
Of their installation methods, we recommend
55
+
[installing `poetry` using `pipx`](https://python-poetry.org/docs/#installing-with-pipx),
56
+
57
+
```shell
58
+
pip install --user pipx
59
+
pipx install poetry
60
+
```
61
+
62
+
but see poetry's [installation instructions](https://python-poetry.org/docs/#installation)
63
+
for other installation methods.
64
+
65
+
Next, open a terminal and install dependencies as follows:
53
66
54
67
```sh
55
68
cd path/where/you/have/cloned/the/repository
56
-
python3 -m venv ./env
57
-
source ./env/bin/activate
58
-
pip install wheel
59
-
pip install -e ".[all,dev]"
60
-
pip install tox
69
+
poetry install --extras all
61
70
```
62
71
63
-
This will install the developer dependencies for the project.
72
+
This will install the runtime and developer dependencies for the project.
64
73
65
74
66
75
# 5. Get in touch.
@@ -117,11 +126,10 @@ The linters look at your code and do two things:
117
126
- ensure that your code follows the coding style adopted by the project;
118
127
- catch a number of errors in your code.
119
128
120
-
The linter takes no time at all to run as soon as you've [downloaded the dependencies into your python virtual environment](#4-install-the-dependencies).
129
+
The linter takes no time at all to run as soon as you've [downloaded the dependencies](#4-install-the-dependencies).
121
130
122
131
```sh
123
-
source ./env/bin/activate
124
-
./scripts-dev/lint.sh
132
+
poetry run ./scripts-dev/lint.sh
125
133
```
126
134
127
135
Note that this script *will modify your files* to fix styling errors.
@@ -131,15 +139,13 @@ If you wish to restrict the linters to only the files changed since the last com
131
139
(much faster!), you can instead run:
132
140
133
141
```sh
134
-
source ./env/bin/activate
135
-
./scripts-dev/lint.sh -d
142
+
poetry run ./scripts-dev/lint.sh -d
136
143
```
137
144
138
145
Or if you know exactly which files you wish to lint, you can instead run:
0 commit comments