diff --git a/parsl/providers/cobalt/cobalt.py b/parsl/providers/cobalt/cobalt.py index 98b6c51e03..308ff98ced 100644 --- a/parsl/providers/cobalt/cobalt.py +++ b/parsl/providers/cobalt/cobalt.py @@ -1,6 +1,7 @@ import logging import os import time +import warnings from parsl.providers.errors import ScaleOutFailed from parsl.channels import LocalChannel @@ -24,6 +25,8 @@ class CobaltProvider(ClusterProvider, RepresentationMixin): """ Cobalt Execution Provider + WARNING: CobaltProvider is deprecated and will be removed by 2024.04 + This provider uses cobalt to submit (qsub), obtain the status of (qstat), and cancel (qdel) jobs. Theo script to be used is created from a template file in this same module. @@ -86,6 +89,9 @@ def __init__(self, self.queue = queue self.scheduler_options = scheduler_options self.worker_init = worker_init + warnings.warn("CobaltProvider is deprecated; This will be removed after 2024-04", + DeprecationWarning, + stacklevel=2) def _status(self): """Returns the status list for a list of job_ids diff --git a/parsl/tests/test_providers/test_cobalt_deprecation_warning.py b/parsl/tests/test_providers/test_cobalt_deprecation_warning.py new file mode 100644 index 0000000000..0ae39439f3 --- /dev/null +++ b/parsl/tests/test_providers/test_cobalt_deprecation_warning.py @@ -0,0 +1,16 @@ +import warnings +import pytest +from parsl.providers import CobaltProvider + + +@pytest.mark.local +def test_deprecation_warning(): + + with warnings.catch_warnings(record=True) as w: + warnings.simplefilter("always") + + CobaltProvider() + + assert len(w) == 1 + assert issubclass(w[-1].category, DeprecationWarning) + assert "CobaltProvider" in str(w[-1].message)