__init__.py 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2014-2016 OpenMarket Ltd
  3. # Copyright 2018-9 New Vector Ltd
  4. #
  5. # Licensed under the Apache License, Version 2.0 (the "License");
  6. # you may not use this file except in compliance with the License.
  7. # You may obtain a copy of the License at
  8. #
  9. # http://www.apache.org/licenses/LICENSE-2.0
  10. #
  11. # Unless required by applicable law or agreed to in writing, software
  12. # distributed under the License is distributed on an "AS IS" BASIS,
  13. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. # See the License for the specific language governing permissions and
  15. # limitations under the License.
  16. """ This is a reference implementation of a Matrix homeserver.
  17. """
  18. import os
  19. import sys
  20. # Check that we're not running on an unsupported Python version.
  21. if sys.version_info < (3, 5):
  22. print("Synapse requires Python 3.5 or above.")
  23. sys.exit(1)
  24. try:
  25. from twisted.internet import protocol
  26. from twisted.internet.protocol import Factory
  27. from twisted.names.dns import DNSDatagramProtocol
  28. protocol.Factory.noisy = False
  29. Factory.noisy = False
  30. DNSDatagramProtocol.noisy = False
  31. except ImportError:
  32. pass
  33. __version__ = "1.16.0rc1"
  34. if bool(os.environ.get("SYNAPSE_TEST_PATCH_LOG_CONTEXTS", False)):
  35. # We import here so that we don't have to install a bunch of deps when
  36. # running the packaging tox test.
  37. from synapse.util.patch_inline_callbacks import do_patch
  38. do_patch()