setup.py 6.2 KB

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