Skip to content
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
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ lint:
uv run eof-fixer .
uv run ruff format
uv run ruff check --fix
uv run mypy .
uv run ty check

lint-ci:
uv run eof-fixer . --check
uv run ruff format --check
uv run ruff check --no-fix
uv run mypy .
uv run ty check

test *args:
uv run --no-sync pytest {{ args }}
Expand Down
2 changes: 1 addition & 1 deletion modern_di/providers/container_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self) -> None:
def resolve(self, container: "Container") -> "Container":
return container

def validate(self, _: "Container") -> dict[str, typing.Any]:
def validate(self, container: "Container") -> dict[str, typing.Any]: # noqa: ARG002
return {"self": self}


Expand Down
2 changes: 1 addition & 1 deletion modern_di/providers/context_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ContextProvider(AbstractProvider[types.T_co]):
def __init__(self, *, scope: Scope = Scope.APP, context_type: type[types.T_co]) -> None:
super().__init__(scope=scope, bound_type=context_type)

def validate(self, _: "Container") -> dict[str, typing.Any]:
def validate(self, container: "Container") -> dict[str, typing.Any]: # noqa: ARG002
return {"bound_type": self.bound_type, "self": self}

def resolve(self, container: "Container") -> types.T_co | None:
Expand Down
4 changes: 3 additions & 1 deletion modern_di/providers/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ def _compile_kwargs(self, container: "Container") -> dict[str, typing.Any]:
provider = None
else:
for x in v.args:
provider = container.providers_registry.find_provider(x)
provider = typing.cast(
AbstractProvider[types.T_co] | None, container.providers_registry.find_provider(x)
)
if provider:
break

Expand Down
6 changes: 1 addition & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@ dev = [
]
lint = [
"ruff",
"mypy",
"ty",
"eof-fixer",
"typing-extensions",
]

[tool.mypy]
python_version = "3.10"
strict = true

[tool.ruff]
fix = true
unsafe-fixes = true
Expand Down
Loading