-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #431 from jGaboardi/pytest_setup
fixing conda-forge failure
- Loading branch information
Showing
1 changed file
with
9 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
|
@@ -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=[ | ||
|