From 033d45abc34123506bfa19b686b59a2d834c96a6 Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 4 Mar 2019 10:18:00 -0500 Subject: [PATCH 1/2] make `python setup.py test` work --- setup.cfg | 3 +++ setup.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/setup.cfg b/setup.cfg index bd211cf9..a91e5570 100644 --- a/setup.cfg +++ b/setup.cfg @@ -27,3 +27,6 @@ style = pep440 versionfile_source = qcelemental/_version.py versionfile_build = qcelemental/_version.py tag_prefix = '' + +[aliases] +test=pytest diff --git a/setup.py b/setup.py index 87f2c9b6..dd6ec8d7 100644 --- a/setup.py +++ b/setup.py @@ -24,6 +24,9 @@ packages=setuptools.find_packages(exclude=['*checkup*']), include_package_data=True, package_data={'': [os.path.join('qcelemental', 'data', '*.json')]}, + setup_requires=[ + 'pytest-runner' + ], install_requires=[ 'numpy', 'pint', From 633a8a67b215f1a4f85a62410a1fe6bc6b01898c Mon Sep 17 00:00:00 2001 From: "Lori A. Burns" Date: Mon, 4 Mar 2019 10:28:06 -0500 Subject: [PATCH 2/2] 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',