From 6d4ab8fb90ae2eaa3393dcbd37c83c486202b347 Mon Sep 17 00:00:00 2001 From: DMRobertson Date: Tue, 27 Sep 2022 12:50:14 +0000 Subject: deploy: 3853011d01ad3f5034f53a9dfb7a06e36cf70ae9 --- latest/development/contributing_guide.html | 8 +++++++- latest/development/dependencies.html | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) (limited to 'latest/development') diff --git a/latest/development/contributing_guide.html b/latest/development/contributing_guide.html index c6e4c274a4..84356e5152 100644 --- a/latest/development/contributing_guide.html +++ b/latest/development/contributing_guide.html @@ -166,6 +166,8 @@ on Windows is not officially supported.

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.

3. Get the source.

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.

8. Test, test, test!

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.dbThe 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.

Running tests under PostgreSQL

diff --git a/latest/development/dependencies.html b/latest/development/dependencies.html index 75cda34011..7559d61c5c 100644 --- a/latest/development/dependencies.html +++ b/latest/development/dependencies.html @@ -242,6 +242,20 @@ context of poetry's venv, without having to run poetry shell before

...reset my venv to the locked environment?

poetry install --extras all --remove-untracked
 
+

...delete everything and start over from scratch?

+
# 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
+

...run a command in the poetry virtualenv?

Use 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 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 poetry install.) Try poetry cache list and poetry cache clear --all <name of cache> to see if that fixes things.

+

Remove outdated egg-info

+

Delete the matrix_synapse.egg-info/ directory from the root of your Synapse +install.

+

This stores some cached information about dependencies and often conflicts with +letting Poetry do the right thing.

Try --verbose or --dry-run arguments.

Sometimes useful to see what poetry's internal logic is.

-- cgit 1.5.1