diff --git a/clearml/backend_interface/task/task.py b/clearml/backend_interface/task/task.py index 6b7da1ab..cafbe409 100644 --- a/clearml/backend_interface/task/task.py +++ b/clearml/backend_interface/task/task.py @@ -2267,6 +2267,11 @@ class Task(IdObjectBase, AccessMixin, SetupUploadMixin): Alternatively, you can add all requirements from a file. Example: Task.add_requirements('/path/to/your/project/requirements.txt') + .. note:: + Task.add_requirements does not directly modify the task's requirements. Instead, it improves the accuracy + of capturing a task's Python packages. To explicitly change task requirements, use + Task.set_packages, which overwrites existing packages with the specified ones. + :param str package_name: The package name or path to a requirements file to add to the "Installed Packages" section of the task. :param package_version: The package version requirements. If ``None``, then use the installed version. diff --git a/clearml/task.py b/clearml/task.py index 501308af..08fb3a4e 100644 --- a/clearml/task.py +++ b/clearml/task.py @@ -1580,7 +1580,8 @@ class Task(_Task): def set_packages(self, packages): # type: (Union[str, Path, Sequence[str]]) -> () """ - Manually specify a list of required packages or a local requirements.txt file. + Manually specify a list of required packages or a local requirements.txt file. Note that this will + overwrite all existing packages. When running remotely this call is ignored