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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ tests = [
"pytest>=7.4.0,<10.0.0",
"ruff==0.15.7",
"uvicorn>=0.39.0",
"ty>=0.0.9",
"ty>=0.0.25",
]

[build-system]
Expand Down
4 changes: 2 additions & 2 deletions src/fastapi_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
try:
import uvicorn
except ImportError: # pragma: no cover
uvicorn = None # type: ignore[assignment]
uvicorn = None # type: ignore[assignment] # ty: ignore[invalid-assignment]


try:
Expand All @@ -39,7 +39,7 @@


try:
from fastapi_new.cli import ( # type: ignore[import-not-found]
from fastapi_new.cli import ( # type: ignore[import-not-found] # ty: ignore[unresolved-import]
app as fastapi_new_cli,
)

Expand Down
4 changes: 2 additions & 2 deletions src/fastapi_cli/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _read_pyproject_toml(cls) -> dict[str, Any]:
return {}

try:
import tomllib # type: ignore[import-not-found, unused-ignore]
import tomllib # type: ignore[import-not-found, unused-ignore] # ty: ignore[unresolved-import]
except ImportError:
try:
import tomli as tomllib # type: ignore[no-redef, import-not-found, unused-ignore]
Expand All @@ -30,7 +30,7 @@ def _read_pyproject_toml(cls) -> dict[str, Any]:
with open(pyproject_path, "rb") as f:
data = tomllib.load(f)

return data.get("tool", {}).get("fastapi", {}) # type: ignore
return data.get("tool", {}).get("fastapi", {}) # type: ignore[no-any-return]

@classmethod
def resolve(cls, entrypoint: str | None = None) -> "FastAPIConfig":
Expand Down
2 changes: 1 addition & 1 deletion src/fastapi_cli/discover.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
try:
from fastapi import FastAPI
except ImportError: # pragma: no cover
FastAPI = None # type: ignore[misc, assignment]
FastAPI = None # type: ignore[misc, assignment] # ty: ignore[invalid-assignment]


def get_default_path() -> Path:
Expand Down
6 changes: 3 additions & 3 deletions tests/test_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_no_uvicorn() -> None:

import fastapi_cli.cli

fastapi_cli.cli.uvicorn = None # type: ignore[attr-defined, assignment]
fastapi_cli.cli.uvicorn = None # type: ignore[attr-defined, assignment] # ty: ignore[invalid-assignment]

with changing_dir(assets_path):
result = runner.invoke(fastapi_cli.cli.app, ["dev", "single_file_app.py"])
Expand All @@ -29,15 +29,15 @@ def test_no_uvicorn() -> None:
in result.exception.args[0]
)

fastapi_cli.cli.uvicorn = uvicorn # type: ignore[attr-defined]
fastapi_cli.cli.uvicorn = uvicorn # type: ignore[attr-defined] # ty: ignore[invalid-assignment]


def test_no_fastapi() -> None:
from fastapi import FastAPI

import fastapi_cli.discover

fastapi_cli.discover.FastAPI = None # type: ignore[attr-defined, assignment]
fastapi_cli.discover.FastAPI = None # type: ignore[attr-defined, assignment] # ty: ignore[invalid-assignment]
with changing_dir(assets_path):
with pytest.raises(FastAPICLIException) as exc_info:
get_import_data(path=Path("single_file_app.py"))
Expand Down
40 changes: 20 additions & 20 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading