Benjamin Schubert pushed to branch master at BuildStream / buildstream
Commits:
- 
b27b592a
by Benjamin Schubert at 2018-11-01T10:49:57Z
- 
89ace5d7
by Benjamin Schubert at 2018-11-01T11:16:36Z
1 changed file:
Changes:
| ... | ... | @@ -39,6 +39,7 @@ if sys.version_info[0] != REQUIRED_PYTHON_MAJOR or sys.version_info[1] < REQUIRE | 
| 39 | 39 |  try:
 | 
| 40 | 40 |      from setuptools import setup, find_packages, Command
 | 
| 41 | 41 |      from setuptools.command.easy_install import ScriptWriter
 | 
| 42 | +    from setuptools.command.test import test as TestCommand
 | |
| 42 | 43 |  except ImportError:
 | 
| 43 | 44 |      print("BuildStream requires setuptools in order to build. Install it using"
 | 
| 44 | 45 |            " your package manager (usually python3-setuptools) or via pip (pip3"
 | 
| ... | ... | @@ -219,9 +220,48 @@ class BuildGRPC(Command): | 
| 219 | 220 |                          f.write(code)
 | 
| 220 | 221 |  | 
| 221 | 222 |  | 
| 223 | +#####################################################
 | |
| 224 | +#                   Pytest command                  #
 | |
| 225 | +#####################################################
 | |
| 226 | +class PyTest(TestCommand):
 | |
| 227 | +    """Defines a pytest command class to run tests from setup.py"""
 | |
| 228 | + | |
| 229 | +    user_options = TestCommand.user_options + [
 | |
| 230 | +        ("addopts=", None, "Arguments to pass to pytest"),
 | |
| 231 | +        ('index-url=''build_grpc': BuildGRPC,
 | |
| 264 | +        'pytest': PyTest,
 | |
| 225 | 265 |      }
 | 
| 226 | 266 |      cmdclass.update(versioneer.get_cmdclass())
 | 
| 227 | 267 |      return cmdclass
 | 
| ... | ... | @@ -305,6 +345,5 @@ setup(name='BuildStream', | 
| 305 | 345 |            'grpcio >= 1.10',
 | 
| 306 | 346 |        ],
 | 
| 307 | 347 |        entry_points=bst_install_entry_points,
 | 
| 308 | -      setup_requires=['pytest-runner'],
 | |
| 309 | 348 |        tests_require=dev_requires,
 | 
| 310 | 349 |        zip_safe=False) | 
