diff options
author | Lars Wirzenius <liw@liw.fi> | 2011-09-11 18:48:41 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2011-09-11 18:48:41 +0100 |
commit | 1f9755f16cd26e0196a28bd9fd220c9b660f6aa4 (patch) | |
tree | 33f49743a767c9ea45f5236cf57582e2a43e7850 /setup.py | |
parent | f091b2e2c8e19a661d589c164d37269c0869d1a3 (diff) | |
download | cmdtest-1f9755f16cd26e0196a28bd9fd220c9b660f6aa4.tar.gz |
Replace Makefile with setup.py.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..c0fd7c3 --- /dev/null +++ b/setup.py @@ -0,0 +1,66 @@ +#!/usr/bin/python +# Copyright (C) 2011 Lars Wirzenius <liw@liw.fi> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +from distutils.core import setup, Extension +from distutils.cmd import Command +from distutils.command.build import build +from distutils.command.clean import clean +import glob +import os +import shutil +import subprocess + +import cmdtest + + +class CleanMore(clean): + + def run(self): + clean.run(self) + for x in ['.coverage'] + glob.glob('*.pyc'): + if os.path.exists(x): + os.remove(x) + + +class Check(Command): + + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + subprocess.check_call(['python', '-m', 'CoverageTestRunner']) + os.remove('.coverage') + + +setup(name='cmdtest', + version=cmdtest.__version__, + description='blackbox testing of Unix command line tools', + author='Lars Wirzenius', + author_email='liw@liw.fi', + url='http://liw.fi/cmdtest/', + scripts=['cmdtest'], + py_modules=['cmdtest.py'], + cmdclass={ + 'check': Check, + 'clean': CleanMore, + }, + ) |