-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
95 lines (69 loc) · 2.46 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
from distutils.core import setup, Command
import unittest
import doctest
from unittest import defaultTestLoader, TextTestRunner
import sys
import lzw
TEST_MODULE_NAME = "tests.tests"
SLOW_TEST_MODULE_NAME = "tests.slow"
DOC_DIR_NAME = "doc"
MODULES = [ "lzw" ]
class RunTestsCommand(Command):
"""Runs package tests"""
user_options = [('runslow', None, 'also runs the (fairly slow) functional tests')]
def initialize_options(self):
self.runslow = False
def finalize_options(self):
pass # how on earth is this supposed to work?
def run(self):
import lzw
doctest.testmod(lzw)
utests = defaultTestLoader.loadTestsFromName(TEST_MODULE_NAME)
urunner = TextTestRunner(verbosity=2)
urunner.run(utests)
if self.runslow:
utests = defaultTestLoader.loadTestsFromName(SLOW_TEST_MODULE_NAME)
urunner = TextTestRunner(verbosity=2)
urunner.run(utests)
class DocCommand(Command):
"""Generates package documentation using epydoc"""
user_options = []
def initialize_options(self): pass
def finalize_options(self): pass
def run(self):
# Slightly stupid. Move to sphinx when you can, please.
import epydoc.cli
real_argv = sys.argv
sys.argv = [ "epydoc", "--output", DOC_DIR_NAME, "--no-private" ] + MODULES
epydoc.cli.cli()
sys.argv = real_argv
setup(name="lzw",
description="Low Level, pure python lzw compression/decompression library",
py_modules=MODULES,
version=lzw.__version__,
author=lzw.__author__,
author_email=lzw.__email__,
url=lzw.__url__,
license=lzw.__license__,
platforms='Python 2.6',
download_url='http://pypi.python.org/packages/source/l/lzw/lzw-0.01.tar.gz',
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Programming Language :: Python",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Topic :: System :: Archiving",
"Topic :: Software Development :: Libraries :: Python Modules",
"Intended Audience :: Developers",
"Natural Language :: English",
],
packages = ['lzw'],
long_description = """
A pure python module for compressing and decompressing streams of
data, built around iterators. Requires python 2.6
""",
cmdclass = {
'test' : RunTestsCommand,
'doc' : DocCommand,
},
)