summary refs log tree commit diff
path: root/synapse/_scripts
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-06-07 15:24:11 +0100
committerGitHub <noreply@github.com>2022-06-07 15:24:11 +0100
commitf30bcbd84a651de59777b2a749850f6ca56ce3f0 (patch)
tree8a66fdf82df9a061ca9664b214d23145ee178e1b /synapse/_scripts
parentReduce amount of state we pull out when attempting to send catchup PDUs. (#12... (diff)
downloadsynapse-f30bcbd84a651de59777b2a749850f6ca56ce3f0.tar.xz
Fix Synapse git info missing in version strings (#12973)
Diffstat (limited to 'synapse/_scripts')
-rwxr-xr-xsynapse/_scripts/synapse_port_db.py7
-rwxr-xr-xsynapse/_scripts/update_synapse_database.py5
2 files changed, 4 insertions, 8 deletions
diff --git a/synapse/_scripts/synapse_port_db.py b/synapse/_scripts/synapse_port_db.py
index 361b51d2fa..c753dfa7cb 100755
--- a/synapse/_scripts/synapse_port_db.py
+++ b/synapse/_scripts/synapse_port_db.py
@@ -40,7 +40,6 @@ from typing import (
 )
 
 import yaml
-from matrix_common.versionstring import get_distribution_version_string
 from typing_extensions import TypedDict
 
 from twisted.internet import defer, reactor as reactor_
@@ -84,7 +83,7 @@ from synapse.storage.databases.state.bg_updates import StateBackgroundUpdateStor
 from synapse.storage.engines import create_engine
 from synapse.storage.prepare_database import prepare_database
 from synapse.types import ISynapseReactor
-from synapse.util import Clock
+from synapse.util import SYNAPSE_VERSION, Clock
 
 # Cast safety: Twisted does some naughty magic which replaces the
 # twisted.internet.reactor module with a Reactor instance at runtime.
@@ -258,9 +257,7 @@ class MockHomeserver:
         self.clock = Clock(reactor)
         self.config = config
         self.hostname = config.server.server_name
-        self.version_string = "Synapse/" + get_distribution_version_string(
-            "matrix-synapse"
-        )
+        self.version_string = SYNAPSE_VERSION
 
     def get_clock(self) -> Clock:
         return self.clock
diff --git a/synapse/_scripts/update_synapse_database.py b/synapse/_scripts/update_synapse_database.py
index c443522c05..b4aeae6dd5 100755
--- a/synapse/_scripts/update_synapse_database.py
+++ b/synapse/_scripts/update_synapse_database.py
@@ -19,7 +19,6 @@ import sys
 from typing import cast
 
 import yaml
-from matrix_common.versionstring import get_distribution_version_string
 
 from twisted.internet import defer, reactor as reactor_
 
@@ -28,6 +27,7 @@ from synapse.metrics.background_process_metrics import run_as_background_process
 from synapse.server import HomeServer
 from synapse.storage import DataStore
 from synapse.types import ISynapseReactor
+from synapse.util import SYNAPSE_VERSION
 
 # Cast safety: Twisted does some naughty magic which replaces the
 # twisted.internet.reactor module with a Reactor instance at runtime.
@@ -43,8 +43,7 @@ class MockHomeserver(HomeServer):
             hostname=config.server.server_name,
             config=config,
             reactor=reactor,
-            version_string="Synapse/"
-            + get_distribution_version_string("matrix-synapse"),
+            version_string=f"Synapse/{SYNAPSE_VERSION}",
         )