Skip to content

Commit

Permalink
Update to ruff v0.3.0 (#18)
Browse files Browse the repository at this point in the history
* Update to ruff v0.3.0
  • Loading branch information
yanovs authored Mar 2, 2024
1 parent 9b22783 commit 1bbb73a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
1 change: 1 addition & 0 deletions dilib/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
in order for typing to work for the user, we have dummy functions
that mimic expected typing behavior.
"""

from __future__ import annotations

from typing import Any, Callable, Generic, TypeVar, cast
Expand Down
6 changes: 3 additions & 3 deletions dilib/tests/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,9 @@ def test_typing() -> None:
# test_config.BasicConfig,
# ] = dilib.get_container(config)

container: dilib.Container[
test_config.ParentConfig1
] = dilib.get_container(config)
container: dilib.Container[test_config.ParentConfig1] = (
dilib.get_container(config)
)

# Would trigger mypy error:
# x: str = container.config.basic_config.x
Expand Down
6 changes: 2 additions & 4 deletions dilib/tests/test_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ class Seat:
class Engine(abc.ABC):
@property
@abc.abstractmethod
def started(self) -> bool:
...
def started(self) -> bool: ...

@abc.abstractmethod
def start(self) -> None:
...
def start(self) -> None: ...


class DBEngine(Engine, dilib.SingletonMixin):
Expand Down
3 changes: 1 addition & 2 deletions dilib/tests/test_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@

class BaseMultiplier(abc.ABC):
@abc.abstractmethod
def get_result(self) -> int:
...
def get_result(self) -> int: ...


class SimpleMultiplier(BaseMultiplier):
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ test =
pytest >= 6.2.5
pytest-cov >=2, <3
pyright >= 1.1.284
ruff >= 0.1.0
ruff >= 0.3.0

[options.package_data]
dilib = py.typed

0 comments on commit 1bbb73a

Please sign in to comment.