diff options
author | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-01 13:27:43 +0100 |
---|---|---|
committer | Vinay Sajip <vinay_sajip@yahoo.co.uk> | 2010-10-01 13:27:43 +0100 |
commit | 63e8962c46d84ae7afd78ab932fbc5a55d4fd2f6 (patch) | |
tree | 7bfbacb593e224a360559d67d12e014929c59d5d /setup.py | |
download | logutils-git-63e8962c46d84ae7afd78ab932fbc5a55d4fd2f6.tar.gz |
Initial import.0.1
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..29dcac6 --- /dev/null +++ b/setup.py @@ -0,0 +1,76 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2010 Vinay Sajip. All Rights Reserved. +# +# Permission to use, copy, modify, and distribute this software and its +# documentation for any purpose and without fee is hereby granted, +# provided that the above copyright notice appear in all copies and that +# both that copyright notice and this permission notice appear in +# supporting documentation, and that the name of Vinay Sajip +# not be used in advertising or publicity pertaining to distribution +# of the software without specific, written prior permission. +# VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +# ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL +# VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +# ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +# IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +# OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +# + +import distutils.core +import logutils +from os.path import join, dirname, abspath +import re + + +def description(): + readme = open(join(dirname(__file__), 'README.txt')).read() + regexp = r'^logutils\s*[\d.]*\s*\n=======+\s*\n(.*)Requirements ' + reqts, = re.findall(regexp, readme, re.DOTALL) + regexp = r'Availability & Documentation\s*\n-----+\s*\n(.*)' + avail, = re.findall(regexp, readme, re.DOTALL) + return reqts + avail + +class TestCommand(distutils.core.Command): + user_options = [] + + def run(self): + import sys + import unittest + + sys.path.append(join(dirname(__file__), 'tests')) + import logutil_tests + loader = unittest.TestLoader() + runner = unittest.TextTestRunner() + runner.run(loader.loadTestsFromModule(logutil_tests)) + + def initialize_options(self): + pass + + def finalize_options(self): + pass + +distutils.core.setup( + name='logutils', + version=logutils.__version__, + author='Vinay Sajip', + author_email='vinay_sajip@red-dove.com', + url='http://code.google.com/p/logutils/', + description='Logging utilities', + long_description = description(), + license='New BSD', + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: New BSD License', + 'Operating System :: OS Independent', + 'Programming Language :: Python', + 'Topic :: Software Development', + ], + packages=['logutils'], + cmdclass={ + 'test': TestCommand, + }, + +) |