From 7eaa5705a2bd4f13b54416d4597b725d593ec36b Mon Sep 17 00:00:00 2001 From: Dmitry Sutyagin Date: Wed, 21 Sep 2016 17:26:01 +0300 Subject: [PATCH] Fix: require pytest-runner only for test command Change-Id: I62b82316745c362f1ecdf97e0f9029b7c136953e --- setup.py | 14 +++++++------- test-requirements.txt | 2 ++ tox.ini | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 2466e9f..e7c6a6b 100644 --- a/setup.py +++ b/setup.py @@ -17,15 +17,15 @@ from setuptools import setup -import os from timmy.env import project_name, version +import sys pname = project_name -include_package_data = True -if os.environ.get("READTHEDOCS", False): - rqfiles = None - include_package_data = False +if sys.argv[1] == 'test': + setup_requires = ['pytest-runner'] +else: + setup_requires = [] setup(name=pname, @@ -40,8 +40,8 @@ setup(name=pname, long_description=open('README.md').read(), packages=[pname, '%s_data' % pname], install_requires=['pyyaml'], - include_package_data=include_package_data, + include_package_data=True, entry_points={'console_scripts': ['%s=%s.cli:main' % (pname, pname)]}, - setup_requires=['pytest-runner'], + setup_requires=setup_requires, tests_require=['pytest'] ) diff --git a/test-requirements.txt b/test-requirements.txt index 1658360..947f880 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,3 +9,5 @@ testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD coverage>=3.6 # Apache-2.0 sphinx-argparse +pytest-runner +pytest diff --git a/tox.ini b/tox.ini index 2058a08..db333dd 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 2.0 -envlist = py34,py27,pypy,pep8 +envlist = py27,pypy,pep8 skipsdist = True [testenv]