summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile25
-rw-r--r--setup.py66
2 files changed, 66 insertions, 25 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 11e7a27..0000000
--- a/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 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, see <http://www.gnu.org/licenses/>.
-
-
-all:
-
-check:
- python -m CoverageTestRunner --ignore-missing-from=without-tests
- rm .coverage
-
-clean:
- rm -f *.py[co]
-
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,
+ },
+ )