setup.py 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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 <https://github.com/getsentry/raven-python>`_)
  12. and all of the logic behind storage and aggregation.
  13. That said, Sentry is not limited to Python. The primary implementation is in
  14. Python, but it contains a full API for sending events from any language, in
  15. any application.
  16. :copyright: (c) 2011-2014 by the Sentry Team, see AUTHORS for more details.
  17. :license: BSD, see LICENSE for more details.
  18. """
  19. from __future__ import absolute_import
  20. import os.path
  21. from distutils import log
  22. from distutils.core import Command
  23. from setuptools.command.develop import develop
  24. from setuptools.command.sdist import sdist
  25. from setuptools import setup, find_packages
  26. from subprocess import check_output
  27. # Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
  28. # in multiprocessing/util.py _exit_function when running `python
  29. # setup.py test` (see
  30. # http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html)
  31. for m in ('multiprocessing', 'billiard'):
  32. try:
  33. __import__(m)
  34. except ImportError:
  35. pass
  36. ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
  37. dev_requires = [
  38. 'flake8>=2.0,<2.1',
  39. ]
  40. tests_require = [
  41. 'blist', # used by cassandra
  42. 'casscache',
  43. 'cqlsh',
  44. 'elasticsearch',
  45. 'httpretty',
  46. 'pytest-cov>=1.4',
  47. 'pytest-timeout',
  48. 'python-coveralls',
  49. 'riak',
  50. ]
  51. install_requires = [
  52. 'BeautifulSoup>=3.2.1,<3.3.0',
  53. 'celery>=3.0.15,<3.1.0',
  54. 'cssutils>=0.9.9,<0.10.0',
  55. 'Django>=1.6.0,<1.7',
  56. 'django-bitfield>=1.7.0,<1.8.0',
  57. 'django-celery>=3.0.11,<3.1.0',
  58. 'django-crispy-forms>=1.4.0,<1.5.0',
  59. 'django-paging>=0.2.5,<0.3.0',
  60. 'django-picklefield>=0.3.0,<0.4.0',
  61. 'django-recaptcha>=1.0.0,<1.1.0',
  62. 'django-social-auth>=0.7.28,<0.8.0',
  63. 'django-statsd-mozilla>=0.3.8.0,<0.3.9.0',
  64. 'django-sudo>=1.1.0,<1.2.0',
  65. 'django-templatetag-sugar>=0.1.0',
  66. 'djangorestframework>=2.3.8,<2.4.0',
  67. 'email-reply-parser>=0.2.0,<0.3.0',
  68. 'enum34>=0.9.18,<0.10.0',
  69. 'exam>=0.5.1',
  70. 'gunicorn>=0.17.2,<0.18.0',
  71. 'ipaddr>=2.1.11,<2.2.0',
  72. 'logan>=0.5.8.2,<0.6.0',
  73. 'lxml>=3.4.1',
  74. 'mock>=0.8.0',
  75. 'nydus>=0.10.7,<0.11.0',
  76. 'markdown>=2.4.1,<2.5.0',
  77. 'progressbar>=2.2,<2.4',
  78. 'Pygments>=1.6.0,<1.7.0',
  79. 'pytest',
  80. 'pytest-django',
  81. 'python-dateutil>=1.5.0,<2.0.0',
  82. 'python-memcached>=1.53,<2.0.0',
  83. 'raven>=5.0.0',
  84. 'redis>=2.7.0,<2.11.0',
  85. 'simplejson>=3.1.0,<3.4.0',
  86. 'six>=1.6.0,<2.0.0',
  87. 'setproctitle>=1.1.7,<1.2.0',
  88. 'South==1.0.1',
  89. 'toronado>=0.0.4,<0.1.0',
  90. 'ua-parser>=0.3.5',
  91. 'urllib3>=1.7.1,<1.8.0',
  92. ]
  93. postgres_requires = [
  94. 'psycopg2>=2.5.0,<2.6.0',
  95. ]
  96. postgres_pypy_requires = [
  97. 'psycopg2cffi',
  98. ]
  99. mysql_requires = [
  100. 'MySQL-python>=1.2.0,<1.3.0',
  101. ]
  102. class DevelopWithBuildStatic(develop):
  103. def install_for_development(self):
  104. self.run_command('build_static')
  105. return develop.install_for_development(self)
  106. class SdistWithBuildStatic(sdist):
  107. def make_distribution(self):
  108. self.run_command('build_static')
  109. return sdist.make_distribution(self)
  110. class BuildStatic(Command):
  111. def initialize_options(self):
  112. pass
  113. def finalize_options(self):
  114. pass
  115. def run(self):
  116. log.info("running [npm install --quiet]")
  117. check_output(['npm', 'install', '--quiet'], cwd=ROOT)
  118. log.info("running [gulp dist]")
  119. check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'dist'], cwd=ROOT)
  120. setup(
  121. name='sentry',
  122. version='7.3.0.dev0',
  123. author='David Cramer',
  124. author_email='dcramer@gmail.com',
  125. url='https://www.getsentry.com',
  126. description='A realtime logging and aggregation server.',
  127. long_description=open('README.rst').read(),
  128. package_dir={'': 'src'},
  129. packages=find_packages('src'),
  130. zip_safe=False,
  131. install_requires=install_requires,
  132. extras_require={
  133. 'tests': tests_require,
  134. 'dev': dev_requires,
  135. 'postgres': install_requires + postgres_requires,
  136. 'postgres_pypy': install_requires + postgres_pypy_requires,
  137. 'mysql': install_requires + mysql_requires,
  138. },
  139. cmdclass={
  140. 'build_static': BuildStatic,
  141. 'develop': DevelopWithBuildStatic,
  142. 'sdist': SdistWithBuildStatic,
  143. },
  144. license='BSD',
  145. include_package_data=True,
  146. entry_points={
  147. 'console_scripts': [
  148. 'sentry = sentry.utils.runner:main',
  149. ],
  150. },
  151. classifiers=[
  152. 'Framework :: Django',
  153. 'Intended Audience :: Developers',
  154. 'Intended Audience :: System Administrators',
  155. 'Operating System :: OS Independent',
  156. 'Topic :: Software Development'
  157. ],
  158. )