Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Feature Request] Make start_update/execute_update work with vscode/pyright and add pyright to CI #420

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

Closed
cretz opened this issue Nov 9, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@cretz
Copy link
Member

cretz commented Nov 9, 2023

Describe the solution you'd like

Right now vscode/pylance/pyright fails with:
image

I think we probably just need to remove the typing for multi-param update (use Sequence[Any] like signal/query). Then we need to add https://github.com/microsoft/pyright to CI alongside MyPy if it's not too difficult.

@cretz cretz added the enhancement New feature or request label Nov 9, 2023
@cretz
Copy link
Member Author

cretz commented Nov 9, 2023

Also note that the return type for execute_update and similar is not properly inferred from the method in Pyright like it is in MyPy

@dandavison
Copy link
Contributor

Another example:

samples-python(main) .venv/bin/pyright --pythonpath .venv/bin/python hello/hello_activity.py
/Users/dan/src/temporalio/samples-python/hello/hello_activity.py
  /Users/dan/src/temporalio/samples-python/hello/hello_activity.py:58:24 - error: No overloads for "execute_workflow" match the provided arguments (reportCallIssue)
  /Users/dan/src/temporalio/samples-python/hello/hello_activity.py:59:13 - error: Argument of type "(self: GreetingWorkflow, name: str) -> Coroutine[Any, Any, str]" cannot be assigned to parameter "workflow" of type "str" in function "execute_workflow"
    "function" is incompatible with "str" (reportArgumentType)
2 errors, 0 warnings, 0 informations
samples-python(main) .venv/bin/pyright --version
pyright 1.1.350
samples-python(main) .venv/bin/python --version
Python 3.10.13

@cretz
Copy link
Member Author

cretz commented Feb 13, 2024

So #471 probably fixed this error, but leaving this open because we still want pyright in CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants