pyproject.toml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285
  1. [tool.towncrier]
  2. package = "synapse"
  3. filename = "CHANGES.md"
  4. directory = "changelog.d"
  5. issue_format = "[\\#{issue}](https://github.com/matrix-org/synapse/issues/{issue})"
  6. [[tool.towncrier.type]]
  7. directory = "feature"
  8. name = "Features"
  9. showcontent = true
  10. [[tool.towncrier.type]]
  11. directory = "bugfix"
  12. name = "Bugfixes"
  13. showcontent = true
  14. [[tool.towncrier.type]]
  15. directory = "docker"
  16. name = "Updates to the Docker image"
  17. showcontent = true
  18. [[tool.towncrier.type]]
  19. directory = "doc"
  20. name = "Improved Documentation"
  21. showcontent = true
  22. [[tool.towncrier.type]]
  23. directory = "removal"
  24. name = "Deprecations and Removals"
  25. showcontent = true
  26. [[tool.towncrier.type]]
  27. directory = "misc"
  28. name = "Internal Changes"
  29. showcontent = true
  30. [tool.black]
  31. target-version = ['py37', 'py38', 'py39', 'py310']
  32. # black ignores everything in .gitignore by default, see
  33. # https://black.readthedocs.io/en/stable/usage_and_configuration/file_collection_and_discovery.html#gitignore
  34. # Use `extend-exclude` if you want to exclude something in addition to this.
  35. [tool.isort]
  36. line_length = 88
  37. sections = ["FUTURE", "STDLIB", "THIRDPARTY", "TWISTED", "FIRSTPARTY", "TESTS", "LOCALFOLDER"]
  38. default_section = "THIRDPARTY"
  39. known_first_party = ["synapse"]
  40. known_tests = ["tests"]
  41. known_twisted = ["twisted", "OpenSSL"]
  42. multi_line_output = 3
  43. include_trailing_comma = true
  44. combine_as_imports = true
  45. skip_gitignore = true
  46. [tool.poetry]
  47. name = "matrix-synapse"
  48. version = "1.54.0rc1"
  49. description = "Homeserver for the Matrix decentralised comms protocol"
  50. authors = ["Matrix.org Team and Contributors <packages@matrix.org>"]
  51. license = "Apache-2.0"
  52. readme = "README.rst"
  53. repository = "https://github.com/matrix-org/synapse"
  54. packages = [
  55. { include = "synapse" },
  56. ]
  57. classifiers = [
  58. "Development Status :: 5 - Production/Stable",
  59. "Topic :: Communications :: Chat",
  60. ]
  61. include = [
  62. { path = "AUTHORS.rst", format = "sdist" },
  63. { path = "book.toml", format = "sdist" },
  64. { path = "changelog.d", format = "sdist" },
  65. { path = "CHANGES.md", format = "sdist" },
  66. { path = "CONTRIBUTING.md", format = "sdist" },
  67. { path = "demo", format = "sdist" },
  68. { path = "docs", format = "sdist" },
  69. { path = "INSTALL.md", format = "sdist" },
  70. { path = "mypy.ini", format = "sdist" },
  71. { path = "scripts-dev", format = "sdist" },
  72. { path = "synmark", format="sdist" },
  73. { path = "sytest-blacklist", format = "sdist" },
  74. { path = "tests", format = "sdist" },
  75. { path = "tox.ini", format = "sdist" },
  76. { path = "UPGRADE.rst", format = "sdist" },
  77. ]
  78. [tool.poetry.scripts]
  79. synapse_homeserver = "synapse.app.homeserver:main"
  80. synapse_worker = "synapse.app.generic_worker:main"
  81. synctl = "synapse._scripts.synctl:main"
  82. export_signing_key = "synapse._scripts.export_signing_key:main"
  83. generate_config = "synapse._scripts.generate_config:main"
  84. generate_log_config = "synapse._scripts.generate_log_config:main"
  85. generate_signing_key = "synapse._scripts.generate_signing_key:main"
  86. hash_password = "synapse._scripts.hash_password:main"
  87. register_new_matrix_user = "synapse._scripts.register_new_matrix_user:main"
  88. synapse_port_db = "synapse._scripts.synapse_port_db:main"
  89. synapse_review_recent_signups = "synapse._scripts.review_recent_signups:main"
  90. update_synapse_database = "synapse._scripts.update_synapse_database:main"
  91. [tool.poetry.dependencies]
  92. python = "^3.7"
  93. # Mandatory Dependencies
  94. # ----------------------
  95. # we use the TYPE_CHECKER.redefine method added in jsonschema 3.0.0
  96. jsonschema = ">=3.0.0"
  97. # frozendict 2.1.2 is broken on Debian 10: https://github.com/Marco-Sulla/python-frozendict/issues/41
  98. frozendict = ">=1,!=2.1.2"
  99. # We require 2.1.0 or higher for type hints. Previous guard was >= 1.1.0
  100. unpaddedbase64 = ">=2.1.0"
  101. canonicaljson = ">=1.4.0"
  102. # we use the type definitions added in signedjson 1.1.
  103. signedjson = ">=1.1.0"
  104. PyNaCl = ">=1.2.1"
  105. idna = ">=2.5"
  106. # validating SSL certs for IP addresses requires service_identity 18.1.
  107. service-identity = ">=18.1.0"
  108. # Twisted 18.9 introduces some logger improvements that the structured
  109. # logger utilises
  110. Twisted = ">=18.9.0"
  111. treq = ">=15.1"
  112. # Twisted has required pyopenssl 16.0 since about Twisted 16.6.
  113. pyOpenSSL = ">=16.0.0"
  114. PyYAML = ">=3.11"
  115. pyasn1 = ">=0.1.9"
  116. pyasn1-modules = ">=0.0.7"
  117. bcrypt = ">=3.1.0"
  118. Pillow = ">=5.4.0"
  119. sortedcontainers = ">=1.4.4"
  120. pymacaroons = ">=0.13.0"
  121. msgpack = ">=0.5.2"
  122. phonenumbers = ">=8.2.0"
  123. # we use GaugeHistogramMetric, which was added in prom-client 0.4.0.
  124. prometheus-client = ">=0.4.0"
  125. # we use `order`, which arrived in attrs 19.2.0.
  126. # Note: 21.1.0 broke `/sync`, see #9936
  127. attrs = ">=19.2.0,!=21.1.0"
  128. netaddr = ">=0.7.18"
  129. # Jinja 2.x is incompatible with MarkupSafe>=2.1. To ensure that admins do not
  130. # end up with a broken installation, with recent MarkupSafe but old Jinja, we
  131. # add a lower bound to the Jinja2 dependency.
  132. Jinja2 = ">=3.0"
  133. bleach = ">=1.4.3"
  134. # We use `ParamSpec`, which was added in `typing-extensions` 3.10.0.0.
  135. typing-extensions = ">=3.10.0"
  136. # We enforce that we have a `cryptography` version that bundles an `openssl`
  137. # with the latest security patches.
  138. cryptography = ">=3.4.7"
  139. # ijson 3.1.4 fixes a bug with "." in property names
  140. ijson = ">=3.1.4"
  141. matrix-common = "~=1.1.0"
  142. # We need packaging.requirements.Requirement, added in 16.1.
  143. packaging = ">=16.1"
  144. # At the time of writing, we only use functions from the version `importlib.metadata`
  145. # which shipped in Python 3.8. This corresponds to version 1.4 of the backport.
  146. importlib_metadata = { version = ">=1.4", python = "<3.8" }
  147. # Optional Dependencies
  148. # ---------------------
  149. matrix-synapse-ldap3 = { version = ">=0.1", optional = true }
  150. psycopg2 = { version = ">=2.8", markers = "platform_python_implementation != 'PyPy'", optional = true }
  151. psycopg2cffi = { version = ">=2.8", markers = "platform_python_implementation == 'PyPy'", optional = true }
  152. psycopg2cffi-compat = { version = "==1.1", markers = "platform_python_implementation == 'PyPy'", optional = true }
  153. pysaml2 = { version = ">=4.5.0", optional = true }
  154. authlib = { version = ">=0.14.0", optional = true }
  155. # systemd-python is necessary for logging to the systemd journal via
  156. # `systemd.journal.JournalHandler`, as is documented in
  157. # `contrib/systemd/log_config.yaml`.
  158. # Note: systemd-python 231 appears to have been yanked from pypi
  159. systemd-python = { version = ">=231", optional = true }
  160. lxml = { version = ">=4.2.0", optional = true }
  161. sentry-sdk = { version = ">=0.7.2", optional = true }
  162. opentracing = { version = ">=2.2.0", optional = true }
  163. jaeger-client = { version = ">=4.0.0", optional = true }
  164. pyjwt = { version = ">=1.6.4", optional = true }
  165. txredisapi = { version = ">=1.4.7", optional = true }
  166. hiredis = { version = "*", optional = true }
  167. Pympler = { version = "*", optional = true }
  168. parameterized = { version = ">=0.7.4", optional = true }
  169. ## Developer dependencies should not get included in "all".
  170. ##
  171. [tool.poetry.extras]
  172. # NB: Packages that should be part of `pip install matrix-synapse[all]` need to be specified
  173. # twice: once here, and once in the `all` extra.
  174. matrix-synapse-ldap3 = ["matrix-synapse-ldap3"]
  175. postgres = ["psycopg2", "psycopg2cffi", "psycopg2cffi-compat"]
  176. saml2 = ["pysaml2"]
  177. oidc = ["authlib"]
  178. # systemd-python is necessary for logging to the systemd journal via
  179. # `systemd.journal.JournalHandler`, as is documented in
  180. # `contrib/systemd/log_config.yaml`.
  181. systemd = ["systemd-python"]
  182. url_preview = ["lxml"]
  183. sentry = ["sentry-sdk"]
  184. opentracing = ["jaeger-client", "opentracing"]
  185. jwt = ["pyjwt"]
  186. # hiredis is not a *strict* dependency, but it makes things much faster.
  187. # (if it is not installed, we fall back to slow code.)
  188. redis = ["txredisapi", "hiredis"]
  189. # Required to use experimental `caches.track_memory_usage` config option.
  190. cache_memory = ["pympler"]
  191. test = ["parameterized"]
  192. # The duplication here is awful. I hate hate hate hate hate it. However, for now I want
  193. # to ensure you can still `pip install matrix-synapse[all]` like today. Two motivations:
  194. # 1) for new installations, I want instructions in existing documentation and tutorials
  195. # out there to still work.
  196. # 2) I don't want to hard-code a list of extras into CI if I can help it. The ideal
  197. # solution here would be something like https://github.com/python-poetry/poetry/issues/3413
  198. # Poetry 1.2's dependency groups might make this easier. But I'm not trying that out
  199. # until there's a stable release of 1.2.
  200. #
  201. # NB: the strings in this list must be *package* names, not extra names.
  202. # Some of our extra names _are_ package names, which can lead to great confusion.
  203. all = [
  204. # matrix-synapse-ldap3
  205. "matrix-synapse-ldap3",
  206. # postgres
  207. "psycopg2", "psycopg2cffi", "psycopg2cffi-compat",
  208. # saml2
  209. "pysaml2",
  210. # oidc
  211. "authlib",
  212. # systemd, omitted: this is a system-based requirement
  213. # url_preview
  214. "lxml",
  215. # sentry
  216. "sentry-sdk",
  217. # opentracing
  218. "jaeger-client", "opentracing",
  219. # jwt
  220. "pyjwt",
  221. #redis
  222. "txredisapi", "hiredis"
  223. # cache_memory, omitted: this is an experimental option
  224. # test, omitted: it's useful to have this separate from dev deps in the olddeps job
  225. ]
  226. [tool.poetry.dev-dependencies]
  227. ## We pin black so that our tests don't start failing on new releases.
  228. isort = "==5.7.0"
  229. black = "==22.3.0"
  230. flake8-comprehensions = "*"
  231. flake8-bugbear = "==21.3.2"
  232. flake8 = "*"
  233. # Typechecking
  234. mypy = "==0.931"
  235. mypy-zope = "==0.3.5"
  236. types-bleach = ">=4.1.0"
  237. types-jsonschema = ">=3.2.0"
  238. types-opentracing = ">=2.4.2"
  239. types-Pillow = ">=8.3.4"
  240. types-psycopg2 = ">=2.9.9"
  241. types-pyOpenSSL = ">=20.0.7"
  242. types-PyYAML = ">=5.4.10"
  243. types-requests = ">=2.26.0"
  244. types-setuptools = ">=57.4.0"
  245. # Dependencies which are exclusively required by unit test code. This is
  246. # NOT a list of all modules that are necessary to run the unit tests.
  247. # Tests assume that all optional dependencies are installed.
  248. # parameterized<0.7.4 can create classes with names that would normally be invalid
  249. # identifiers. trial really does not like this when running with multiple workers.
  250. parameterized = ">=0.7.4"
  251. # The following are used by the release script
  252. click = "==8.1.0"
  253. redbaron = "==0.9.2"
  254. GitPython = "==3.1.14"
  255. commonmark = "==0.9.1"
  256. pygithub = "==1.55"
  257. # The following are executed as commands by the release script.
  258. twine = "*"
  259. # Towncrier min version comes from #3425. Rationale unclear.
  260. towncrier = ">=18.6.0rc1"
  261. [build-system]
  262. requires = ["poetry-core>=1.0.0"]
  263. build-backend = "poetry.core.masonry.api"