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

bug: pyright failed #4659

Open
zsaladin opened this issue Apr 12, 2024 · 0 comments
Open

bug: pyright failed #4659

zsaladin opened this issue Apr 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@zsaladin
Copy link

zsaladin commented Apr 12, 2024

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"
@zsaladin zsaladin added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant