1
0

DEPS: Dirty duplication to make all work

See comment in the toml file:

>  The duplication here is awful. I hate hate hate hate hate it.

I don't think that we're going to be adding many extras any time soon,
and I think this is the least bad option.
This commit is contained in:
David Robertson
2022-03-04 20:22:52 +00:00
parent 53e804f296
commit c50da488a0
2 changed files with 38 additions and 5 deletions

4
poetry.lock generated
View File

@@ -1576,7 +1576,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"]
@@ -1593,7 +1593,7 @@ url_preview = ["lxml"]
[metadata]
lock-version = "1.1"
python-versions = "^3.7"
content-hash = "e08406f439d4087207f802ea57171503eba86641a81cf61464e36ebcee465929"
content-hash = "7ff6d982a9d6675cb595b216b23549ef1942d0e39cb91c97494ff6ed95a9e8d2"
[metadata.files]
appdirs = [

View File

@@ -198,6 +198,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"]
@@ -217,9 +219,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.