Skip to content

Commit 29c52d5

Browse files
committed
Allow numpy absence from SBML dependencies in setup script
1 parent 466a4f7 commit 29c52d5

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

utils/install_from_requirements.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
PYTHON_CMD, CONDA_CMD, _is_win)
1212

1313

14+
class DependencyNotFound(BaseException):
15+
r"""Exception raised when a dependency cannot be located."""
16+
pass
17+
18+
1419
def isolate_package_name(entry):
1520
r"""Get the package name without any constraints or conditions.
1621
@@ -65,7 +70,7 @@ def get_pip_dependency_version(pkg, dep):
6570
if m.group('ver'):
6671
ver = m.group('ver').strip()
6772
return dep + ver
68-
raise RuntimeError(
73+
raise DependencyNotFound(
6974
("Could not locate the dependency '%s' "
7075
"in the list of requirements for package '%s': %s")
7176
% (dep, pkg, reqs))

utils/setup_test_env.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,8 @@ def itemize_deps(method, for_development=False,
552552
used.
553553
554554
"""
555-
from install_from_requirements import get_pip_dependency_version
555+
from install_from_requirements import (
556+
get_pip_dependency_version, DependencyNotFound)
556557
out = {'conda': [], 'pip': [], 'os': [], 'skip': [],
557558
'apt': [], 'brew': [], 'choco': [], 'vcpkg': [],
558559
'requirements': ['requirements_optional.txt'],
@@ -693,7 +694,7 @@ def itemize_deps(method, for_development=False,
693694
"conda if a conda environment is being used to avoid "
694695
"inconsistencies)." % new_numpy_ver)
695696
numpy_ver = new_numpy_ver
696-
except (ImportError, ModuleNotFoundError):
697+
except (ImportError, ModuleNotFoundError, DependencyNotFound):
697698
pass
698699
out['conda'].insert(0, numpy_ver.replace('==', '>='))
699700
out['skip'].append('libroadrunner')

0 commit comments

Comments
 (0)