From 6d4ab8fb90ae2eaa3393dcbd37c83c486202b347 Mon Sep 17 00:00:00 2001
From: DMRobertson
Synapse can connect to PostgreSQL via the psycopg2 Python library. Building this library from source requires access to PostgreSQL's C header files. On Debian or Ubuntu Linux, these can be installed with sudo apt install libpq-dev
.
The source code of Synapse is hosted on GitHub. You will also need a recent version of git.
For some tests, you will need a recent version of Docker.
+A recent version of the Rust compiler is needed to build the native modules. The +easiest way of installing the latest version is to use rustup.
The preferred and easiest way to contribute changes is to fork the relevant project on GitHub, and then create a pull request to ask us to pull your @@ -222,6 +224,10 @@ to check that your contributions render correctly. The docs are written in
Some documentation also exists in Synapse's GitHub Wiki, although this is primarily contributed to by community authors.
+When changes are made to any Rust code then you must call either poetry install
+or maturin develop
(if installed) to rebuild the Rust code. Using maturin
+is quicker than poetry install
, so is recommended when making frequent
+changes to the Rust code.
While you're developing and before submitting a patch, you'll
@@ -270,7 +276,7 @@ working directory. Typically, this ends up being _trial_temp/test.db
The database file can then be inspected with:
sqlite3 _trial_temp/test.db
-Note that the database file is cleared at the beginning of each test run. Thus it +
Note that the database file is cleared at the beginning of each test run. Thus it will always only contain the data generated by the last run test. Though generally when debugging, one is only running a single test anyway.
poetry shell
before
poetry install --extras all --remove-untracked
+# Stop the current virtualenv if active
+$ deactivate
+
+# Remove all of the files from the current environment.
+# Don't worry, even though it says "all", this will only
+# remove the Poetry virtualenvs for the current project.
+$ poetry env remove --all
+
+# Reactivate Poetry shell to create the virtualenv again
+$ poetry shell
+# Install everything again
+$ poetry install --extras all
+
poetry
virtualenv?Use Poetry caches a bunch of information about packages that isn't readily available
from PyPI. (This is what makes poetry seem slow when doing the first
Delete the This stores some cached information about dependencies and often conflicts with
+letting Poetry do the right thing. Sometimes useful to see what poetry's internal logic is.poetry run cmd args
when you need the python virtualenv context.
To avoid typing poetry run
all the time, you can run poetry shell
@@ -330,6 +344,11 @@ installed poetry
with pipx
, try pipx runpip poet
poetry install
.) Try poetry cache list
and poetry cache clear --all <name of cache>
to see if that fixes things.Remove outdated egg-info
+matrix_synapse.egg-info/
directory from the root of your Synapse
+install.Try
--verbose
or --dry-run
arguments.