-
Notifications
You must be signed in to change notification settings - Fork 8
/
setup.py
executable file
·74 lines (65 loc) · 2.49 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
#!/usr/bin/env python
import sys
import unittest
from distutils.core import setup, Command
class Test(Command):
description = "run the test suite"
# options as listed with "--help test"
# --verbose --quiet -> self.verbose are already handles as global options
user_options = [
("tests=", None,
"a comma separated list of tests to run (default all)")
]
def initialize_options(self):
# set defaults
self.tests = None
def finalize_options(self):
if self.verbose:
self.verbosity = 2
else:
self.verbosity = 1
if self.tests is not None:
if self.tests:
self.names = self.tests.split(",")
else:
self.names = []
else:
self.names = ["test_discid.TestModulePrivate",
"test_discid.TestModule"]
def run(self):
suite = unittest.defaultTestLoader.loadTestsFromNames(self.names)
runner = unittest.TextTestRunner(verbosity=self.verbosity)
result = runner.run(suite)
if result.wasSuccessful():
sys.exit(0)
else:
sys.exit(len(result.failures) + len(result.errors))
with open("README.rst") as readme:
long_description = readme.read()
setup(name="discid",
version="1.2.0",
description="Python binding of Libdiscid",
long_description=long_description,
author="Johannes Dewender",
author_email="[email protected]",
url="https://python-discid.readthedocs.org/",
license="LGPLv3+",
packages = ["discid"],
cmdclass = {"test": Test},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
"Topic :: Software Development :: Libraries :: Python Modules"
]
)
# vim:set shiftwidth=4 smarttab expandtab: