summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-03-04 20:22:52 +0000
committerDavid Robertson <davidr@element.io>2022-03-29 12:56:25 +0100
commit75dae52cf38d69a9592a426e3b2b66fdcf4d7f5a (patch)
treee0c1bf093f2ff6c00fd10ba36c1a829a5f237014
parentSpecify deps in pyproject.toml (diff)
downloadsynapse-75dae52cf38d69a9592a426e3b2b66fdcf4d7f5a.tar.xz
Dirty duplication to make `all` work
-rw-r--r--poetry.lock4
-rw-r--r--pyproject.toml39
2 files changed, 38 insertions, 5 deletions
diff --git a/poetry.lock b/poetry.lock
index 85d477eafd..2b5007e832 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -1573,7 +1573,7 @@ docs = ["sphinx", "repoze.sphinx.autointerface"]
 test = ["zope.i18nmessageid", "zope.testing", "zope.testrunner"]
 
 [extras]
-all = ["matrix-synapse-ldap3", "opentracing"]
+all = ["matrix-synapse-ldap3", "psycopg2", "psycopg2cffi", "psycopg2cffi-compat", "pysaml2", "authlib", "lxml", "sentry-sdk", "jaeger-client", "opentracing", "pyjwt", "txredisapi", "hiredis"]
 cache_memory = ["Pympler"]
 jwt = ["pyjwt"]
 matrix-synapse-ldap3 = ["matrix-synapse-ldap3"]
@@ -1590,7 +1590,7 @@ url_preview = ["lxml"]
 [metadata]
 lock-version = "1.1"
 python-versions = "^3.7"
-content-hash = "e08406f439d4087207f802ea57171503eba86641a81cf61464e36ebcee465929"
+content-hash = "92465e65bef59c43c6112f332e5cf987740899801dbd34c19245db15b5c6362d"
 
 [metadata.files]
 appdirs = [
diff --git a/pyproject.toml b/pyproject.toml
index b2f0962089..ffd33b396c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -196,6 +196,8 @@ parameterized = { version = ">=0.7.4", optional = true }
 ## Developer dependencies should not get included in "all".
 ##
 [tool.poetry.extras]
+# NB: Packages that should be part of `pip install matrix-synapse[all]` need to be specified
+# twice: once here, and once in the `all` extra.
 matrix-synapse-ldap3 = ["matrix-synapse-ldap3"]
 postgres = ["psycopg2", "psycopg2cffi", "psycopg2cffi-compat"]
 saml2 = ["pysaml2"]
@@ -215,9 +217,40 @@ redis = ["txredisapi", "hiredis"]
 cache_memory = ["pympler"]
 test = ["parameterized"]
 
-# TODO: is there a better way to avoid the duplication here?
-# See also https://github.com/python-poetry/poetry/issues/3413#issue-750319958
-all = ["matrix-synapse-ldap3", "postgres", "saml2", "oidc", "systemd", "url_preview", "sentry", "opentracing", "jwt", "redis", "cache_memory"]
+# The duplication here is awful. I hate hate hate hate hate it. However, for now I want
+# to ensure you can still `pip install matrix-synapse[all]` like today. Two motivations:
+# 1) for new installations, I want instructions in existing documentation and tutorials
+#    out there to still work.
+# 2) I don't want to hard-code a list of extras into CI if I can help it. The ideal
+#    solution here would be something like https://github.com/python-poetry/poetry/issues/3413
+# Poetry 1.2's dependency groups might make this easier. But I'm not trying that out
+# until there's a stable release of 1.2.
+#
+# NB: the strings in this list must be *package* names, not extra names.
+# Some of our extra names _are_ package names, which can lead to great confusion.
+all = [
+    # matrix-synapse-ldap3
+    "matrix-synapse-ldap3",
+    # postgres
+    "psycopg2", "psycopg2cffi", "psycopg2cffi-compat",
+    # saml2
+    "pysaml2",
+    # oidc
+    "authlib",
+    # systemd, omitted: this is a system-based requirement
+    # url_preview
+    "lxml",
+    # sentry
+    "sentry-sdk",
+    # opentracing
+    "jaeger-client", "opentracing",
+    # jwt
+    "pyjwt",
+    #redis
+    "txredisapi", "hiredis"
+    # cache_memory, omitted: this is an experimental option
+    # test, omitted: it's useful to have this separate from dev deps in the olddeps job
+]
 
 [tool.poetry.dev-dependencies]
 ## We pin black so that our tests don't start failing on new releases.