Skip to content

Commit

Permalink
Deprecate: verdi code setup and CodeBuilder
Browse files Browse the repository at this point in the history
The CLI command is replaced with `verdi code create`. The `CodeBuilder`
is no longer necessary because code instances can now easily be created
through the constructor.
  • Loading branch information
sphuber committed May 18, 2022
1 parent a2f6d79 commit 37081e6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion aiida/cmdline/commands/cmd_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from aiida.cmdline.params import arguments, options
from aiida.cmdline.params.options.commands import code as options_code
from aiida.cmdline.utils import echo
from aiida.cmdline.utils.decorators import with_dbenv
from aiida.cmdline.utils.decorators import deprecated_command, with_dbenv
from aiida.common import exceptions


Expand Down Expand Up @@ -85,6 +85,7 @@ def set_code_builder(ctx, param, value):
@options.CONFIG_FILE()
@click.pass_context
@with_dbenv()
@deprecated_command('This command will be removed soon, use `verdi code create` instead.')
def setup_code(ctx, non_interactive, **kwargs):
"""Setup a new code."""
from aiida.orm.utils.builders.code import CodeBuilder
Expand Down
3 changes: 3 additions & 0 deletions aiida/orm/utils/builders/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@

from aiida.cmdline.utils.decorators import with_dbenv
from aiida.common.utils import ErrorAccumulator
from aiida.common.warnings import warn_deprecation
from aiida.orm import InstalledCode, PortableCode

warn_deprecation('This module is deprecated. To create a new code instance, simply use the constructor.', version=3)


class CodeBuilder:
"""Build a code with validation of attribute combinations"""
Expand Down

0 comments on commit 37081e6

Please sign in to comment.