diff --git a/modin/experimental/cloud/rayscale.py b/modin/experimental/cloud/rayscale.py index a7cb7799691..50ccd189050 100644 --- a/modin/experimental/cloud/rayscale.py +++ b/modin/experimental/cloud/rayscale.py @@ -167,6 +167,8 @@ def _conda_requirements(self): reqs.append(self._get_modin_version()) reqs.extend(self.add_conda_packages) + else: + reqs.append(self._get_modin_version()) # this is needed, for example, for dependencies that # looks like: "scikit-learn>=0.23" diff --git a/modin/experimental/cloud/test/test_cloud.py b/modin/experimental/cloud/test/test_cloud.py index 1d17f3ed746..15e9e878fc9 100644 --- a/modin/experimental/cloud/test/test_cloud.py +++ b/modin/experimental/cloud/test/test_cloud.py @@ -107,16 +107,25 @@ def test_create_or_update_cluster(make_ray_cluster, make_create_or_update_cluste r"""conda create --clone base --name modin --yes conda activate modin conda install --yes {{CONDA_PACKAGES}} - - pip install modin "ray==0.8.7" cloudpickle """ ], ) -def test_update_conda_requirements(setup_commands_source, make_ray_cluster): +@pytest.mark.parametrize( + "user_packages", + [ + ["scikit-learn>=0.23", "modin==0.8.0"], + None, + ], +) +def test_update_conda_requirements( + make_ray_cluster, + setup_commands_source, + user_packages, +): fake_version = namedtuple("FakeVersion", "major minor micro")(7, 12, 45) with mock.patch("sys.version_info", fake_version): setup_commands_result = make_ray_cluster( - ["scikit-learn>=0.23", "modin==0.8.0"] + user_packages )._update_conda_requirements(setup_commands_source) assert f"python>={fake_version.major}.{fake_version.minor}" in setup_commands_result @@ -124,6 +133,10 @@ def test_update_conda_requirements(setup_commands_source, make_ray_cluster): f"python<={fake_version.major}.{fake_version.minor}.{fake_version.micro}" in setup_commands_result ) - assert "scikit-learn>=0.23" in setup_commands_result - assert "modin==0.8.0" in setup_commands_result assert "{{CONDA_PACKAGES}}" not in setup_commands_result + + if user_packages: + for package in user_packages: + assert package in setup_commands_result + else: + assert "modin=" in setup_commands_result