Skip to content

Commit

Permalink
Devops: Update pre-commit requirement ruff==0.3.5 (#6339)
Browse files Browse the repository at this point in the history
  • Loading branch information
sphuber authored Apr 2, 2024
1 parent 6898ff4 commit acd5454
Show file tree
Hide file tree
Showing 717 changed files with 834 additions and 246 deletions.
1 change: 1 addition & 0 deletions .github/system_tests/test_containerized_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Test running a :class:`~aiida.orm.nodes.data.codes.containerized.ContainerizedCode` code."""

from aiida import orm
from aiida.engine import run_get_node

Expand Down
1 change: 1 addition & 0 deletions .github/system_tests/test_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Tests to run with a running daemon."""

import os
import re
import shutil
Expand Down
1 change: 1 addition & 0 deletions .github/system_tests/workchains.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Work chain implementations for testing purposes."""

from aiida.common import AttributeDict
from aiida.engine import (
BaseRestartWorkChain,
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/check_release_tag.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Check that the GitHub release tag matches the package version."""

import argparse
import ast
from pathlib import Path
Expand Down
1 change: 1 addition & 0 deletions .molecule/default/files/polish/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Command line interface to dynamically create and run a WorkChain that can evaluate a reversed polish expression."""

import importlib
import sys
import time
Expand Down
1 change: 1 addition & 0 deletions .molecule/default/files/polish/lib/expression.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Functions to dynamically generate reversed polish notation expressions."""

import collections
import operator as operators
import random
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ repos:
args: [--line-length=120, --fail-on-change]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
rev: v0.3.5
hooks:
- id: ruff-format
exclude: &exclude_ruff >
Expand Down
6 changes: 3 additions & 3 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,9 @@ def run_apidoc(_):

# See https://stackoverflow.com/a/30144019
env = os.environ.copy()
env[
'SPHINX_APIDOC_OPTIONS'
] = 'members,special-members,private-members,undoc-members,show-inheritance,ignore-module-all'
env['SPHINX_APIDOC_OPTIONS'] = (
'members,special-members,private-members,undoc-members,show-inheritance,ignore-module-all'
)
subprocess.check_call([cmd_path] + cli_options, env=env)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
"""Script to benchmark the performance of the AiiDA workflow engine on a given installation."""

import click
from aiida.cmdline.params import options
from aiida.cmdline.utils import decorators, echo
Expand Down
1 change: 1 addition & 0 deletions docs/source/howto/include/snippets/extend_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
###########################################################################
# start-marker for docs
"""Code snippets for the "How to extend workflows" section."""

from aiida.engine import ToContext, WorkChain, calcfunction
from aiida.orm import AbstractCode, Bool, Int
from aiida.plugins.factories import CalculationFactory
Expand Down
1 change: 1 addition & 0 deletions docs/source/howto/include/snippets/plugins/launch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Launch a calculation using the 'diff-tutorial' plugin"""

from pathlib import Path

from aiida import engine, orm
Expand Down
1 change: 1 addition & 0 deletions docs/source/topics/include/scheduler_template.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Template for a scheduler plugin."""

import logging

from aiida.common import exceptions
Expand Down
10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ testpaths = [
xfail_strict = true

[tool.ruff]
line-length = 120

[tool.ruff.format]
quote-style = 'single'

[tool.ruff.lint]
ignore = [
'F403', # Star imports unable to detect undefined names
'F405', # Import may be undefined or defined from star imports
Expand All @@ -389,7 +395,6 @@ ignore = [
'RUF005', # Consider iterable unpacking instead of concatenation
'RUF012' # Mutable class attributes should be annotated with `typing.ClassVar`
]
line-length = 120
select = [
'E', # pydocstyle
'W', # pydocstyle
Expand All @@ -403,9 +408,6 @@ select = [
'RUF' # ruff
]

[tool.ruff.format]
quote-style = 'single'

[tool.tox]
legacy_tox_ini = """
[tox]
Expand Down
1 change: 1 addition & 0 deletions src/aiida/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
More information at http://www.aiida.net
"""

from aiida.common.log import configure_logging # noqa: F401
from aiida.manage.configuration import get_config_option, get_profile, load_profile, profile_context # noqa: F401

Expand Down
1 change: 1 addition & 0 deletions src/aiida/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Expose the AiiDA CLI, for usage as `python -m aiida`"""

import sys

if __name__ == '__main__':
Expand Down
1 change: 1 addition & 0 deletions src/aiida/brokers/broker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Interface for a message broker that facilitates communication with and between process runners."""

import abc
import typing as t

Expand Down
1 change: 1 addition & 0 deletions src/aiida/brokers/rabbitmq/broker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Implementation of the message broker interface using RabbitMQ through ``kiwipy``."""

from __future__ import annotations

import functools
Expand Down
1 change: 1 addition & 0 deletions src/aiida/brokers/rabbitmq/client.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Client for RabbitMQ Management HTTP API."""

from __future__ import annotations

import typing as t
Expand Down
1 change: 1 addition & 0 deletions src/aiida/brokers/rabbitmq/defaults.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defaults related to RabbitMQ."""

from aiida.common.extendeddicts import AttributeDict

__all__ = ('BROKER_DEFAULTS',)
Expand Down
1 change: 1 addition & 0 deletions src/aiida/calculations/arithmetic/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`CalcJob` implementation to add two numbers using bash for testing and demonstration purposes."""

from aiida import orm
from aiida.common.datastructures import CalcInfo, CodeInfo
from aiida.common.folders import Folder
Expand Down
1 change: 1 addition & 0 deletions src/aiida/calculations/diff_tutorial/calculations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Register calculations via the "aiida.calculations" entry point in the pyproject.toml file.
"""

from aiida.common import datastructures
from aiida.engine import CalcJob
from aiida.orm import SinglefileData
Expand Down
1 change: 1 addition & 0 deletions src/aiida/calculations/importers/arithmetic/add.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Importer for the :class:`aiida.calculations.arithmetic.add.ArithmeticAddCalculation` plugin."""

from pathlib import Path
from re import match
from tempfile import NamedTemporaryFile
Expand Down
1 change: 1 addition & 0 deletions src/aiida/calculations/monitors/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Monitors for the :class:`aiida.calculations.arithmetic.add.ArithmeticAddCalculation` plugin."""

from __future__ import annotations

import tempfile
Expand Down
1 change: 1 addition & 0 deletions src/aiida/calculations/templatereplacer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""Generic `CalcJob` implementation where input file is a parametrized template file."""

import io

from aiida import orm
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
The commands need to be imported here for them to be registered with the top-level command group.
"""

from aiida.cmdline.commands import (
cmd_archive,
cmd_calcjob,
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi archive` command."""

import logging
import traceback
from enum import Enum
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_calcjob.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi calcjob` commands."""

import os

import click
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi code` command."""

from collections import defaultdict
from functools import partial

Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_computer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi computer` command."""

from copy import deepcopy
from functools import partial
from math import isclose
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi config` command."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi daemon` commands."""

from __future__ import annotations

import subprocess
Expand Down
3 changes: 1 addition & 2 deletions src/aiida/cmdline/commands/cmd_data/cmd_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
"""This module provides export functionality to all data types
"""
"""This module provides export functionality to all data types"""

import click

Expand Down
3 changes: 1 addition & 2 deletions src/aiida/cmdline/commands/cmd_data/cmd_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
"""This module provides list functionality to all data types.
"""
"""This module provides list functionality to all data types."""

from aiida.cmdline.params import options

Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_data/cmd_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi data core.remote` command."""

import stat

import click
Expand Down
4 changes: 2 additions & 2 deletions src/aiida/cmdline/commands/cmd_data/cmd_show.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
"""This allows to manage showfunctionality to all data types.
"""
"""This allows to manage showfunctionality to all data types."""

import pathlib

from aiida.cmdline.utils import echo
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_devel.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi devel` commands."""

import sys

import click
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi group` commands"""

import click

from aiida.cmdline.commands.cmd_verdi import verdi
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi node` command."""

import datetime
import pathlib

Expand Down
3 changes: 2 additions & 1 deletion src/aiida/cmdline/commands/cmd_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi process` command."""

import click

from aiida.cmdline.commands.cmd_verdi import verdi
Expand Down Expand Up @@ -128,7 +129,7 @@ def process_list(
echo.echo(f'\nTotal results: {len(projected)}\n')

if 'cached' in project:
echo.echo_report('\u267B Processes marked with check-mark were not run but taken from the cache.')
echo.echo_report('\u267b Processes marked with check-mark were not run but taken from the cache.')
echo.echo_report('Add the option `-P pk cached_from` to the command to display cache source.')

print_last_process_state_change()
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi profile` command."""

from __future__ import annotations

import click
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_rabbitmq.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi devel rabbitmq` commands."""

from __future__ import annotations

import re
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi run` command."""

import contextlib
import pathlib
import sys
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""The `verdi setup` and `verdi quicksetup` commands."""

import click

from aiida.cmdline.commands.cmd_verdi import verdi
Expand Down
3 changes: 2 additions & 1 deletion src/aiida/cmdline/commands/cmd_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi status` command."""

import enum
import sys

Expand Down Expand Up @@ -42,7 +43,7 @@ class ServiceStatus(enum.IntEnum):
},
ServiceStatus.WARNING: {
'color': 'yellow',
'string': '\u23FA',
'string': '\u23fa',
},
ServiceStatus.DOWN: {
'color': 'red',
Expand Down
1 change: 1 addition & 0 deletions src/aiida/cmdline/commands/cmd_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# For further information please visit http://www.aiida.net #
###########################################################################
"""`verdi storage` commands."""

import click
from click_spinner import spinner

Expand Down
Loading

0 comments on commit acd5454

Please sign in to comment.