Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc: Update the synapse installation section with poetry usage #7521

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/pr-7521.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Doc: Explain in docs/integration_tests.md how to use Python poetry to install synapse locally
38 changes: 8 additions & 30 deletions docs/integration_tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ The documentation describes what we do to have one, using [Synapse](https://gith

Steps:

- Install virtualenv
- Install poetry

```bash
python3 -m pip install virtualenv
pip install --user pipx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pip3 install --user pipx worked here.

pipx install poetry
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personal note, maybe mention it here: poetry 1.2 is required. Check that this is the installed version. When I run it, it installed version 1.1.13, I do not know why...

python3 -m pipx ensurepath # To run if `pipx install poetry` complained about PATH not being correctly set
```

- Clone Synapse repository
Expand All @@ -52,11 +54,8 @@ You should have the develop branch cloned by default.
- Run synapse, from the Synapse folder you just cloned

```bash
virtualenv -p python3 env
source env/bin/activate
pip install -e .
demo/start.sh --no-rate-limit

poetry install --extras all
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • For the error during Installing psycopg2 (2.9.5): Error: pg_config executable not found., run brew install postgresql.
  • For the error during Installing the current project: matrix-synapse (1.73.0): ModuleNotFoundError: No module named 'setuptools_rust', run pip install setuptools_rust

poetry run ./demo/start.sh --no-rate-limit
```

Alternatively, to install the latest Synapse release package (and not a cloned branch) you can run the following instead of `git clone` and `pip install -e .`:
Expand Down Expand Up @@ -86,13 +85,7 @@ It can be done using this command:
To stop Synapse, you can run the following commands:

```bash
./demo/stop.sh
```

And you can deactivate the virtualenv:

```bash
deactivate
poetry run ./demo/stop.sh
```

## Troubleshoot
Expand All @@ -113,19 +106,4 @@ Ensure you have the following configuration in `demo/etc/8080.config`.
public_baseurl: http://10.0.2.2:8080/
```

After changing this you will need to restart synapse using `demo/stop.sh` and `demo/start.sh` to load the new configuration.

### virtualenv command fails
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to update the toc by running ./gradlew knit.


You can try using
```bash
python3 -m venv env
```
or
```bash
python3 -m virtualenv env
```
instead of
```bash
virtualenv -p python3 env
```
After changing this you will need to restart synapse using `poetry run demo/stop.sh` and `poetry run demo/start.sh` to load the new configuration.