setup.py 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. #!/usr/bin/env python
  2. """
  3. Sentry
  4. ======
  5. Sentry is a realtime event logging and aggregation platform. It specializes
  6. in monitoring errors and extracting all the information needed to do a proper
  7. post-mortem without any of the hassle of the standard user feedback loop.
  8. Sentry is a Server
  9. ------------------
  10. The Sentry package, at its core, is just a simple server and web UI. It will
  11. handle authentication clients (such as `Raven
  12. <https://github.com/getsentry/raven-python>`_)
  13. and all of the logic behind storage and aggregation.
  14. That said, Sentry is not limited to Python. The primary implementation is in
  15. Python, but it contains a full API for sending events from any language, in
  16. any application.
  17. :copyright: (c) 2011-2014 by the Sentry Team, see AUTHORS for more details.
  18. :license: BSD, see LICENSE for more details.
  19. """
  20. from __future__ import absolute_import
  21. # if sys.version_info[:2] != (2, 7):
  22. # print 'Error: Sentry requires Python 2.7'
  23. # sys.exit(1)
  24. import os
  25. import os.path
  26. import sys
  27. from distutils.command.build import build as BuildCommand
  28. from setuptools import setup, find_packages
  29. from setuptools.command.sdist import sdist as SDistCommand
  30. from setuptools.command.develop import develop as DevelopCommand
  31. ROOT = os.path.realpath(os.path.join(os.path.dirname(
  32. sys.modules['__main__'].__file__)))
  33. # Add Sentry to path so we can import distutils
  34. sys.path.insert(0, os.path.join(ROOT, 'src'))
  35. from sentry.utils.distutils import (
  36. BuildAssetsCommand, BuildIntegrationDocsCommand
  37. )
  38. # The version of sentry
  39. VERSION = '8.18.0.dev0'
  40. # Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
  41. # in multiprocessing/util.py _exit_function when running `python
  42. # setup.py test` (see
  43. # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
  44. for m in ('multiprocessing', 'billiard'):
  45. try:
  46. __import__(m)
  47. except ImportError:
  48. pass
  49. IS_LIGHT_BUILD = os.environ.get('SENTRY_LIGHT_BUILD') == '1'
  50. dev_requires = [
  51. 'Babel',
  52. 'flake8>=2.6,<2.7',
  53. 'pycodestyle>=2.0,<2.1',
  54. 'isort>=4.2.2,<4.3.0',
  55. ]
  56. tests_require = [
  57. # cassandra
  58. 'blist',
  59. # TODO(dcramer): figure out why Travis needs this
  60. 'cassandra-driver<=3.5.0',
  61. 'casscache',
  62. 'cqlsh',
  63. # /cassandra
  64. 'datadog',
  65. 'msgpack-python<0.5.0',
  66. 'pytest-cov>=1.8.0,<1.9.0',
  67. 'pytest-timeout>=0.5.0,<0.6.0',
  68. 'pytest-xdist>=1.11.0,<1.12.0',
  69. 'python-coveralls',
  70. 'responses',
  71. ]
  72. install_requires = [
  73. 'boto3>=1.4.1,<1.5',
  74. 'celery>=3.1.8,<3.1.19',
  75. 'click>=5.0,<7.0',
  76. # 'cryptography>=1.3,<1.4',
  77. 'cssutils>=0.9.9,<0.10.0',
  78. 'Django>=1.6.0,<1.7',
  79. 'django-crispy-forms>=1.4.0,<1.5.0',
  80. 'django-jsonfield>=0.9.13,<0.9.14',
  81. 'django-picklefield>=0.3.0,<0.4.0',
  82. 'django-sudo>=2.1.0,<3.0.0',
  83. 'django-templatetag-sugar>=0.1.0',
  84. 'djangorestframework>=2.4.8,<2.5.0',
  85. 'email-reply-parser>=0.2.0,<0.3.0',
  86. 'enum34>=0.9.18,<1.2.0',
  87. 'exam>=0.5.1',
  88. # broken on python3
  89. 'hiredis>=0.1.0,<0.2.0',
  90. 'honcho>=0.7.0,<0.8.0',
  91. 'kombu==3.0.35',
  92. 'lxml>=3.4.1',
  93. 'ipaddress>=1.0.16,<1.1.0',
  94. 'libsourcemap>=0.7.2,<0.8.0',
  95. 'loremipsum>=1.0.5,<1.1.0',
  96. 'mock>=0.8.0,<1.1',
  97. 'mmh3>=2.3.1,<2.4',
  98. 'oauth2>=1.5.167',
  99. 'percy>=0.4.4',
  100. 'petname>=2.0,<2.1',
  101. 'Pillow>=3.2.0,<3.3.0',
  102. 'progressbar2>=3.10,<3.11',
  103. 'psycopg2>=2.6.0,<2.7.0',
  104. 'pytest>=2.8.0,<2.9.0',
  105. 'pytest-django>=2.9.1,<2.10.0',
  106. 'pytest-html>=1.9.0,<1.10.0',
  107. 'python-dateutil>=2.0.0,<3.0.0',
  108. 'python-memcached>=1.53,<2.0.0',
  109. 'python-openid>=2.2',
  110. 'PyYAML>=3.11,<3.12',
  111. 'raven>=5.29.0,<6.0.0',
  112. 'redis>=2.10.3,<2.11.0',
  113. 'requests[security]>=2.9.1,<2.13.0',
  114. 'selenium==3.0.0b3',
  115. 'simplejson>=3.2.0,<3.9.0',
  116. 'six>=1.10.0,<1.11.0',
  117. 'setproctitle>=1.1.7,<1.2.0',
  118. 'statsd>=3.1.0,<3.2.0',
  119. 'structlog==16.1.0',
  120. 'South==1.0.1',
  121. 'sqlparse>=0.1.16,<0.2.0',
  122. 'symsynd>=3.0.0,<4.0.0',
  123. 'toronado>=0.0.11,<0.1.0',
  124. 'ua-parser>=0.6.1,<0.8.0',
  125. 'urllib3>=1.14,<1.17',
  126. 'uwsgi>2.0.0,<2.1.0',
  127. 'rb>=1.6.0,<2.0.0',
  128. 'qrcode>=5.2.2,<6.0.0',
  129. 'python-u2flib-server>=4.0.1,<4.1.0',
  130. ]
  131. class SentrySDistCommand(SDistCommand):
  132. # If we are not a light build we want to also execute build_assets as
  133. # part of our source build pipeline.
  134. if not IS_LIGHT_BUILD:
  135. sub_commands = SDistCommand.sub_commands + \
  136. [('build_assets', None), ('build_integration_docs', None)]
  137. class SentryBuildCommand(BuildCommand):
  138. def run(self):
  139. BuildCommand.run(self)
  140. if not IS_LIGHT_BUILD:
  141. self.run_command('build_assets')
  142. self.run_command('build_integration_docs')
  143. class SentryDevelopCommand(DevelopCommand):
  144. def run(self):
  145. DevelopCommand.run(self)
  146. if not IS_LIGHT_BUILD:
  147. self.run_command('build_assets')
  148. self.run_command('build_integration_docs')
  149. cmdclass = {
  150. 'sdist': SentrySDistCommand,
  151. 'develop': SentryDevelopCommand,
  152. 'build': SentryBuildCommand,
  153. 'build_assets': BuildAssetsCommand,
  154. 'build_integration_docs': BuildIntegrationDocsCommand,
  155. }
  156. setup(
  157. name='sentry',
  158. version=VERSION,
  159. author='Sentry',
  160. author_email='hello@sentry.io',
  161. url='https://sentry.io',
  162. description='A realtime logging and aggregation server.',
  163. long_description=open(os.path.join(ROOT, 'README.rst')).read(),
  164. package_dir={'': 'src'},
  165. packages=find_packages('src'),
  166. zip_safe=False,
  167. install_requires=install_requires,
  168. extras_require={
  169. 'dev': dev_requires,
  170. 'postgres': [],
  171. 'tests': tests_require,
  172. },
  173. cmdclass=cmdclass,
  174. license='BSD',
  175. include_package_data=True,
  176. entry_points={
  177. 'console_scripts': [
  178. 'sentry = sentry.runner:main',
  179. ],
  180. 'flake8.extension': [
  181. ],
  182. },
  183. classifiers=[
  184. 'Framework :: Django',
  185. 'Intended Audience :: Developers',
  186. 'Intended Audience :: System Administrators',
  187. 'Operating System :: POSIX :: Linux',
  188. 'Programming Language :: Python :: 2',
  189. 'Programming Language :: Python :: 2.7',
  190. 'Programming Language :: Python :: 2 :: Only',
  191. 'Topic :: Software Development'
  192. ],
  193. )