From 397a714b60833149713c5c2cdf52e17afe3e567c Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Wed, 20 Dec 2023 17:51:00 +0100 Subject: [PATCH] `DynamicEntryPointCommandGroup`: Temporarily silence deprecation warning (#6232) The `AbstractCode` and its subclasses have not yet migrated to using `pydantic` instead of `_get_cli_options()` and therefore running the `verdi code create` command would emit the deprecation warning. The warning is temporarily silenced until the code has also been migrated. --- aiida/cmdline/groups/dynamic.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/aiida/cmdline/groups/dynamic.py b/aiida/cmdline/groups/dynamic.py index f9bd38f067..475dbfb48f 100644 --- a/aiida/cmdline/groups/dynamic.py +++ b/aiida/cmdline/groups/dynamic.py @@ -130,12 +130,14 @@ def list_options(self, entry_point: str) -> list: cls = self.factory(entry_point) if not hasattr(cls, 'Configuration'): - from aiida.common.warnings import warn_deprecation - warn_deprecation( - 'Relying on `_get_cli_options` is deprecated. The options should be defined through a ' - '`pydantic.BaseModel` that should be assigned to the `Config` class attribute.', - version=3 - ) + # This should be enabled once the ``Code`` classes are migrated to using pydantic to define their model. + # See https://github.com/aiidateam/aiida-core/pull/6190 + # from aiida.common.warnings import warn_deprecation + # warn_deprecation( + # 'Relying on `_get_cli_options` is deprecated. The options should be defined through a ' + # '`pydantic.BaseModel` that should be assigned to the `Config` class attribute.', + # version=3 + # ) options_spec = self.factory(entry_point).get_cli_options() # type: ignore[union-attr] else: