-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use Ruff #566
Use Ruff #566
Changes from all commits
2ef45c8
fd258cd
2ab4a36
ff609e4
a834bd5
fe7f3b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ def find_installed_packages(python_bin: str | None = None) -> dict[str, str]: | |
[python_bin, "-m", "pip", "list", "--format=json"], | ||
encoding="utf-8", | ||
capture_output=True, | ||
check=True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a change in behaviour. We had implicitly Now instead |
||
).stdout | ||
|
||
return {package["name"]: package["version"] for package in json.loads(output)} | ||
|
@@ -160,7 +161,7 @@ def install_create_github_issue_exception_handler(output, url, labels=None): | |
display(welcome_message, app_with_work_chain_selector, footer) | ||
|
||
""" | ||
global _ORIGINAL_EXCEPTION_HANDLER | ||
global _ORIGINAL_EXCEPTION_HANDLER # noqa | ||
|
||
if labels is None: | ||
labels = [] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -376,7 +376,7 @@ def _ssh_keygen(self): | |
"", | ||
] | ||
if not fpath.exists(): | ||
subprocess.run(keygen_cmd, capture_output=True) | ||
subprocess.run(keygen_cmd, capture_output=True, check=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto, we were not checking that the command ran correctly. Now we at least fail loudly. |
||
|
||
def _can_login(self): | ||
"""Check if it is possible to login into the remote host.""" | ||
|
@@ -1028,6 +1028,7 @@ def test(self, _=None): | |
process_result = subprocess.run( | ||
["verdi", "computer", "test", "--print-traceback", self.label.value], | ||
capture_output=True, | ||
check=False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No functional change here, since we check the return code below. |
||
) | ||
|
||
if process_result.returncode == 0: | ||
|
@@ -1602,7 +1603,7 @@ def __init__( | |
enable_detailed_setup=True, | ||
): | ||
if not any((enable_detailed_setup, enable_quick_setup)): | ||
raise ValueError( # noqa | ||
raise ValueError( | ||
"At least one of `enable_quick_setup` and `enable_detailed_setup` should be True." | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,8 +152,8 @@ class :class:`aiidalab_widgets_base.structures.StructureManagerWidget`. | |
|
||
def __init__( | ||
self, | ||
embedded: bool = True, | ||
title: str = None, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This type was not correct (missing Optional). We're currently not doing any actual typechecking so it's better to just remove it, wrong types are worse than no types. |
||
embedded=True, | ||
title=None, | ||
**kwargs, | ||
) -> None: | ||
try: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not activate these two in ruff. We do not use logging in AWB and the flake8-debugger seems rather niche.