setup.py 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. #!/usr/bin/env python
  2. from __future__ import absolute_import
  3. import os
  4. import sys
  5. if os.environ.get("SENTRY_PYTHON3") and sys.version_info[:2] != (3, 6):
  6. sys.exit("Error: Sentry [In EXPERIMENTAL python 3 mode] requires Python 3.6.")
  7. if not os.environ.get("SENTRY_PYTHON3") and sys.version_info[:2] != (2, 7):
  8. sys.exit("Error: Sentry requires Python 2.7.")
  9. from distutils.command.build import build as BuildCommand
  10. from setuptools import setup, find_packages
  11. from setuptools.command.sdist import sdist as SDistCommand
  12. from setuptools.command.develop import develop as DevelopCommand
  13. ROOT = os.path.dirname(os.path.abspath(__file__))
  14. # add sentry to path so we can import sentry.utils.distutils
  15. sys.path.insert(0, os.path.join(ROOT, "src"))
  16. from sentry.utils.distutils import (
  17. BuildAssetsCommand,
  18. BuildIntegrationDocsCommand,
  19. BuildJsSdkRegistryCommand,
  20. )
  21. VERSION = "20.10.0.dev0"
  22. IS_LIGHT_BUILD = os.environ.get("SENTRY_LIGHT_BUILD") == "1"
  23. def get_requirements(env):
  24. with open(u"requirements-{}.txt".format(env)) as fp:
  25. return [x.strip() for x in fp.read().split("\n") if not x.startswith("#")]
  26. install_requires = get_requirements("base")
  27. dev_requires = get_requirements("dev")
  28. class SentrySDistCommand(SDistCommand):
  29. # If we are not a light build we want to also execute build_assets as
  30. # part of our source build pipeline.
  31. if not IS_LIGHT_BUILD:
  32. sub_commands = SDistCommand.sub_commands + [
  33. ("build_integration_docs", None),
  34. ("build_assets", None),
  35. ("build_js_sdk_registry", None),
  36. ]
  37. class SentryBuildCommand(BuildCommand):
  38. def run(self):
  39. from distutils import log as distutils_log
  40. distutils_log.set_threshold(distutils_log.WARN)
  41. if not IS_LIGHT_BUILD:
  42. self.run_command("build_integration_docs")
  43. self.run_command("build_assets")
  44. self.run_command("build_js_sdk_registry")
  45. BuildCommand.run(self)
  46. class SentryDevelopCommand(DevelopCommand):
  47. def run(self):
  48. DevelopCommand.run(self)
  49. if not IS_LIGHT_BUILD:
  50. self.run_command("build_integration_docs")
  51. self.run_command("build_assets")
  52. self.run_command("build_js_sdk_registry")
  53. cmdclass = {
  54. "sdist": SentrySDistCommand,
  55. "develop": SentryDevelopCommand,
  56. "build": SentryBuildCommand,
  57. "build_assets": BuildAssetsCommand,
  58. "build_integration_docs": BuildIntegrationDocsCommand,
  59. "build_js_sdk_registry": BuildJsSdkRegistryCommand,
  60. }
  61. setup(
  62. name="sentry",
  63. version=VERSION,
  64. author="Sentry",
  65. author_email="hello@sentry.io",
  66. url="https://sentry.io",
  67. description="A realtime logging and aggregation server.",
  68. long_description=open(os.path.join(ROOT, "README.md")).read(),
  69. long_description_content_type="text/markdown",
  70. package_dir={"": "src"},
  71. packages=find_packages("src"),
  72. zip_safe=False,
  73. install_requires=install_requires,
  74. extras_require={"dev": dev_requires, "rabbitmq": ["amqp==2.6.1"]},
  75. cmdclass=cmdclass,
  76. license="BSL-1.1",
  77. include_package_data=True,
  78. entry_points={
  79. "console_scripts": ["sentry = sentry.runner:main"],
  80. "sentry.apps": [
  81. # TODO: This can be removed once the getsentry tests no longer check for this app
  82. "auth_activedirectory = sentry.auth.providers.saml2.activedirectory",
  83. "auth_auth0 = sentry.auth.providers.saml2.auth0",
  84. "auth_github = sentry.auth.providers.github",
  85. "auth_okta = sentry.auth.providers.saml2.okta",
  86. "auth_onelogin = sentry.auth.providers.saml2.onelogin",
  87. "auth_rippling = sentry.auth.providers.saml2.rippling",
  88. "auth_saml2 = sentry.auth.providers.saml2.generic",
  89. "jira_ac = sentry_plugins.jira_ac",
  90. "jira = sentry_plugins.jira",
  91. "freight = sentry_plugins.freight",
  92. "opsgenie = sentry_plugins.opsgenie",
  93. "redmine = sentry_plugins.redmine",
  94. "sessionstack = sentry_plugins.sessionstack",
  95. "teamwork = sentry_plugins.teamwork",
  96. "trello = sentry_plugins.trello",
  97. "twilio = sentry_plugins.twilio",
  98. ],
  99. "sentry.plugins": [
  100. "amazon_sqs = sentry_plugins.amazon_sqs.plugin:AmazonSQSPlugin",
  101. "asana = sentry_plugins.asana.plugin:AsanaPlugin",
  102. "bitbucket = sentry_plugins.bitbucket.plugin:BitbucketPlugin",
  103. "clubhouse = sentry_plugins.clubhouse.plugin:ClubhousePlugin",
  104. "freight = sentry_plugins.freight.plugin:FreightPlugin",
  105. "github = sentry_plugins.github.plugin:GitHubPlugin",
  106. "gitlab = sentry_plugins.gitlab.plugin:GitLabPlugin",
  107. "heroku = sentry_plugins.heroku.plugin:HerokuPlugin",
  108. "jira = sentry_plugins.jira.plugin:JiraPlugin",
  109. "jira_ac = sentry_plugins.jira_ac.plugin:JiraACPlugin",
  110. "opsgenie = sentry_plugins.opsgenie.plugin:OpsGeniePlugin",
  111. "pagerduty = sentry_plugins.pagerduty.plugin:PagerDutyPlugin",
  112. "phabricator = sentry_plugins.phabricator.plugin:PhabricatorPlugin",
  113. "pivotal = sentry_plugins.pivotal.plugin:PivotalPlugin",
  114. "pushover = sentry_plugins.pushover.plugin:PushoverPlugin",
  115. "redmine = sentry_plugins.redmine.plugin:RedminePlugin",
  116. "segment = sentry_plugins.segment.plugin:SegmentPlugin",
  117. "sessionstack = sentry_plugins.sessionstack.plugin:SessionStackPlugin",
  118. "slack = sentry_plugins.slack.plugin:SlackPlugin",
  119. "splunk = sentry_plugins.splunk.plugin:SplunkPlugin",
  120. "teamwork = sentry_plugins.teamwork.plugin:TeamworkPlugin",
  121. "trello = sentry_plugins.trello.plugin:TrelloPlugin",
  122. "twilio = sentry_plugins.twilio.plugin:TwilioPlugin",
  123. "victorops = sentry_plugins.victorops.plugin:VictorOpsPlugin",
  124. "vsts = sentry_plugins.vsts.plugin:VstsPlugin",
  125. ],
  126. },
  127. classifiers=[
  128. "Framework :: Django",
  129. "Intended Audience :: Developers",
  130. "Intended Audience :: System Administrators",
  131. "Operating System :: POSIX :: Linux",
  132. "Programming Language :: Python :: 2",
  133. "Programming Language :: Python :: 2.7",
  134. "Programming Language :: Python :: 2 :: Only",
  135. "Topic :: Software Development",
  136. "License :: Other/Proprietary License",
  137. ],
  138. )