|
@@ -22,7 +22,10 @@ any application.
|
|
|
:license: BSD, see LICENSE for more details.
|
|
|
"""
|
|
|
|
|
|
+from distutils import log
|
|
|
+from distutils.command.sdist import sdist
|
|
|
from setuptools import setup, find_packages
|
|
|
+from subprocess import check_output
|
|
|
|
|
|
|
|
|
# Hack to prevent stupid "TypeError: 'NoneType' object is not callable" error
|
|
@@ -109,6 +112,19 @@ mysql_requires = [
|
|
|
]
|
|
|
|
|
|
|
|
|
+class CustomSdist(sdist):
|
|
|
+ """
|
|
|
+ Identical to the built-in sdist command except that we need to generate
|
|
|
+ static media before building the tarball.
|
|
|
+ """
|
|
|
+ def make_distribution(self):
|
|
|
+ log.info("running npm install")
|
|
|
+ check_output(['npm', 'install', '--quiet'])
|
|
|
+ log.info("running sentry compilestatic")
|
|
|
+ check_output(['sentry', 'compilestatic'])
|
|
|
+ return sdist.make_distribution(self)
|
|
|
+
|
|
|
+
|
|
|
setup(
|
|
|
name='sentry',
|
|
|
version='7.0.0-DEV',
|
|
@@ -128,6 +144,9 @@ setup(
|
|
|
'postgres_pypy': install_requires + postgres_pypy_requires,
|
|
|
'mysql': install_requires + mysql_requires,
|
|
|
},
|
|
|
+ cmdclass={
|
|
|
+ 'sdist': CustomSdist,
|
|
|
+ },
|
|
|
license='BSD',
|
|
|
include_package_data=True,
|
|
|
entry_points={
|