diff --git a/setup.py b/setup.py index f283b4c47..0796c07d0 100644 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ "multimethod>=2.1,<3.0", "nlopt>=2.9.0,<3.0", "runtype", - "casadi", + "casadi<3.8", "trame", "trame-vtk", "trame-components", diff --git a/tests/test_package_metadata.py b/tests/test_package_metadata.py new file mode 100644 index 000000000..af9c8aaf6 --- /dev/null +++ b/tests/test_package_metadata.py @@ -0,0 +1,24 @@ +from contextlib import chdir +from pathlib import Path +from runpy import run_path + +import setuptools + + +def test_pip_install_requires_excludes_crashing_casadi_nlopt_pair(monkeypatch): + root = Path(__file__).parents[1] + captured = {} + + def fake_setup(**kwargs): + captured.update(kwargs) + + monkeypatch.delenv("APPVEYOR", raising=False) + monkeypatch.delenv("CONDA_PREFIX", raising=False) + monkeypatch.delenv("CONDA_PY", raising=False) + monkeypatch.delenv("READTHEDOCS", raising=False) + monkeypatch.setattr(setuptools, "setup", fake_setup) + + with chdir(root): + run_path(str(root / "setup.py")) + + assert "casadi<3.8" in captured["install_requires"]