From b2a1f15bf6999b727fcb9f4f29f2b74c65c49c5c Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Wed, 7 Feb 2018 16:06:46 -0800 Subject: [PATCH] clean up test infrastructure - fix crufty, broken test in setup.py - include tests in sdist tarball for pypi --- MANIFEST.in | 1 + setup.cfg | 6 ++++++ setup.py | 19 +++---------------- 3 files changed, 10 insertions(+), 16 deletions(-) create mode 100644 MANIFEST.in create mode 100644 setup.cfg diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..1276f2e --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1 @@ +recursive-include tests *.py *.sh Dockerfile diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..df07c14 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,6 @@ +[aliases] +test=pytest + +[tool:pytest] +addopts=-v +testpaths=tests diff --git a/setup.py b/setup.py index 26056c2..83e8187 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ ''' setup.py - setuptools installation configuration for warcprox -Copyright (C) 2013-2016 Internet Archive +Copyright (C) 2013-2018 Internet Archive This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -22,18 +22,6 @@ USA. import sys import setuptools -import setuptools.command.test - -class PyTest(setuptools.command.test.test): - def finalize_options(self): - setuptools.command.test.test.finalize_options(self) - self.test_args = [] - self.test_suite = True - def run_tests(self): - # import here, because outside the eggs aren't loaded - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) deps = [ 'certauth==1.1.6', @@ -52,7 +40,7 @@ except: setuptools.setup( name='warcprox', - version='2.4b2.dev147', + version='2.4b2.dev148', description='WARC writing MITM HTTP/S proxy', url='https://github.com/internetarchive/warcprox', author='Noah Levitt', @@ -61,9 +49,8 @@ setuptools.setup( license='GPL', packages=['warcprox'], install_requires=deps, + setup_requires=['pytest-runner'], tests_require=['mock', 'pytest', 'warcio'], - cmdclass = {'test': PyTest}, - test_suite='warcprox.tests', entry_points={ 'console_scripts': [ 'warcprox=warcprox.main:main',