forked from mozilla-releng/taskhuddler
/
setup.py
72 lines (61 loc) · 1.71 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
from __future__ import print_function
import json
import os
from setuptools import setup
from setuptools.command.test import test as TestCommand
import sys
reqs = [
"virtualenv",
"taskcluster",
"python-dateutil",
]
tests_require = [
"tox",
"virtualenv",
"taskcluster",
"python-dateutil",
]
PATH = os.path.join(os.path.dirname(__file__), "version.json")
with open(PATH) as filehandle:
VERSION = json.load(filehandle)['version_string']
class Tox(TestCommand):
"""http://bit.ly/1T0dwvG
"""
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)
errno = tox.cmdline(args=args)
sys.exit(errno)
setup(
name="taskhuddler",
version=VERSION,
description="taskcluster-client wrapper",
author="Simon Fraser",
author_email="sfraser@mozilla.com",
url="https://github.com/srfraser/taskhuddler",
packages=["taskhuddler", "taskhuddler.test"],
package_data={"": ["version.json"]},
include_package_data=True,
zip_safe=False,
license="MPL 2.0",
install_requires=reqs,
tests_require=tests_require,
cmdclass={'test': Tox},
classifiers=(
'Intended Audience :: Developers',
'Natural Language :: English',
'Programming Language :: Python :: 3.5',
),
)