Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/aiida/cmdline/commands/cmd_verdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@

from aiida import __version__

from ..groups import VerdiCommandGroup
from ..params import options, types
from ..utils.pluginable import Pluginable


# Pass the version explicitly to ``version_option`` otherwise editable installs can show the wrong version number
@click.group(cls=VerdiCommandGroup, context_settings={'help_option_names': ['--help', '-h']})
@click.group(
cls=Pluginable, entry_point_group='aiida.cmdline.verdi', context_settings={'help_option_names': ['--help', '-h']}
)
@options.PROFILE(type=types.ProfileParamType(load_profile=True), expose_value=False)
@options.VERBOSITY()
@click.version_option(__version__, package_name='aiida_core', message='AiiDA version %(version)s')
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/utils/pluginable.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def list_commands(self, ctx):
if not self._exclude_external_plugins:
subcommands.extend(get_entry_point_names(self._entry_point_group))

return subcommands
return sorted(subcommands)

def get_command(self, ctx, name):
"""Try to load a subcommand from entry points, else defer to super."""
Expand Down
1 change: 1 addition & 0 deletions src/aiida/plugins/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ class EntryPointFormat(enum.Enum):
'aiida.cmdline.computer.configure': 'aiida.cmdline.computer.configure',
'aiida.cmdline.data': 'aiida.cmdline.data',
'aiida.cmdline.data.structure.import': 'aiida.cmdline.data.structure.import',
'aiida.cmdline.verdi': 'aiida.cmdline.verdi',
'aiida.data': 'aiida.orm.nodes.data',
'aiida.groups': 'aiida.orm.groups',
'aiida.orm': 'aiida.orm',
Expand Down
3 changes: 1 addition & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,7 @@ def run_cli_command_runner(command, parameters, user_input, initialize_ctx_obj,
"""Run CLI command through ``click.testing.CliRunner``."""
from click.testing import CliRunner

from aiida.cmdline.commands.cmd_verdi import VerdiCommandGroup
from aiida.cmdline.groups.verdi import LazyVerdiObjAttributeDict
from aiida.cmdline.groups.verdi import LazyVerdiObjAttributeDict, VerdiCommandGroup

if initialize_ctx_obj:
config = get_config()
Expand Down