diff --git a/src/aiida/cmdline/commands/cmd_presto.py b/src/aiida/cmdline/commands/cmd_presto.py index d52f40bb34..9460dd154f 100644 --- a/src/aiida/cmdline/commands/cmd_presto.py +++ b/src/aiida/cmdline/commands/cmd_presto.py @@ -55,26 +55,8 @@ def default_profile_name(): show_default=True, help='The email of the default user.', ) -@click.option( - '--first-name', - default=get_config_option('autofill.user.first_name') or 'John', - show_default=True, - help='The first name of the default user.', -) -@click.option( - '--last-name', - default=get_config_option('autofill.user.last_name') or 'Doe', - show_default=True, - help='The last name of the default user.', -) -@click.option( - '--institution', - default=get_config_option('autofill.user.institution') or 'Unknown', - show_default=True, - help='The institution of the default user.', -) @click.pass_context -def verdi_presto(ctx, profile_name, email, first_name, last_name, institution): +def verdi_presto(ctx, profile_name, email): """Set up a new profile as automatically as possible. This command aims making setting up a new profile as easy as possible. It intentionally provides a limited amount of @@ -91,7 +73,7 @@ def verdi_presto(ctx, profile_name, email, first_name, last_name, institution): \b * Create a new profile that is set as the new default - * Create a default user for the profile (can be configured through options) + * Create a default user for the profile (email can be configured through options) * Set up the localhost as a `Computer` and configure it * Set a number of configuration options with sensible defaults @@ -117,9 +99,6 @@ def verdi_presto(ctx, profile_name, email, first_name, last_name, institution): ctx.obj.config, name=profile_name, email=email, - first_name=first_name, - last_name=last_name, - institution=institution, storage_backend=storage_backend, storage_config=storage_config, broker_backend=broker_backend, diff --git a/src/aiida/cmdline/commands/cmd_profile.py b/src/aiida/cmdline/commands/cmd_profile.py index e84a6aab4a..e95df78ed3 100644 --- a/src/aiida/cmdline/commands/cmd_profile.py +++ b/src/aiida/cmdline/commands/cmd_profile.py @@ -116,7 +116,7 @@ def profile_list(): echo.echo_report(f'configuration folder: {config.dirpath}') if not config.profiles: - echo.echo_warning('no profiles configured: run `verdi setup` to create one') + echo.echo_warning('no profiles configured: run `verdi presto` to create one') else: sort = lambda profile: profile.name # noqa: E731 highlight = lambda profile: profile.name == config.default_profile_name # noqa: E731 diff --git a/src/aiida/cmdline/commands/cmd_status.py b/src/aiida/cmdline/commands/cmd_status.py index 7317e334fc..dc4521af02 100644 --- a/src/aiida/cmdline/commands/cmd_status.py +++ b/src/aiida/cmdline/commands/cmd_status.py @@ -75,7 +75,10 @@ def verdi_status(print_traceback, no_rmq): if profile is None: print_status(ServiceStatus.WARNING, 'profile', 'no profile configured yet') - echo.echo_report('Configure a profile by running `verdi quicksetup` or `verdi setup`.') + echo.echo_report( + 'Run `verdi presto` to automatically setup a profile using all defaults or use `verdi profile setup` ' + 'for more control.' + ) return print_status(ServiceStatus.UP, 'profile', profile.name) diff --git a/tests/cmdline/commands/test_presto.py b/tests/cmdline/commands/test_presto.py index 61e3c60346..2369e68511 100644 --- a/tests/cmdline/commands/test_presto.py +++ b/tests/cmdline/commands/test_presto.py @@ -1,7 +1,7 @@ """Tests for ``verdi presto``.""" import pytest -from aiida.cmdline.commands.cmd_presto import default_profile_name +from aiida.cmdline.commands.cmd_presto import verdi_presto, default_profile_name from aiida.manage.configuration.config import Config @@ -16,10 +16,16 @@ ), ) def test_default_profile_name(monkeypatch, profile_names, expected): - """.""" + """Test the dynamic default profile function.""" def get_profile_names(self): return profile_names monkeypatch.setattr(Config, 'profile_names', property(get_profile_names)) assert default_profile_name() == expected + + +def test_presto(run_cli_command): + """Test the ``verdi presto``.""" + result = run_cli_command(verdi_presto, use_subprocess=False) + assert 'Created new profile `presto`.' in result.output