diff --git a/.test-conda-env-py3.yml b/.test-conda-env-py3.yml index a53d2c220b3ff0f3fe936d3ecfa59c7465281072..d5e01eadd507ed75edf704a20147160d801b65e2 100644 --- a/.test-conda-env-py3.yml +++ b/.test-conda-env-py3.yml @@ -12,5 +12,6 @@ dependencies: - islpy - pyopencl - python=3.5 -- python-symengine=0.3.0 +- symengine::symengine=0.3.0 +- symengine::python-symengine=0.3.0 # things not in here: loopy boxtree pymbolic pyfmmlib diff --git a/sumpy/symbolic.py b/sumpy/symbolic.py index 665aff9d80b6fb9f5ae0e67770a361110db36210..49fa405929ed713579b27e2b52d6af2493da482b 100644 --- a/sumpy/symbolic.py +++ b/sumpy/symbolic.py @@ -42,8 +42,9 @@ def _find_symbolic_backend(): try: import symengine # noqa symengine_found = True - except ImportError: + except ImportError as import_error: symengine_found = False + symengine_error = import_error ALLOWED_BACKENDS = ("sympy", "symengine") # noqa BACKEND_ENV_VAR = "SUMPY_FORCE_SYMBOLIC_BACKEND" # noqa @@ -60,11 +61,9 @@ def _find_symbolic_backend(): ", ".join("'%s'" % val for val in ALLOWED_BACKENDS))) if backend == "symengine" and not symengine_found: - from warnings import warn - warn("%s=symengine was specified, but could not find symengine. " - "Using sympy." % BACKEND_ENV_VAR, RuntimeWarning) + raise RuntimeError("could not find SymEngine: %s" % symengine_error) - USE_SYMENGINE = backend == "symengine" and symengine_found + USE_SYMENGINE = True else: USE_SYMENGINE = symengine_found