From 06ca4f461b7e3baf665f59afda37b88913267e56 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 29 Mar 2022 14:24:30 +0100 Subject: [PATCH 1/4] 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 8419ab3aca95..3c04d817d04b 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 = { From 91db4c2fb5c8da5204c56e65d54bee49fa97bd03 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 5 Apr 2022 18:28:53 +0100 Subject: [PATCH 2/4] Changelog --- changelog.d/12384.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/12384.misc diff --git a/changelog.d/12384.misc b/changelog.d/12384.misc new file mode 100644 index 000000000000..8a60f328764d --- /dev/null +++ b/changelog.d/12384.misc @@ -0,0 +1 @@ +Make missing `importlib_metadata` dependency explicit. \ No newline at end of file From 1e5690e5a07ab0028eed67a7d9e4af6c0356a35c Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 5 Apr 2022 18:35:47 +0100 Subject: [PATCH 3/4] setuptools doesn't like my environment marker This is only temporary, so screw it: let's make it unconditional. --- synapse/python_dependencies.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index 3c04d817d04b..cd68aa362e83 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -91,7 +91,7 @@ "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", + "importlib_metadata>=1.4", ] CONDITIONAL_REQUIREMENTS = { From 46522e8d7ae9ba54324745bb68c118543350ccc7 Mon Sep 17 00:00:00 2001 From: David Robertson Date: Tue, 5 Apr 2022 18:57:08 +0100 Subject: [PATCH 4/4] Update poetry lock. --- poetry.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/poetry.lock b/poetry.lock index d4bf972c43b6..17430cbfa6c1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1593,7 +1593,7 @@ url_preview = ["lxml"] [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "92465e65bef59c43c6112f332e5cf987740899801dbd34c19245db15b5c6362d" +content-hash = "7ff6d982a9d6675cb595b216b23549ef1942d0e39cb91c97494ff6ed95a9e8d2" [metadata.files] appdirs = [