#!/usr/bin/env python
import sys, subprocess, os
cmd = sys.argv[1] if len(sys.argv)>=2 else ''
if cmd=='test':
    root = os.path.dirname(__file__)
    os.chdir(root)
    subprocess.call(
                [sys.executable,os.path.join(root,'tests','test_wrapjson.py')]+sys.argv[2:],
                stderr =subprocess.STDOUT,
                stdout = None,
                timeout = 20,
                )
else:
    from setuptools import setup
    setup()
