-
Notifications
You must be signed in to change notification settings - Fork 35
/
setup.py
181 lines (158 loc) · 4.87 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/usr/bin/env python
# coding=utf-8
# Copyright [2017] [B2W Digital]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import print_function
import os.path
import os
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
# Package basic info
PACKAGE_NAME = 'marvin_python_toolbox'
PACKAGE_DESCRIPTION = 'Marvin Python Toolbox'
URL = 'https://github.com/marvin-ai/marvin-python-toolbox'
AUTHOR_NAME = 'Daniel Takabayashi'
AUTHOR_EMAIL = 'daniel.takabayashi@gmail.com'
PYTHON_2 = True
PYTHON_3 = True
# Project status
# (should be 'planning', 'pre-alpha', 'alpha', 'beta', 'stable', 'mature' or 'inactive').
STATUS = 'stable'
# Project topic
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for a list
TOPIC = 'Topic :: Software Development :: Libraries :: Python Modules',
# External dependencies
# More info https://pythonhosted.org/setuptools/setuptools.html#declaring-dependencies
REQUIREMENTS_EXTERNAL = [
'six>=1.10.0',
'bumpversion>=0.5.3',
'click>=3.3',
'jupyter>=1.0.0',
'jupyterlab>=0.32.1',
'pep8>=1.7.0',
'virtualenv>=15.0.1',
'jsonschema>=2.5.1',
'python-slugify>=0.1.0',
'paramiko>=2.1.2',
'PyHive>=0.3.0',
'thrift>=0.10.0',
'thrift-sasl>=0.2.1',
'virtualenvwrapper>=4.7.1',
'requests>=2.19.1',
'python-dateutil>=2.7.3',
'python-slugify>=0.1.0',
'path.py>=7.2',
'httpretty>=0.9.5',
'tornado>=4.5.3',
'jsonschema>=2.5.1',
'gprof2dot',
'ujsonpath>=0.0.2',
'simplejson>=3.10.0',
'configobj>=5.0.6',
'findspark>=1.1.0',
'grpcio>=1.13.0',
'grpcio-tools>=1.13.0',
'joblib>=0.11',
'autopep8>=1.3.3',
'progressbar2>=3.34.3',
'urllib3>=1.21.1',
'idna>=2.5',
'bleach>=1.5.0',
'numpy==1.13.3'
]
# Test dependencies
REQUIREMENTS_TESTS = [
'tox>=2.2.0',
'mock>=2.0.0',
'pytest>=2.9.2',
'pytest-cov>=1.8.1',
'pytest-watch>=4.1.0',
'pytest-testmon>=0.8.2',
'Keras>=2.2.0',
'tensorflow>=1.8.0',
]
# This is normally an empty list
DEPENDENCY_LINKS_EXTERNAL = []
# script to be used
SCRIPTS = ['bin/marvin', 'marvin.ini']
def _get_version():
"""Return the project version from VERSION file."""
with open(os.path.join(os.path.dirname(__file__), PACKAGE_NAME, 'VERSION'), 'rb') as f:
version = f.read().decode('ascii').strip()
return version
class Tox(TestCommand):
"""Run the test cases using TOX command."""
user_options = [('tox-args=', 'a', "Arguments to pass to tox")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.tox_args = None
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# Import here, cause outside the eggs aren't loaded
import tox
import shlex
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
else:
# Run all tests by default
args = ['-c', os.path.join(os.path.dirname(__file__), 'tox.ini'), 'tests']
errno = tox.cmdline(args=args)
sys.exit(errno)
DEVELOPMENT_STATUS = {
'planning': '1 - Planning',
'pre-alpha': '2 - Pre-Alpha',
'alpha': 'Alpha',
'beta': '4 - Beta',
'stable': '5 - Production/Stable',
'mature': '6 - Mature',
'inactive': '7 - Inactive',
}
CLASSIFIERS = ['Development Status :: {}'.format(DEVELOPMENT_STATUS[STATUS])]
if PYTHON_2:
CLASSIFIERS += [
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
]
if PYTHON_3:
CLASSIFIERS += [
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
]
setup(
name=PACKAGE_NAME,
version=_get_version(),
url=URL,
description=PACKAGE_DESCRIPTION,
long_description=open(os.path.join(os.path.dirname(__file__), 'README.md')).read(),
author=AUTHOR_NAME,
maintainer=AUTHOR_NAME,
maintainer_email=AUTHOR_EMAIL,
packages=find_packages(exclude=('tests', 'tests.*')),
include_package_data=True,
zip_safe=False,
classifiers=CLASSIFIERS,
install_requires=REQUIREMENTS_EXTERNAL,
tests_require=REQUIREMENTS_TESTS,
extras_require={
'testing': REQUIREMENTS_TESTS,
},
dependency_links=DEPENDENCY_LINKS_EXTERNAL,
scripts=SCRIPTS,
cmdclass={'test': Tox},
)