From 2f8ec8d0f5f0b597165a2af7b4683ab9c60c27e8 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 29 Mar 2022 14:24:30 +0100 Subject: [PATCH] Add missing dependency on importlib_metadata Missed in #12088. We got away with it because we were indirectly requiring it via other packages. Without this change, we encounter pain in `poetry export`; and besides, we should be explicit about our direct dependencies. --- pyproject.toml | 3 +++ synapse/python_dependencies.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 19ffdc7b2c40..92ea302b75d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -167,6 +167,9 @@ ijson = ">=3.1.4" matrix-common = "~=1.1.0" # We need packaging.requirements.Requirement, added in 16.1. packaging = ">=16.1" +# At the time of writing, we only use functions from the version `importlib.metadata` +# which shipped in Python 3.8. This corresponds to version 1.4 of the backport. +importlib_metadata = { version = ">=1.4", python = "<3.8" } # Optional Dependencies diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index d02cca0bbb56..951324970391 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -89,6 +89,9 @@ "matrix-common~=1.1.0", # We need packaging.requirements.Requirement, added in 16.1. "packaging>=16.1", + # At the time of writing, we only use functions from the version `importlib.metadata` + # which shipped in Python 3.8. This corresponds to version 1.4 of the backport. + "importlib_metadata>=1.4; python_version < 3.8", ] CONDITIONAL_REQUIREMENTS = {