forked from JonnyJD/python-discid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·69 lines (60 loc) · 2.27 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
#!/usr/bin/env python
import sys
import unittest
from distutils.core import setup, Command
from discid import __version__
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", "test_discid.TestClass"]
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))
setup(name="discid",
version=__version__,
description="Python binding of Libdiscid",
long_description=open("README.rst").read(),
author="Johannes Dewender",
author_email="[email protected]",
url="https://python-discid.readthedocs.org/",
license="LGPLv3+",
packages = ["discid"],
cmdclass = {"test": Test},
classifiers=[
"Development Status :: 4 - Beta",
"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",
"Topic :: Multimedia :: Sound/Audio :: CD Audio :: CD Ripping",
"Topic :: Software Development :: Libraries :: Python Modules"
]
)
# vim:set shiftwidth=4 smarttab expandtab: