forked from mozilla-releng/scriptworker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
102 lines (86 loc) · 2.8 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
from __future__ import print_function
import json
import os
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
if {"register", "upload"}.intersection(set(sys.argv)):
print(
" ***** WARNING *****\n"
"`python setup.py register` and `python setup.py upload` are unsafe!\n"
"See http://scriptworker.readthedocs.io/en/latest/releases.html#pypi\n"
"\n"
"Exiting...",
file=sys.stderr,
)
sys.exit(1)
tests_require = [
"asyncio_extras",
"flake8",
"flake8_docstrings",
"mock",
"pytest",
"pytest-asyncio",
"pytest-cov",
"pytest-mock",
"pytest-random-order",
"tox",
"virtualenv",
]
PATH = os.path.join(os.path.dirname(__file__), "version.json")
with open(PATH) as filehandle:
VERSION = json.load(filehandle)["version_string"]
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), "requirements.txt")) as f:
install_requires = f.readlines()
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 shlex
import tox
args = self.tox_args
if args:
args = shlex.split(self.tox_args)
errno = tox.cmdline(args=args)
sys.exit(errno)
setup(
name="scriptworker",
version=VERSION,
description="TaskCluster Script Worker",
author="Mozilla Release Engineering",
author_email="[email protected]",
url="https://github.com/mozilla-releng/scriptworker",
packages=["scriptworker", "scriptworker.cot"],
package_data={"": ["version.json"]},
package_dir={"": "src"},
include_package_data=True,
entry_points={
"console_scripts": [
"scriptworker = scriptworker.worker:main",
"verify_cot = scriptworker.cot.verify:verify_cot_cmdln",
"create_test_workdir = scriptworker.cot.verify:create_test_workdir",
"verify_ed25519_signature = scriptworker.ed25519:verify_ed25519_signature_cmdln",
]
},
zip_safe=False,
license="MPL 2.0",
install_requires=install_requires,
tests_require=tests_require,
python_requires=">=3.7",
cmdclass={"test": Tox},
classifiers=(
"Intended Audience :: Developers",
"Natural Language :: English",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
),
)