diff options
author | David Moss <drkjam@gmail.com> | 2015-06-21 23:51:11 +0100 |
---|---|---|
committer | David Moss <drkjam@gmail.com> | 2015-06-21 23:51:11 +0100 |
commit | efc97c4756d7dc61d3c08772cda89f957819e238 (patch) | |
tree | 1509323de7dc9126925be9a77154bd8f615ecf37 /setup.py | |
parent | 882ed8aab2acfc833b17d600b87ce6f64521e7d9 (diff) | |
download | netaddr-efc97c4756d7dc61d3c08772cda89f957819e238.tar.gz |
- added support for running the test suite to setup.py
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -8,13 +8,28 @@ A distutils Python setup file. For setuptools support see setup_egg.py. import os import sys -from distutils.core import setup +from distutils.core import setup, Command if os.path.exists('MANIFEST'): os.remove('MANIFEST') import release + +class PyTest(Command): + user_options = [] + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import subprocess + import sys + errno = subprocess.call([sys.executable, 'runtests.py']) + raise SystemExit(errno) + def main(): if sys.version_info[:2] < (2, 4): sys.stderr.write("netaddr requires Python version 2.4 or higher.\n") @@ -27,6 +42,7 @@ def main(): author = release.author, author_email = release.author_email, classifiers = release.classifiers, + cmdclass = {'test': PyTest}, description = release.description, download_url = release.download_url, keywords = release.keywords, @@ -39,8 +55,6 @@ def main(): scripts = release.scripts, url = release.url, version = release.version, - install_requires = release.install_requires, - setup_requires = release.setup_requires, options = { 'build_scripts': { 'executable': '/usr/bin/env python', |