8000 Make it so the test-runner is only downloaded when running tests (#485) · SnarkyPapi/server-client-python@942dbd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 942dbd7

Browse files
t8y8dzucker-tab
authored andcommitted
Make it so the test-runner is only downloaded when running tests (tableau#485)
1 parent c5afbd6 commit 942dbd7

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

setup.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
import sys
12
import versioneer
3+
24
try:
35
from setuptools import setup
46
except ImportError:
57
from distutils.core import setup
68

9+
# Only install pytest and runner when test command is run
10+
# This makes work easier for offline installs or low bandwidth machines
11+
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
12+
pytest_runner = ['pytest-runner'] if needs_pytest else []
13+
714
setup(
815
name='tableauserverclient',
916
version=versioneer.get_version(),
@@ -16,9 +23,7 @@
1623
license='MIT',
1724
description='A Python module for working with the Tableau Server REST API.',
1825
test_suite='test',
19-
setup_requires=[
20-
'pytest-runner'
21-
],
26+
setup_requires=pytest_runner,
2227
install_requires=[
2328
'requests>=2.11,<3.0'
2429
],

0 commit comments

Comments
 (0)
0