2
1

0001-Make-pytest-runner-a-conditional-requirement.patch 901 B

123456789101112131415161718192021222324252627282930
  1. From 38373d36094b5a708c595f8c560d14e8ab61aac6 Mon Sep 17 00:00:00 2001
  2. From: Yegor Yefremov <yegorslists@googlemail.com>
  3. Date: Fri, 8 Sep 2017 08:58:31 +0200
  4. Subject: [PATCH] Make pytest-runner a conditional requirement
  5. Check for pytest-runner only if setup.py was invoked with 'test'
  6. argument.
  7. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
  8. ---
  9. setup.py | 3 ++-
  10. 1 file changed, 2 insertions(+), 1 deletion(-)
  11. diff --git a/setup.py b/setup.py
  12. index 85d9c5f..10fb6df 100644
  13. --- a/setup.py
  14. +++ b/setup.py
  15. @@ -12,7 +12,8 @@ with open('README.rst', 'rb') as readme_file:
  16. requirements = []
  17. test_requirements = ['pytest', 'pylama']
  18. -setup_requirements = ['pytest-runner']
  19. +needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
  20. +setup_requirements = ['pytest-runner'] if needs_pytest else []
  21. if sys.version_info < (3, 0):
  22. test_requirements += ['mock']
  23. --
  24. 2.11.0