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

Update to ruff v0.3.0 #18

Merged
merged 2 commits into from
Mar 2, 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
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
Loading