Skip to content

Commit

Permalink
Merge pull request #431 from jGaboardi/pytest_setup
Browse files Browse the repository at this point in the history
fixing conda-forge failure
  • Loading branch information
jGaboardi authored Feb 24, 2020
2 parents 2d4cf7a + 324f27d commit 325ceac
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
from setuptools import setup
from distutils.command.build_py import build_py

from setuptools import setup
import sys

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())
Expand Down Expand Up @@ -66,7 +72,7 @@ def setup_package():
download_url="https://pypi.org/project/" + package,
maintainer="James D. Gaboardi",
maintainer_email="[email protected]",
setup_requires=["pytest-runner"],
setup_requires=setup_requires,
tests_require=["pytest"],
keywords="spatial statistics, networks, graphs",
classifiers=[
Expand Down

0 comments on commit 325ceac

Please sign in to comment.