Permalink
Browse files

Added unit tests to setup.py.

  • Loading branch information...
David Zwarg
David Zwarg committed Dec 8, 2011
1 parent de1ee5d commit edf4a5f8fe60b2ca6627f0fc0fd0821ba47b537b
Showing with 25 additions and 3 deletions.
  1. +25 −3 setup.py
View
@@ -18,23 +18,45 @@
limitations under the License.
"""
-import os
-from setuptools import setup
+import os, subprocess
+from setuptools import setup, Command
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
+class RunTests(Command):
+ description = "Run the unittest suite for python-sld."
+ user_options = [('verbose', 'v', 'Logging verbosity.')]
+ extra_env = {}
+ extra_args = []
+
+ def run(self):
+ os.chdir('sld')
+ args = ['./run_tests.py']
+ if self.verbose == 2:
+ args.append('-v')
+
+ subprocess.call(args)
+
+ def initialize_options(self):
+ self.verbose = 1
+
+ def finalize_options(self):
+ pass
+
setup(
name = "python-sld",
- version = "1.0.3",
+ version = "1.0.4",
author = "David Zwarg",
author_email = "dzwarg@azavea.com",
description = ("A simple python library that enables dynamic SLD creation and manipulation."),
license = "Apache 2.0",
keywords = "ogc sld geo geoserver mapserver osgeo",
url = "http://github.com/dzwarg/python-sld/",
packages = ["sld","sld.test"],
+ package_data = {"sld.test": ["style.sld"]},
long_description = read('README.markdown'),
+ cmdclass = { 'test': RunTests },
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",

0 comments on commit edf4a5f

Please sign in to comment.