From 633a8a67b215f1a4f85a62410a1fe6bc6b01898c Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 4 Mar 2019 10:28:06 -0500 Subject: [PATCH] conditional install --- setup.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index dd6ec8d7..6d611b59 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,15 @@ import os +import sys import setuptools import versioneer short_description = "QCElemental is a resource module for quantum chemistry containing physical" "constants and periodic table data from NIST and molecule handlers." +# from https://github.com/pytest-dev/pytest-runner#conditional-requirement +needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv) +pytest_runner = ['pytest-runner'] if needs_pytest else [] + try: with open("README.md", "r") as handle: long_description = handle.read() @@ -24,9 +29,7 @@ packages=setuptools.find_packages(exclude=['*checkup*']), include_package_data=True, package_data={'': [os.path.join('qcelemental', 'data', '*.json')]}, - setup_requires=[ - 'pytest-runner' - ], + setup_requires=[] + pytest_runner, install_requires=[ 'numpy', 'pint',