From bda3c76d044781398a628cd086b2c40d5f58d6b7 Mon Sep 17 00:00:00 2001
From: DMRobertson but see poetry's installation instructions
for other installation methods. Synapse requires Poetry version 1.2.0 or later. Developing Synapse requires Poetry version 1.3.2 or later. Next, open a terminal and install dependencies as follows: This is a quick cheat sheet for developers on how to use See the contributing guide. Developers should use Poetry 1.3.2 or higher. If you encounter problems related
+to poetry, please double-check your poetry version. Synapse uses a variety of third-party Python packages to function as a homeserver.
Some of these are direct dependencies, listed in cd path/where/you/have/cloned/the/repository
poetry install --extras all
diff --git a/develop/development/dependencies.html b/develop/development/dependencies.html
index a0823a71c6..1db41ffa4b 100644
--- a/develop/development/dependencies.html
+++ b/develop/development/dependencies.html
@@ -148,6 +148,10 @@
Managing dependencies with Poetry
poetry
.Installing
+Background
pyproject.toml
under the
@@ -240,7 +244,7 @@ e.g. mypy
instead of poetry run mypy
; pythonpoetry shell
beforehand.How do I...
...reset my venv to the locked environment?
-poetry install --extras all --remove-untracked
+
poetry install --all-extras --sync
...delete everything and start over from scratch?
# Stop the current virtualenv if active
@@ -286,11 +290,7 @@ useful.
pyproject.toml
; then poetry lock --no-update
; or elsepoetry add packagename
. See poetry add --help
; note the --dev
,
---extras
and --optional
flags in particular.
---extras
and --optional
flags in particular.
Include the updated pyproject.toml
and poetry.lock
files in your commit.
poetry remove packagename
ought to do the trick. Alternatively, manually update pyproject.toml
and
-poetry lock --no-update
. Include the updated pyproject.toml
and poetry.lock`
+poetry lock --no-update
. Include the updated pyproject.toml
and poetry.lock
files in your commit.
Best done by manually editing pyproject.toml
, then poetry lock --no-update
.
@@ -326,8 +326,6 @@ poetry lock --no-update
poetry export --extras all
Be wary of bugs in poetry export
and pip install -r requirements.txt
.
Note: poetry export
will be made a plugin in Poetry 1.2. Additional config may
-be required.
I usually use
poetry run pip install build && poetry run python -m build
@@ -337,7 +335,7 @@ doesn't require poetry. (It's what we use in CI too). However, you could try
poetry build
too.
Troubleshooting
Check the version of poetry with poetry --version
.
-The minimum version of poetry supported by Synapse is 1.2.
+The minimum version of poetry supported by Synapse is 1.3.2.
It can also be useful to check the version of poetry-core
in use. If you've
installed poetry
with pipx
, try pipx runpip poetry list | grep poetry-core
.
Clear caches: poetry cache clear --all pypi
.
--
cgit 1.5.1