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

Start requiring pyright typechecking #619

Merged
merged 2 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -174,6 +176,41 @@ privacy = [
project-name = "Temporal Python"
sidebar-expand-depth = 2

[tool.pyright]
Copy link
Member

@cretz cretz Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a lot of excluded files. Are we sure we don't want to solve even some of them here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'd like to keep this PR focused on the infrastructure, and subsequent PRs focused on actual type checking considerations.

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"

Expand Down
Loading