Skip to content

Commit

Permalink
remove leftover use of Computer.name (#4681)
Browse files Browse the repository at this point in the history
Remove leftover use of deprecated Computer.name attribute in `verdi
computer list`.

Also update minimum version of click dependency to 7.1, since click 7.1
introduces additional whitespace in the verdi autodocs (running with 
click 7.0 locally resulted in pre-commit check failing on CI).

Co-authored-by: Chris Sewell <[email protected]>
  • Loading branch information
ltalirz and chrisjsewell authored Jan 27, 2021
1 parent 02ebeb8 commit cdb2e57
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions aiida/cmdline/commands/cmd_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,15 +338,15 @@ def computer_disable(computer, user):

@verdi_computer.command('list')
@options.ALL(help='Show also disabled or unconfigured computers.')
@options.RAW(help='Show only the computer names, one per line.')
@options.RAW(help='Show only the computer labels, one per line.')
@with_dbenv()
def computer_list(all_entries, raw):
"""List all available computers."""
from aiida.orm import Computer, User

if not raw:
echo.echo_info('List of configured computers')
echo.echo_info("Use 'verdi computer show COMPUTERNAME' to display more detailed information")
echo.echo_info("Use 'verdi computer show COMPUTERLABEL' to display more detailed information")

computers = Computer.objects.all()
user = User.objects.get_default()
Expand All @@ -357,7 +357,7 @@ def computer_list(all_entries, raw):
sort = lambda computer: computer.label
highlight = lambda comp: comp.is_user_configured(user) and comp.is_user_enabled(user)
hide = lambda comp: not (comp.is_user_configured(user) and comp.is_user_enabled(user)) and not all_entries
echo.echo_formatted_list(computers, ['name'], sort=sort, highlight=highlight, hide=hide)
echo.echo_formatted_list(computers, ['label'], sort=sort, highlight=highlight, hide=hide)


@verdi_computer.command('show')
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
- click-completion~=0.5.1
- click-config-file~=0.6.0
- click-spinner~=0.1.8
- click~=7.0
- click~=7.1
- dataclasses~=0.7
- django~=2.2
- ete3~=3.1
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-py-3.6.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
circus==0.17.1
Click==7.0
Click==7.1.2
click-completion==0.5.2
click-config-file==0.6.0
click-spinner==0.1.8
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-py-3.7.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
circus==0.17.1
Click==7.0
Click==7.1.2
click-completion==0.5.2
click-config-file==0.6.0
click-spinner==0.1.8
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements-py-3.8.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ certifi==2019.11.28
cffi==1.14.0
chardet==3.0.4
circus==0.17.1
Click==7.0
Click==7.1.2
click-completion==0.5.2
click-config-file==0.6.0
click-spinner==0.1.8
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"click-completion~=0.5.1",
"click-config-file~=0.6.0",
"click-spinner~=0.1.8",
"click~=7.0",
"click~=7.1",
"dataclasses~=0.7; python_version < '3.7.0'",
"django~=2.2",
"ete3~=3.1",
Expand Down

0 comments on commit cdb2e57

Please sign in to comment.