File: 0005-Avoid-telling-people-to-install-packages-with-pip.patch

package info (click to toggle)
matrix-synapse 1.136.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 78,244 kB
  • sloc: python: 255,664; javascript: 7,252; sql: 4,727; sh: 1,158; perl: 626; makefile: 157
file content (41 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: Andrej Shadura <andrewsh@debian.org>
Date: Wed, 31 Aug 2022 17:10:38 +0200
Subject: Avoid telling people to install packages with pip

Forwarded: not-needed
Bug: https://github.com/matrix-org/synapse/issues/3743

Co-authored-by: Richard van der Hoff <richard@matrix.org>
---
 synapse/util/check_dependencies.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/synapse/util/check_dependencies.py b/synapse/util/check_dependencies.py
index 12b8efa..9257f4d 100644
--- a/synapse/util/check_dependencies.py
+++ b/synapse/util/check_dependencies.py
@@ -46,11 +46,14 @@ logger = logging.getLogger(__name__)
 class DependencyException(Exception):
     @property
     def message(self) -> str:
+        pkgs = [
+            'python3-%s' % pkg.replace('_', '-') for pkg in self.dependencies
+        ]
         return "\n".join(
             [
                 "Missing Requirements: %s" % (", ".join(self.dependencies),),
                 "To install run:",
-                "    pip install --upgrade --force %s" % (" ".join(self.dependencies),),
+                "    sudo apt install %s" % (" ".join(pkgs),),
                 "",
             ]
         )
@@ -58,7 +61,7 @@ class DependencyException(Exception):
     @property
     def dependencies(self) -> Iterable[str]:
         for i in self.args[0]:
-            yield '"' + i + '"'
+            yield i
 
 
 DEV_EXTRAS = {"lint", "mypy", "test", "dev"}