From 9ae18a3d2e9cbf770d471c755896a70eae84da38 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Mon, 24 Feb 2020 11:52:02 -0500 Subject: [PATCH 1/2] fixing conda-forge failure --- setup.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 42e5cd42..05b2ddbb 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,12 @@ package = "spaghetti" +# This check resolves conda-forge build failures +# See the link below for original solution +# https://github.com/pydata/xarray/pull/2643/files#diff-2eeaed663bd0d25b7e608891384b7298R29-R30 +needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv) +setup_requires = ["pytest-runner"] if needs_pytest else [] + # Get __version__ from package/__init__.py with open(package + "/__init__.py", "r") as f: exec(f.readline()) @@ -66,7 +72,7 @@ def setup_package(): download_url="https://pypi.org/project/" + package, maintainer="James D. Gaboardi", maintainer_email="jgaboardi@gmail.com", - setup_requires=["pytest-runner"], + setup_requires=setup_requires, tests_require=["pytest"], keywords="spatial statistics, networks, graphs", classifiers=[ From 324f27d6e66d9049c32d02d34e833dadfe3c3e82 Mon Sep 17 00:00:00 2001 From: James Gaboardi Date: Mon, 24 Feb 2020 11:59:15 -0500 Subject: [PATCH 2/2] adding sys import --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 05b2ddbb..7869b133 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ -from setuptools import setup from distutils.command.build_py import build_py - +from setuptools import setup +import sys package = "spaghetti"