From 1f9755f16cd26e0196a28bd9fd220c9b660f6aa4 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 11 Sep 2011 18:48:41 +0100 Subject: Replace Makefile with setup.py. --- setup.py | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 setup.py (limited to 'setup.py') 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 +# +# 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, + }, + ) -- cgit v1.2.1