Skip to content

Commit

Permalink
Update pre-commit hook charliermarsh/ruff-pre-commit to v0.8.0 (#772)
Browse files Browse the repository at this point in the history
* Update pre-commit hook charliermarsh/ruff-pre-commit to v0.8.0

* Fix rule codes for typing-only import checks in pyproject.toml

* Reorder exports in __all__ for consistency across modules

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Maximilien Le Clei <[email protected]>
  • Loading branch information
renovate[bot] and Maximilien Le Clei authored Nov 24, 2024
1 parent 220afed commit ca5c314
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repos:
- id: black-jupyter
args: [--config=pyproject.toml]
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.7.4
rev: v0.8.0
hooks:
# Linting for Python
- id: ruff
Expand Down
2 changes: 1 addition & 1 deletion cneuromax/fitting/deeplearning/datamodule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
Datasets,
)

__all__ = ["Datasets", "BaseDataModuleConfig", "BaseDataModule"]
__all__ = ["BaseDataModule", "BaseDataModuleConfig", "Datasets"]
2 changes: 1 addition & 1 deletion cneuromax/fitting/deeplearning/litmodule/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
BaseLitModuleConfig,
)

__all__ = ["BaseLitModuleConfig", "BaseLitModule"]
__all__ = ["BaseLitModule", "BaseLitModuleConfig"]
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
BaseClassificationLitModuleConfig,
)

__all__ = ["BaseClassificationLitModuleConfig", "BaseClassificationLitModule"]
__all__ = ["BaseClassificationLitModule", "BaseClassificationLitModuleConfig"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
""":class:`.BaseClassificationLitModule` & its config."""

from abc import ABC
from collections.abc import Callable # noqa: TCH003
from collections.abc import Callable # noqa: TC003
from dataclasses import dataclass
from typing import Annotated as An
from typing import Any
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
MLPConfig,
)

__all__ = ["MLPConfig", "MLP"]
__all__ = ["MLP", "MLPConfig"]
2 changes: 1 addition & 1 deletion cneuromax/fitting/neuroevolution/space/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
)

__all__ = [
"BaseReinforcementSpace",
"BaseSpace",
"BaseSpaceConfig",
"BaseReinforcementSpace",
]
6 changes: 3 additions & 3 deletions cneuromax/projects/classify_mnist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
from .litmodule import MNISTClassificationLitModule

__all__ = [
"TaskRunner",
"MNISTDataModuleConfig",
"MNISTDataModule",
"MNISTClassificationLitModule",
"MNISTDataModule",
"MNISTDataModuleConfig",
"TaskRunner",
]


Expand Down
2 changes: 1 addition & 1 deletion cneuromax/projects/neuroevorl_control/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from .space import GymReinforcementSpace, GymReinforcementSpaceConfig

__all__ = [
"TaskRunner",
"GymAgent",
"GymAgentConfig",
"GymReinforcementSpace",
"GymReinforcementSpaceConfig",
"TaskRunner",
]


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ ignore = [
# https://docs.astral.sh/ruff/rules/suspicious-pickle-usage/
# Disabled due to current implementation of checkpointing
# in `cneuromax.fitting.neuroevolution`.
"TCH001", # `typing-only-first-party-import`
"TC001", # `typing-only-first-party-import`
# Move application import {} into a type-checking block
# https://docs.astral.sh/ruff/rules/typing-only-first-party-import/
# Disabled as we use Beartype for dynamic type checking.
"TCH002", # `typing-only-third-party-import`
"TC002", # `typing-only-third-party-import`
# Move third-party import {} into a type-checking block
# https://docs.astral.sh/ruff/rules/typing-only-third-party-import/
# Disabled as we use Beartype for dynamic type checking.
Expand Down

0 comments on commit ca5c314

Please sign in to comment.