Tweak print/jabref version 3.3,1
[dports.git] / www / py-hyper / files / patch-setup.py
1 --- setup.py.orig       2015-10-28 10:21:14 UTC
2 +++ setup.py
3 @@ -7,6 +7,7 @@ import sys
4  
5  try:
6      from setuptools import setup
7 +    from setuptools.command.test import test as TestCommand
8  except ImportError:
9      from distutils.core import setup
10  
11 @@ -48,6 +49,24 @@ def resolve_install_requires():
12          return deps
13      return []
14  
15 +class PyTest(TestCommand):
16 +    user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
17 +
18 +    def initialize_options(self):
19 +        TestCommand.initialize_options(self)
20 +        self.pytest_args = []
21 +
22 +    def finalize_options(self):
23 +        TestCommand.finalize_options(self)
24 +        self.test_args = []
25 +        self.test_suite = True
26 +
27 +    def run_tests(self):
28 +        #import here, cause outside the eggs aren't loaded
29 +        import pytest
30 +        errno = pytest.main(self.pytest_args)
31 +        sys.exit(errno)
32 +
33  packages = [
34      'hyper',
35      'hyper.http20',
36 @@ -90,5 +109,7 @@ setup(
37      },
38      extras_require={
39          'fast': ['pycohttpparser'],
40 -    }
41 +    },
42 +    tests_require=['pytest'],
43 +    cmdclass = {'test': PyTest},
44  )