summaryrefslogtreecommitdiffstats
path: root/package/python-paho-mqtt/0001-Make-pytest-runner-a-conditional-requirement.patch
blob: b2fbe246cb88bf2e193abd462c3fca665d4d6c0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From 38373d36094b5a708c595f8c560d14e8ab61aac6 Mon Sep 17 00:00:00 2001
From: Yegor Yefremov <yegorslists@googlemail.com>
Date: Fri, 8 Sep 2017 08:58:31 +0200
Subject: [PATCH] Make pytest-runner a conditional requirement

Check for pytest-runner only if setup.py was invoked with 'test'
argument.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 setup.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/setup.py b/setup.py
index 85d9c5f..10fb6df 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,8 @@ with open('README.rst', 'rb') as readme_file:
 
 requirements = []
 test_requirements = ['pytest', 'pylama']
-setup_requirements = ['pytest-runner']
+needs_pytest = set(['pytest', 'test', 'ptr']).intersection(sys.argv)
+setup_requirements = ['pytest-runner'] if needs_pytest else []
 
 if sys.version_info < (3, 0):
     test_requirements += ['mock']
-- 
2.11.0

OpenPOWER on IntegriCloud