summary refs log tree commit diff
path: root/synapse/python_dependencies.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2021-04-13 16:10:07 +0100
committerAndrew Morgan <andrew@amorgan.xyz>2021-04-13 16:10:07 +0100
commit77866a5f5f9e805ebe599a5dc7d19152b68a0f01 (patch)
treee81016df9807f97c1c8f88b82ad9c73cbaa94586 /synapse/python_dependencies.py
parentRevert "Patch to temporarily drop cross-user m.key_share_requests (#8675)" (diff)
parentMerge branch 'erikj/fix_stalled_catchup' into matrix-org-hotfixes (diff)
downloadsynapse-77866a5f5f9e805ebe599a5dc7d19152b68a0f01.tar.xz
Merge branch 'matrix-org-hotfixes' of github.com:matrix-org/synapse into matrix-org-hotfixes
Diffstat (limited to 'synapse/python_dependencies.py')
-rw-r--r--synapse/python_dependencies.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py

index 321a333820..2a1c925ee8 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py
@@ -15,6 +15,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import itertools import logging from typing import List, Set @@ -82,6 +83,9 @@ REQUIREMENTS = [ "Jinja2>=2.9", "bleach>=1.4.3", "typing-extensions>=3.7.4", + # We enforce that we have a `cryptography` version that bundles an `openssl` + # with the latest security patches. + "cryptography>=3.4.7;python_version>='3.6'", ] CONDITIONAL_REQUIREMENTS = { @@ -98,7 +102,7 @@ CONDITIONAL_REQUIREMENTS = { "txacme>=0.9.2", # txacme depends on eliot. Eliot 1.8.0 is incompatible with # python 3.5.2, as per https://github.com/itamarst/eliot/issues/418 - 'eliot<1.8.0;python_version<"3.5.3"', + "eliot<1.8.0;python_version<'3.5.3'", ], "saml2": [ # pysaml2 6.4.0 is incompatible with Python 3.5 (see https://github.com/IdentityPython/pysaml2/issues/749) @@ -128,6 +132,18 @@ for name, optional_deps in CONDITIONAL_REQUIREMENTS.items(): ALL_OPTIONAL_REQUIREMENTS = set(optional_deps) | ALL_OPTIONAL_REQUIREMENTS +# ensure there are no double-quote characters in any of the deps (otherwise the +# 'pip install' incantation in DependencyException will break) +for dep in itertools.chain( + REQUIREMENTS, + *CONDITIONAL_REQUIREMENTS.values(), +): + if '"' in dep: + raise Exception( + "Dependency `%s` contains double-quote; use single-quotes instead" % (dep,) + ) + + def list_requirements(): return list(set(REQUIREMENTS) | ALL_OPTIONAL_REQUIREMENTS) @@ -147,7 +163,7 @@ class DependencyException(Exception): @property def dependencies(self): for i in self.args[0]: - yield "'" + i + "'" + yield '"' + i + '"' def check_requirements(for_feature=None):