Skip to content

Commit 0e6ab7b

Browse files
authored
Merge pull request RasaHQ#5633 from RasaHQ/readme-poetry-update
Add more information about the usage of Poetry and merge conflict resolution in the lockfile of Poetry to `README.md`
2 parents d59e872 + 6ed3bdf commit 0e6ab7b

File tree

4 files changed

+367
-338
lines changed

4 files changed

+367
-338
lines changed

.github/workflows/continous-integration.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ jobs:
177177
- name: Checkout git repository 🕝
178178
uses: actions/checkout@v2
179179

180+
- name: Free disk space
181+
# tries to make sure we do not run out of disk space, see
182+
# https://github.community/t5/GitHub-Actions/BUG-Strange-quot-No-space-left-on-device-quot-IOExceptions-on/td-p/46101
183+
run: |
184+
sudo swapoff -a
185+
sudo rm -f /swapfile
186+
sudo apt clean
187+
docker rmi $(docker image ls -aq)
188+
df -h
189+
180190
- name: Login to DockerHub Registry 🔢
181191
run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u ${{ env.DOCKERHUB_USERNAME }} --password-stdin || true
182192

README.md

Lines changed: 58 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,64 @@ also be asked to sign a
9595

9696
## Development Internals
9797

98-
### Building from source
98+
### Installing Poetry
9999

100100
Rasa uses Poetry for packaging and dependency management. If you want to build it from source,
101101
you have to install Poetry first. This is how it can be done:
102102

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
105105
```
106106

107107
There are several other ways to install Poetry. Please, follow
108108
[the official guide](https://python-poetry.org/docs/#installation) to see all possible options.
109109

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
111134
```
135+
136+
### Building from source
137+
138+
To install dependencies and `rasa` itself in editable mode execute
139+
140+
```bash
112141
make install
113142
```
114143

115144
### Running and changing the documentation
116145

117146
First of all, install all the required dependencies:
118-
```
147+
148+
```bash
119149
make install
120150
```
121151

122152
After the installation has finished, you can run and view the documentation
123153
locally using:
124-
```
154+
155+
```bash
125156
make livedocs
126157
```
127158

@@ -130,25 +161,46 @@ You can now change the docs locally and the web page will automatically reload
130161
and apply your changes.
131162

132163
### Running the Tests
164+
133165
In order to run the tests, make sure that you have the development requirements installed:
166+
134167
```bash
135168
export PIP_USE_PEP517=false
136169
make prepare-tests-ubuntu # Only on Ubuntu and Debian based systems
137170
make prepare-tests-macos # Only on macOS
138171
```
139172

140173
Then, run the tests:
174+
141175
```bash
142176
make test
143177
```
144178

145179
They can also be run at multiple jobs to save some time:
180+
146181
```bash
147182
JOBS=[n] make test
148183
```
149184

150185
Where `[n]` is the number of jobs desired. If omitted, `[n]` will be automatically chosen by pytest.
151186

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+
152204
### Steps to release a new version
153205
Releasing a new version is quite simple, as the packages are build and distributed by GitHub Actions.
154206

changelog/5633.misc.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add more information about the usage of Poetry and the process of merge conflict resolution
2+
in the lockfile of Poetry to `README.md`.

0 commit comments

Comments
 (0)