-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
88 lines (71 loc) · 2.79 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
"""Bladerunner's setup.py."""
import io
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
def find_version(filename):
"""Uses re to pull out the assigned value to __version__ in filename."""
with io.open(filename, encoding="utf-8") as version_file:
version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
version_file.read(), re.M)
if version_match:
return version_match.group(1)
return "0.0-version-unknown"
def read_description(filename):
"""Reads filename and returns its contents."""
with io.open(filename, encoding="utf-8") as opendescription:
return opendescription.read()
class PyTest(TestCommand):
"""Shim in pytest to be able to use it with setup.py test."""
def finalize_options(self):
"""Stolen from http://pytest.org/latest/goodpractises.html."""
TestCommand.finalize_options(self)
self.test_args = ["-v", "-rf", "--cov-report", "term-missing", "--cov",
"bladerunner", "test"]
self.test_suite = True
def run_tests(self):
"""Also shamelessly stolen."""
# have to import here, outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
raise SystemExit(errno)
setup(
name="bladerunner",
version=find_version("bladerunner/__init__.py"),
author="Adam Talsma",
author_email="adam@talsma.ca",
packages=["bladerunner"],
install_requires=["pexpect >= 3.3", "six >= 1.9.0"],
extras_require={
":python_version < '3.2'": "futures >= 2.2.0",
":python_version < '3.3'": "ipaddress >= 1.0.7, < 2.0.0",
},
entry_points={
'console_scripts': [
'bladerunner = bladerunner.cmdline:main',
]
},
url="https://github.com/a-tal/bladerunner",
description="Execution of commands on hosts",
long_description=read_description("README.rst"),
download_url="https://github.com/a-tal/bladerunner",
tests_require=["pytest", "pytest-cov", "mock", "tornado"],
cmdclass={"test": PyTest},
license="GPLv2",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v2 (GPLv2)",
"Operating System :: POSIX :: Linux",
"Topic :: System :: Clustering",
"Topic :: System :: Systems Administration",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
],
)