@@ -95,33 +95,64 @@ also be asked to sign a
95
95
96
96
## Development Internals
97
97
98
- ### Building from source
98
+ ### Installing Poetry
99
99
100
100
Rasa uses Poetry for packaging and dependency management. If you want to build it from source,
101
101
you have to install Poetry first. This is how it can be done:
102
102
103
- ```
104
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
103
+ ``` bash
104
+ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
105
105
```
106
106
107
107
There are several other ways to install Poetry. Please, follow
108
108
[ the official guide] ( https://python-poetry.org/docs/#installation ) to see all possible options.
109
109
110
- To install dependencies and ` rasa ` itself in editable mode execute
110
+ ### Managing environments
111
+
112
+ The official [ Poetry guide] ( https://python-poetry.org/docs/managing-environments/ ) suggests to use
113
+ [ pyenv] ( https://github.com/pyenv/pyenv ) or any other similar tool to easily switch between Python versions.
114
+ This is how it can be done:
115
+
116
+ ``` bash
117
+ pyenv install 3.7.6
118
+ pyenv local 3.7.6 # Activate Python 3.7.6 for the current project
119
+ ```
120
+
121
+ By default, Poetry will try to use the currently activated Python version to create the virtual environment
122
+ for the current project automatically. You can also create and activate a virtual environment manually — in this
123
+ case, Poetry should pick it up and use it to install the dependencies. For example:
124
+
125
+ ``` bash
126
+ python -m venv .venv
127
+ source .venv/bin/activate
128
+ ```
129
+
130
+ You can make sure that the environment is picked up by executing
131
+
132
+ ``` bash
133
+ poetry env info
111
134
```
135
+
136
+ ### Building from source
137
+
138
+ To install dependencies and ` rasa ` itself in editable mode execute
139
+
140
+ ``` bash
112
141
make install
113
142
```
114
143
115
144
### Running and changing the documentation
116
145
117
146
First of all, install all the required dependencies:
118
- ```
147
+
148
+ ``` bash
119
149
make install
120
150
```
121
151
122
152
After the installation has finished, you can run and view the documentation
123
153
locally using:
124
- ```
154
+
155
+ ``` bash
125
156
make livedocs
126
157
```
127
158
@@ -130,25 +161,46 @@ You can now change the docs locally and the web page will automatically reload
130
161
and apply your changes.
131
162
132
163
### Running the Tests
164
+
133
165
In order to run the tests, make sure that you have the development requirements installed:
166
+
134
167
``` bash
135
168
export PIP_USE_PEP517=false
136
169
make prepare-tests-ubuntu # Only on Ubuntu and Debian based systems
137
170
make prepare-tests-macos # Only on macOS
138
171
```
139
172
140
173
Then, run the tests:
174
+
141
175
``` bash
142
176
make test
143
177
```
144
178
145
179
They can also be run at multiple jobs to save some time:
180
+
146
181
``` bash
147
182
JOBS=[n] make test
148
183
```
149
184
150
185
Where ` [n] ` is the number of jobs desired. If omitted, ` [n] ` will be automatically chosen by pytest.
151
186
187
+ ### Resolving merge conflicts
188
+
189
+ Poetry doesn't include any solution that can help to resolve merge conflicts in
190
+ the lock file ` poetry.lock ` by default.
191
+ However, there is a great tool called [ poetry-merge-lock] ( https://poetry-merge-lock.readthedocs.io/en/latest/ ) .
192
+ Here is how use can install it:
193
+
194
+ ``` bash
195
+ pip install poetry-merge-lock
196
+ ```
197
+
198
+ Just execute this command to resolve merge conflicts in ` poetry.lock ` automatically:
199
+
200
+ ``` bash
201
+ poetry-merge-lock
202
+ ```
203
+
152
204
### Steps to release a new version
153
205
Releasing a new version is quite simple, as the packages are build and distributed by GitHub Actions.
154
206
0 commit comments