From 1bbb73a0438a21d5df94024fcf06306d1800f3fc Mon Sep 17 00:00:00 2001 From: yanovs <42386943+yanovs@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:11:41 -0500 Subject: [PATCH] Update to ruff v0.3.0 (#18) * Update to ruff v0.3.0 --- dilib/specs.py | 1 + dilib/tests/test_container.py | 6 +++--- dilib/tests/test_demo.py | 6 ++---- dilib/tests/test_specs.py | 3 +-- setup.cfg | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/dilib/specs.py b/dilib/specs.py index 305dd6e..ae7c5a0 100644 --- a/dilib/specs.py +++ b/dilib/specs.py @@ -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 diff --git a/dilib/tests/test_container.py b/dilib/tests/test_container.py index c592104..d52a692 100644 --- a/dilib/tests/test_container.py +++ b/dilib/tests/test_container.py @@ -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 diff --git a/dilib/tests/test_demo.py b/dilib/tests/test_demo.py index 4947a1f..146fc2c 100644 --- a/dilib/tests/test_demo.py +++ b/dilib/tests/test_demo.py @@ -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): diff --git a/dilib/tests/test_specs.py b/dilib/tests/test_specs.py index f8a76eb..ae8305b 100644 --- a/dilib/tests/test_specs.py +++ b/dilib/tests/test_specs.py @@ -12,8 +12,7 @@ class BaseMultiplier(abc.ABC): @abc.abstractmethod - def get_result(self) -> int: - ... + def get_result(self) -> int: ... class SimpleMultiplier(BaseMultiplier): diff --git a/setup.cfg b/setup.cfg index 62440ec..e8ef61e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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