-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
133 lines (114 loc) · 4.19 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env python
from __future__ import print_function
import os
import sys
from subprocess import (
CalledProcessError,
STDOUT,
check_output,
)
from setuptools import setup, find_packages, Command
from setuptools.command.sdist import sdist
class SubproccessCommand(Command):
def _run_with_output(self, *args, **kwargs):
try:
print(check_output(*args, **kwargs))
except CalledProcessError as e:
print(e.output, file=sys.stderr)
raise e
class BowerInstallCommand(SubproccessCommand):
description = "run bower commands [install by default]"
user_options = [
("bower-command=", "c", 'Bower command to run. Defaults to "install".'),
("force-latest", "F", "Force latest version on conflict."),
("allow-root", "R", "Allow bower to be run as root."),
("production", "p", "Do not install project devDependencies."),
]
boolean_options = ["production", "force-latest", "allow-root"]
def initialize_options(self):
self.force_latest = False
self.production = False
self.bower_command = "install"
self.allow_root = False
def finalize_options(self):
pass
def run(self):
cmd = ["bower", self.bower_command, "--no-color"]
if self.force_latest:
cmd.append("-F")
if self.production:
cmd.append("-p")
if self.allow_root:
cmd.append("--allow-root")
self._run_with_output(cmd, stderr=STDOUT)
class BuildAssetsCommand(SubproccessCommand):
description = "build django assets"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
src_dir = os.path.join(os.path.dirname(__file__), "src")
self._run_with_output(
["python", "manage.py", "assets", "build"], cwd=src_dir, stderr=STDOUT
)
class SdistCommandWithJS(sdist):
def run(self):
self.run_command("install_bower")
self.run_command("build_assets")
sdist.run(self)
setup(
name="edge-genome",
version="3.28.2",
author="Ginkgo Bioworks",
author_email="[email protected]",
url="https://github.com/ginkgobioworks/edge/",
description="Genome Engineering Tool",
long_description=open("README.rst").read(),
license="MIT",
keywords="edge genome annotate track query django database ginkgo",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Environment :: Other Environment",
"Framework :: Django :: 1.6",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.7",
"Programming Language :: JavaScript",
"Programming Language :: SQL",
"Topic :: Database",
"Topic :: Internet :: WWW/HTTP :: Indexing/Search",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Artificial Life",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing :: General",
],
cmdclass={
"install_bower": BowerInstallCommand,
"build_assets": BuildAssetsCommand,
"sdist": SdistCommandWithJS,
},
package_dir={"": "src"},
packages=find_packages("src", exclude=["*.migrations", "*server*"]),
include_package_data=True,
zip_safe=True,
# Django has to be specified here because django_assets tries to install Django>=1.7 and will
# force install Django2+ in setup
setup_requires=["django_assets >= 0.12", "Django ~= 2.2.13",],
install_requires=[
"django ~= 2.2.13",
"jsmin",
"celery >= 4.0",
"bcbio-gff",
"pytz >= 1023b",
],
tests_require=["nose", "coverage", "django-nose", "flake8", "mysql-python",],
)