Skip to content

Commit 927abdc

Browse files
authored
Start requiring pyright typechecking (#619)
1 parent ed9112a commit 927abdc

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

poetry.lock

+30-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+37
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ psutil = "^5.9.3"
4949
pydantic = "^1.9.1"
5050
pydocstyle = "^6.1.1"
5151
pydoctor = "^23.4.1"
52+
pyright = ">=1.1.377"
5253
pytest = "^7.4"
5354
pytest-asyncio = "^0.21"
5455
pytest-timeout = "^2.2"
@@ -77,6 +78,7 @@ lint = [
7778
{cmd = "ruff check --select I"},
7879
{cmd = "ruff format --check"},
7980
{ref = "lint-types"},
81+
{cmd = "pyright"},
8082
{ref = "lint-docs"},
8183
]
8284
# TODO(cretz): Why does pydocstyle complain about @overload missing docs after
@@ -174,6 +176,41 @@ privacy = [
174176
project-name = "Temporal Python"
175177
sidebar-expand-depth = 2
176178

179+
[tool.pyright]
180+
include = ["temporalio", "tests"]
181+
exclude = [
182+
"temporalio/api",
183+
"temporalio/bridge/proto",
184+
"tests/worker/workflow_sandbox/testmodules/proto",
185+
"temporalio/bridge/worker.py",
186+
"temporalio/client.py",
187+
"temporalio/contrib/opentelemetry.py",
188+
"temporalio/converter.py",
189+
"temporalio/testing/_workflow.py",
190+
"temporalio/worker/_activity.py",
191+
"temporalio/worker/_replayer.py",
192+
"temporalio/worker/_worker.py",
193+
"temporalio/worker/workflow_sandbox/_importer.py",
194+
"temporalio/worker/workflow_sandbox/_restrictions.py",
195+
"temporalio/workflow.py",
196+
"tests/api/test_grpc_stub.py",
197+
"tests/conftest.py",
198+
"tests/contrib/test_opentelemetry.py",
199+
"tests/test_converter.py",
200+
"tests/test_service.py",
201+
"tests/test_workflow.py",
202+
"tests/worker/test_activity.py",
203+
"tests/worker/test_workflow.py",
204+
"tests/worker/workflow_sandbox/test_importer.py",
205+
"tests/worker/workflow_sandbox/test_restrictions.py",
206+
# TODO: these pass locally but fail in CI with
207+
# error: Import "temporalio.bridge.temporal_sdk_bridge" could not be resolved
208+
"temporalio/bridge/client.py",
209+
"temporalio/bridge/metric.py",
210+
"temporalio/bridge/runtime.py",
211+
"temporalio/bridge/testing.py",
212+
]
213+
177214
[tool.ruff]
178215
target-version = "py38"
179216

0 commit comments

Comments
 (0)