Skip to content

Commit

Permalink
Bump ruff to v0.8.0 (#6634)
Browse files Browse the repository at this point in the history
Most of the changes here come from a new rule RUF022.
Checks for `__all__` definitions that are not ordered
according to an "isort-style" sort.
  • Loading branch information
danielhollas authored Dec 2, 2024
1 parent dbdc36c commit 333992b
Show file tree
Hide file tree
Showing 62 changed files with 135 additions and 135 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ repos:
args: [--line-length=120, --fail-on-change]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.8.0
hooks:
- id: ruff-format
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/brokers/rabbitmq/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
if t.TYPE_CHECKING:
import requests

__all__ = ('RabbitmqManagementClient', 'ManagementApiConnectionError')
__all__ = ('ManagementApiConnectionError', 'RabbitmqManagementClient')


class ManagementApiConnectionError(AiidaException):
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/brokers/rabbitmq/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from . import defaults

__all__ = ('get_rmq_url', 'get_launch_queue_name', 'get_message_exchange_name', 'get_task_exchange_name')
__all__ = ('get_launch_queue_name', 'get_message_exchange_name', 'get_rmq_url', 'get_task_exchange_name')


def get_rmq_url(protocol=None, username=None, password=None, host=None, port=None, virtual_host=None, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/params/arguments/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
'NODE',
'NODES',
'OUTPUT_FILE',
'OverridableArgument',
'PROCESS',
'PROCESSES',
'PROFILE',
'PROFILES',
'USER',
'WORKFLOW',
'WORKFLOWS',
'OverridableArgument',
)

# fmt: on
16 changes: 8 additions & 8 deletions src/aiida/cmdline/params/arguments/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,29 @@
from .overridable import OverridableArgument

__all__ = (
'PROFILE',
'PROFILES',
'CALCULATION',
'CALCULATIONS',
'CODE',
'CODES',
'COMPUTER',
'COMPUTERS',
'DATUM',
'CONFIG_OPTION',
'DATA',
'DATUM',
'GROUP',
'GROUPS',
'INPUT_FILE',
'LABEL',
'NODE',
'NODES',
'OUTPUT_FILE',
'PROCESS',
'PROCESSES',
'PROFILE',
'PROFILES',
'USER',
'WORKFLOW',
'WORKFLOWS',
'INPUT_FILE',
'OUTPUT_FILE',
'LABEL',
'USER',
'CONFIG_OPTION',
)


Expand Down
8 changes: 4 additions & 4 deletions src/aiida/cmdline/params/options/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@
'COMPUTER',
'COMPUTERS',
'CONFIG_FILE',
'CallableDefaultOption',
'ConfigFileOption',
'DATA',
'DATUM',
'DB_BACKEND',
Expand Down Expand Up @@ -69,14 +67,12 @@
'INPUT_PLUGIN',
'LABEL',
'LIMIT',
'MultipleValueOption',
'NODE',
'NODES',
'NON_INTERACTIVE',
'OLDER_THAN',
'ORDER_BY',
'ORDER_DIRECTION',
'OverridableOption',
'PAST_DAYS',
'PAUSED',
'PORT',
Expand Down Expand Up @@ -108,6 +104,10 @@
'WAIT',
'WITH_ELEMENTS',
'WITH_ELEMENTS_EXCLUSIVE',
'CallableDefaultOption',
'ConfigFileOption',
'MultipleValueOption',
'OverridableOption',
'active_process_states',
'graph_traversal_rules',
'valid_calc_job_states',
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/params/options/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@
'ORDER_BY',
'ORDER_DIRECTION',
'OVERWRITE',
'PATH',
'PAST_DAYS',
'PATH',
'PAUSED',
'PORT',
'PREPEND_TEXT',
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/params/types/computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from ...utils import decorators
from .identifier import IdentifierParamType

__all__ = ('ComputerParamType', 'ShebangParamType', 'MpirunCommandParamType')
__all__ = ('ComputerParamType', 'MpirunCommandParamType', 'ShebangParamType')


class ComputerParamType(IdentifierParamType):
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/params/types/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from click.types import StringParamType

__all__ = ('EmailType', 'EntryPointType', 'HostnameType', 'NonEmptyStringParamType', 'LabelStringType')
__all__ = ('EmailType', 'EntryPointType', 'HostnameType', 'LabelStringType', 'NonEmptyStringParamType')


class NonEmptyStringParamType(StringParamType):
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/cmdline/utils/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

DAEMON_NOT_RUNNING_DEFAULT_MESSAGE = 'daemon is not running'

__all__ = ('with_dbenv', 'dbenv', 'only_if_daemon_running')
__all__ = ('dbenv', 'only_if_daemon_running', 'with_dbenv')


@decorator
Expand Down
10 changes: 5 additions & 5 deletions src/aiida/cmdline/utils/echo.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
CMDLINE_LOGGER = logging.getLogger('verdi')

__all__ = (
'echo_report',
'echo_critical',
'echo_dictionary',
'echo_error',
'echo_info',
'echo_report',
'echo_success',
'echo_warning',
'echo_error',
'echo_critical',
'echo_tabulate',
'echo_dictionary',
'echo_warning',
)


Expand Down
2 changes: 1 addition & 1 deletion src/aiida/common/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

__all__ = (
'AIIDA_LOGGER',
'TQDM_BAR_FORMAT',
'AiidaException',
'AttributeDict',
'CalcInfo',
Expand Down Expand Up @@ -74,7 +75,6 @@
'StashMode',
'StorageMigrationError',
'StoringNotAllowed',
'TQDM_BAR_FORMAT',
'TestsNotAllowedError',
'TransportTaskException',
'UniquenessError',
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/common/datastructures.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from .extendeddicts import DefaultFieldsAttributeDict

__all__ = ('StashMode', 'CalcJobState', 'CalcInfo', 'CodeInfo', 'CodeRunMode')
__all__ = ('CalcInfo', 'CalcJobState', 'CodeInfo', 'CodeRunMode', 'StashMode')


class StashMode(Enum):
Expand Down
64 changes: 32 additions & 32 deletions src/aiida/common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,48 +10,48 @@

__all__ = (
'AiidaException',
'NotExistent',
'NotExistentAttributeError',
'NotExistentKeyError',
'MultipleObjectsError',
'RemoteOperationError',
'ClosedStorage',
'ConfigurationError',
'ConfigurationVersionError',
'ContentNotExistent',
'CorruptStorage',
'DbContentError',
'EntryPointError',
'FailedError',
'StoringNotAllowed',
'ModificationNotAllowed',
'FeatureDisabled',
'FeatureNotAvailable',
'HashingError',
'IncompatibleStorageSchema',
'InputValidationError',
'IntegrityError',
'UniquenessError',
'EntryPointError',
'MissingEntryPointError',
'MultipleEntryPointError',
'LoadingEntryPointError',
'InternalError',
'InvalidEntryPointTypeError',
'InvalidOperation',
'LicensingException',
'LoadingEntryPointError',
'LockedProfileError',
'LockingProfileError',
'MissingConfigurationError',
'MissingEntryPointError',
'ModificationNotAllowed',
'MultipleEntryPointError',
'MultipleObjectsError',
'NotExistent',
'NotExistentAttributeError',
'NotExistentKeyError',
'OutputParsingError',
'ParsingError',
'InternalError',
'PluginInternalError',
'ValidationError',
'ConfigurationError',
'ProfileConfigurationError',
'MissingConfigurationError',
'ConfigurationVersionError',
'IncompatibleStorageSchema',
'CorruptStorage',
'DbContentError',
'InputValidationError',
'FeatureNotAvailable',
'FeatureDisabled',
'LicensingException',
'RemoteOperationError',
'StorageBackupError',
'StorageMigrationError',
'StoringNotAllowed',
'TestsNotAllowedError',
'UnsupportedSpeciesError',
'TransportTaskException',
'OutputParsingError',
'HashingError',
'StorageMigrationError',
'StorageBackupError',
'LockedProfileError',
'LockingProfileError',
'ClosedStorage',
'UniquenessError',
'UnsupportedSpeciesError',
'ValidationError',
)


Expand Down
2 changes: 1 addition & 1 deletion src/aiida/common/extendeddicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from . import exceptions

__all__ = ('AttributeDict', 'FixedFieldsAttributeDict', 'DefaultFieldsAttributeDict')
__all__ = ('AttributeDict', 'DefaultFieldsAttributeDict', 'FixedFieldsAttributeDict')


class AttributeDict(dict):
Expand Down
8 changes: 4 additions & 4 deletions src/aiida/common/progress_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
from typing import Any, Callable, Optional, Type

__all__ = (
'get_progress_reporter',
'set_progress_reporter',
'set_progress_bar_tqdm',
'ProgressReporterAbstract',
'TQDM_BAR_FORMAT',
'ProgressReporterAbstract',
'create_callback',
'get_progress_reporter',
'set_progress_bar_tqdm',
'set_progress_reporter',
)

TQDM_BAR_FORMAT = '{desc:40.40}{percentage:6.1f}%|{bar}| {n_fmt}/{total_fmt}'
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from .utils import *

__all__ = (
'PORT_NAMESPACE_SEPARATOR',
'AiiDAPersister',
'Awaitable',
'AwaitableAction',
Expand All @@ -40,7 +41,6 @@
'JobsList',
'ObjectLoader',
'OutputPort',
'PORT_NAMESPACE_SEPARATOR',
'PastException',
'PortNamespace',
'Process',
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/engine/launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from .runners import ResultAndPk
from .utils import instantiate_process, is_process_scoped, prepare_inputs

__all__ = ('run', 'run_get_pk', 'run_get_node', 'submit', 'await_processes')
__all__ = ('await_processes', 'run', 'run_get_node', 'run_get_pk', 'submit')

TYPE_RUN_PROCESS = t.Union[Process, t.Type[Process], ProcessBuilder]
# run can also be process function, but it is not clear what type this should be
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/engine/processes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from .workchains import *

__all__ = (
'PORT_NAMESPACE_SEPARATOR',
'Awaitable',
'AwaitableAction',
'AwaitableTarget',
Expand All @@ -38,7 +39,6 @@
'JobManager',
'JobsList',
'OutputPort',
'PORT_NAMESPACE_SEPARATOR',
'PortNamespace',
'Process',
'ProcessBuilder',
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/engine/processes/calcjobs/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from aiida.engine.transports import TransportQueue
from aiida.schedulers.datastructures import JobInfo

__all__ = ('JobsList', 'JobManager')
__all__ = ('JobManager', 'JobsList')


class JobsList:
Expand Down
2 changes: 1 addition & 1 deletion src/aiida/engine/processes/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
if TYPE_CHECKING:
from .exit_code import ExitCode

__all__ = ('calcfunction', 'workfunction', 'FunctionProcess')
__all__ = ('FunctionProcess', 'calcfunction', 'workfunction')

LOGGER = logging.getLogger(__name__)

Expand Down
6 changes: 3 additions & 3 deletions src/aiida/engine/processes/ports.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
from aiida.orm import Data, Node, to_aiida_type

__all__ = (
'PortNamespace',
'PORT_NAMESPACE_SEPARATOR',
'CalcJobOutputPort',
'InputPort',
'OutputPort',
'CalcJobOutputPort',
'PortNamespace',
'WithNonDb',
'WithSerialize',
'PORT_NAMESPACE_SEPARATOR',
)

PORT_NAME_MAX_CONSECUTIVE_UNDERSCORES = 1
Expand Down
Loading

0 comments on commit 333992b

Please sign in to comment.