matrix-synapse/14085-extra-check.patch
Marcus Rueckert e59782d4dc Accepting request 1011102 from home:bnavigator:branches:network:messaging:matrix
- Replace fragile workaround which is not specification compliant
  with 14085-extra-check.patch -- gh#matrix-org/synapse#14085
- Fix python site-packages fdupes

OBS-URL: https://build.opensuse.org/request/show/1011102
OBS-URL: https://build.opensuse.org/package/show/network:messaging:matrix/matrix-synapse?expand=0&rev=244
2022-10-17 09:52:14 +00:00

49 lines
1.8 KiB
Diff

From 42031876e16af041367c3066023994d4c970df57 Mon Sep 17 00:00:00 2001
From: David Robertson <davidr@element.io>
Date: Thu, 6 Oct 2022 15:46:11 +0100
Subject: PR #14085 Unpin build-system requirements, but impose an upper-bound
Fixes #14079, properly. Reverts #14080.
A summary of the problem:
Synapse defines an extra called url_preview with an underscore.
Synapse looks up its own packaging metadata at runtime to check if the dependencies needed for url_preview are installed.
Poetry-core 1.3.0 now normalises extra names when writing metadata, per PEP 685.
This means the extra will be written to metadata as url-preview with a hyphen.
So the lookup in point 2 will fail if Synapse was built/installed by poetry-core 1.3.0.
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -219,7 +219,7 @@ oidc = ["authlib"]
# `systemd.journal.JournalHandler`, as is documented in
# `contrib/systemd/log_config.yaml`.
systemd = ["systemd-python"]
-url_preview = ["lxml"]
+url-preview = ["lxml"]
sentry = ["sentry-sdk"]
opentracing = ["jaeger-client", "opentracing"]
jwt = ["authlib"]
@@ -250,7 +250,7 @@ all = [
"pysaml2",
# oidc and jwt
"authlib",
- # url_preview
+ # url-preview
"lxml",
# sentry
"sentry-sdk",
diff --git a/synapse/config/repository.py b/synapse/config/repository.py
index 1033496bb43..e4759711ed9 100644
--- a/synapse/config/repository.py
+++ b/synapse/config/repository.py
@@ -205,7 +205,7 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
)
self.url_preview_enabled = config.get("url_preview_enabled", False)
if self.url_preview_enabled:
- check_requirements("url_preview")
+ check_requirements("url-preview")
proxy_env = getproxies_environment()
if "url_preview_ip_range_blacklist" not in config: