Skip to content
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

dependencies update: pre-commit formatting #48

Merged
merged 1 commit into from
Jul 31, 2024
Merged
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
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@ ci:
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.7.0
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py39-plus]

- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.4.2
hooks:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.275
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.0
hooks:
- id: ruff

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.4.1
rev: v1.10.1
hooks:
- id: mypy
files: ^(aiida_firecrest/.*py)$
Expand Down
1 change: 1 addition & 0 deletions aiida_firecrest/scheduler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Scheduler interface."""

from __future__ import annotations

import datetime
Expand Down
15 changes: 7 additions & 8 deletions aiida_firecrest/transport.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Transport interface."""

from __future__ import annotations

from contextlib import suppress
Expand Down Expand Up @@ -27,7 +28,9 @@ class ValidAuthOption(TypedDict, total=False):
switch: bool # whether the option is a boolean flag
type: type[Any] | ParamType
default: Any
non_interactive_default: bool # whether option should provide a default in non-interactive mode
non_interactive_default: (
bool # whether option should provide a default in non-interactive mode
)
prompt: str # for interactive CLI
help: str
callback: Callable[..., Any] # for validation
Expand Down Expand Up @@ -427,7 +430,7 @@ def get_description(cls) -> str:
[f" {k}: {v.get('help', '')}" for k, v in cls.auth_options.items()]
)

def open(self) -> None: # noqa: A003
def open(self) -> None:
"""Open the transport.
This is a no-op for the REST-API, as there is no connection to open.
"""
Expand Down Expand Up @@ -977,14 +980,10 @@ def payoff(self, path: str | FcPath | Path) -> bool:
if self.payoff_override is not None:
return bool(self.payoff_override)

if (
return (
isinstance(path, FcPath)
and len(self.listdir(str(path), recursive=True)) > 3
):
return True
if isinstance(path, Path) and len(os.listdir(path)) > 3:
return True
return False
) or (isinstance(path, Path) and len(os.listdir(path)) > 3)

def _puttreetar(
self,
Expand Down
2 changes: 1 addition & 1 deletion aiida_firecrest/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
yield
except HeaderException as exc:
for header in exc.responses[-1].headers:
c = converters.get(header, None)
c = converters.get(header)

Check warning on line 68 in aiida_firecrest/utils.py

View check run for this annotation

Codecov / codecov/patch

aiida_firecrest/utils.py#L68

Added line #L68 was not covered by tests
if c is not None:
raise c(data) from exc
raise
Expand Down
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Pytest configuration that must be at the root level."""

pytest_plugins = ["aiida.manage.tests.pytest_fixtures"]


Expand Down
1 change: 1 addition & 0 deletions firecrest_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
This code is not tested, with anything above version "v1.13.0" of FirecREST, and it's not maintained.
See also https://github.com/aiidateam/aiida-firecrest/issues/47
"""

from __future__ import annotations

from argparse import ArgumentParser
Expand Down
1 change: 1 addition & 0 deletions tests/test_calculation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test for running calculations on a FireCREST computer."""

from pathlib import Path

from aiida import common, engine, manage, orm
Expand Down
Loading