aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2012-01-18 10:27:19 +0100
committerMatěj Cepl <mcepl@redhat.com>2012-01-18 10:27:19 +0100
commit4a196e71d4aa325b93749b015a757109de006db5 (patch)
tree3a820048abbfcb6fe6a36c6635bea04e33385d64 /setup.py
parentddeec222e02608798e3f9bc6a806343da7777332 (diff)
downloadjson_diff-4a196e71d4aa325b93749b015a757109de006db5.tar.gz
Plenty of setup.py work.1.2.7
* Yet another (hopefully the last) fix of the development website. We are on fedorahosted.org now. * Move tests to test/ module * Clean up setup.py (when using defaults, install doesn’t install tests, which I like) * Add new setup.py command test to run the test suite.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py43
1 files changed, 35 insertions, 8 deletions
diff --git a/setup.py b/setup.py
index 56b2871..f1be6d3 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,38 @@
# coding: utf-8
-from distutils.core import setup
+from distutils.core import setup, Command
+import os.path
import json_diff
+
+class RunTests(Command):
+ """New setup.py command to run all tests for the package.
+ """
+ description = "run all tests for the package"
+
+ user_options = []
+
+ def initialize_options(self):
+ pass
+
+ def finalize_options(self):
+ pass
+
+ def run(self):
+ import unittest
+ import test.test_json_diff
+ unittest.TextTestRunner(verbosity=2).run(test.test_json_diff.suite)
+
+
+def read(fname):
+ with open(os.path.join(os.path.dirname(__file__), fname)) as f:
+ return "\n" + f.read().replace("\r\n", "\n")
+
+
+def get_long_description():
+ return read("README.txt") \
+ + "\nChangelog:\n" + "=" * 10 + "\n" \
+ + read("NEWS.txt")
+
setup(
name='json_diff',
version='%s' % json_diff.__version__,
@@ -9,14 +40,10 @@ setup(
author='Matěj Cepl',
author_email='mcepl@redhat.com',
url='https://fedorahosted.org/json_diff/',
- py_modules=['json_diff', 'test_json_diff', 'test_strings'],
- package_data={
- 'json_diff': 'test/*'
- },
- long_description="""Compares two JSON files (http://json.org) and
-generates a new JSON file with the result. Allows exclusion of some
-keys from the comparison, or in other way to include only some keys.""",
+ py_modules=['json_diff'],
+ long_description=get_long_description(),
keywords=['json', 'diff'],
+ cmdclass={'test': RunTests},
classifiers=[
"Programming Language :: Python",
"Development Status :: 4 - Beta",