diff --git a/poetry.lock b/poetry.lock index 9d63ea1f..d6e51c6b 100644 --- a/poetry.lock +++ b/poetry.lock @@ -846,6 +846,17 @@ files = [ protobuf = ">=3.19.4" types-protobuf = ">=3.19.12" +[[package]] +name = "nodeenv" +version = "1.9.1" +description = "Node.js virtual environment builder" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7" +files = [ + {file = "nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9"}, + {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, +] + [[package]] name = "opentelemetry-api" version = "1.12.0" @@ -1139,6 +1150,24 @@ files = [ [package.extras] plugins = ["importlib-metadata"] +[[package]] +name = "pyright" +version = "1.1.377" +description = "Command line wrapper for pyright" +optional = false +python-versions = ">=3.7" +files = [ + {file = "pyright-1.1.377-py3-none-any.whl", hash = "sha256:af0dd2b6b636c383a6569a083f8c5a8748ae4dcde5df7914b3f3f267e14dd162"}, + {file = "pyright-1.1.377.tar.gz", hash = "sha256:aabc30fedce0ded34baa0c49b24f10e68f4bfc8f68ae7f3d175c4b0f256b4fcf"}, +] + +[package.dependencies] +nodeenv = ">=1.6.0" + +[package.extras] +all = ["twine (>=3.4.1)"] +dev = ["twine (>=3.4.1)"] + [[package]] name = "pytest" version = "7.4.3" @@ -1754,4 +1783,4 @@ opentelemetry = ["opentelemetry-api", "opentelemetry-sdk"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "0e394859d0cd8522c57955db0e9358eacf18609cd0bd4bb0611403f2de7952c4" +content-hash = "40eb24c1f7f483804183f0edc19bf7fb359ec51b5f28679d19f0897bb3b2e343" diff --git a/pyproject.toml b/pyproject.toml index ddd001d8..902916cf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,6 +49,7 @@ psutil = "^5.9.3" pydantic = "^1.9.1" pydocstyle = "^6.1.1" pydoctor = "^23.4.1" +pyright = ">=1.1.377" pytest = "^7.4" pytest-asyncio = "^0.21" pytest-timeout = "^2.2" @@ -77,6 +78,7 @@ lint = [ {cmd = "ruff check --select I"}, {cmd = "ruff format --check"}, {ref = "lint-types"}, + {cmd = "pyright"}, {ref = "lint-docs"}, ] # TODO(cretz): Why does pydocstyle complain about @overload missing docs after @@ -174,6 +176,41 @@ privacy = [ project-name = "Temporal Python" sidebar-expand-depth = 2 +[tool.pyright] +include = ["temporalio", "tests"] +exclude = [ + "temporalio/api", + "temporalio/bridge/proto", + "tests/worker/workflow_sandbox/testmodules/proto", + "temporalio/bridge/worker.py", + "temporalio/client.py", + "temporalio/contrib/opentelemetry.py", + "temporalio/converter.py", + "temporalio/testing/_workflow.py", + "temporalio/worker/_activity.py", + "temporalio/worker/_replayer.py", + "temporalio/worker/_worker.py", + "temporalio/worker/workflow_sandbox/_importer.py", + "temporalio/worker/workflow_sandbox/_restrictions.py", + "temporalio/workflow.py", + "tests/api/test_grpc_stub.py", + "tests/conftest.py", + "tests/contrib/test_opentelemetry.py", + "tests/test_converter.py", + "tests/test_service.py", + "tests/test_workflow.py", + "tests/worker/test_activity.py", + "tests/worker/test_workflow.py", + "tests/worker/workflow_sandbox/test_importer.py", + "tests/worker/workflow_sandbox/test_restrictions.py", + # TODO: these pass locally but fail in CI with + # error: Import "temporalio.bridge.temporal_sdk_bridge" could not be resolved + "temporalio/bridge/client.py", + "temporalio/bridge/metric.py", + "temporalio/bridge/runtime.py", + "temporalio/bridge/testing.py", +] + [tool.ruff] target-version = "py38"