BentoML
BentoML copied to clipboard
bug: pyright failed
Describe the bug
It seems to occur because of usage of lower python version. typing.Concatenate has been introduced since Python 3.10. But I'm uisng Python 3.9
bentoml
supports Python3.8 and more. So IMO you may need typing extentions to support lower versions of python.
To reproduce
import bentoml
@bentoml.service
class Service:
@bentoml.api
async def svc(self, text: str) -> int:
return 1
pyright .
/mypath/service.py:6:6 - error: Argument of type "(self: Self@Service, text: str) -> Coroutine[Any, Any, int]" cannot be assigned to parameter "func" of type "() -> R@api" in function "api"
Type "(self: Self@Service, text: str) -> Coroutine[Any, Any, int]" cannot be assigned to type "() -> R@api" (reportArgumentType)
1 error, 0 warnings, 0 informations
Expected behavior
pyright .
0 error, 0 warnings, 0 informations
Environment
[tool.poetry.dependencies]
python = "~3.9."
bentoml = "^1.2.10"
[tool.poetry.group.dev.dependencies]
pyright = "^1.1.358"
[tool.pyright]
typeCheckingMode = "basic"
reportPrivateImportUsage = "none"