Skip to content

Worker package refactor #15

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

Merged
merged 3 commits into from
Mar 23, 2022
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
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@

autodoc_typehints_description_target = "documented"

autodoc_typehints_format = "short"

autodoc_preserve_defaults = True

autodoc_member_order = "bysource"
Expand Down
17 changes: 16 additions & 1 deletion poetry.lock

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

3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ mypy-protobuf = "^3.2.0"
pydocstyle = "^6.1.1"
pytest = "^6.2.5"
pytest-asyncio = "^0.18.0"
pytest-timeout = "^2.1.0"
setuptools = "^60.9.3"
setuptools-rust = "^1.1.2"
Sphinx = "^4.4.0"
Expand Down Expand Up @@ -84,6 +85,8 @@ asyncio_mode = "auto"
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
timeout = 60
timeout_func_only = true

[tool.isort]
profile = "black"
Expand Down
4 changes: 2 additions & 2 deletions temporalio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
overload,
)

import typing_extensions
from typing_extensions import TypedDict

import temporalio.api.common.v1
import temporalio.api.enums.v1
Expand Down Expand Up @@ -359,7 +359,7 @@ def get_activity_completion_handle(
raise ValueError("Task token or workflow/run/activity ID must be present")


class ClientConfig(typing_extensions.TypedDict, total=False):
class ClientConfig(TypedDict, total=False):
"""TypedDict of config originally passed to :py:meth:`Client`."""

service: temporalio.workflow_service.WorkflowService
Expand Down
21 changes: 21 additions & 0 deletions temporalio/worker/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
"""Worker for processing Temporal workflows and/or activities."""

from .activity import SharedHeartbeatSender, SharedStateManager
from .interceptor import (
ActivityInboundInterceptor,
ActivityOutboundInterceptor,
ExecuteActivityInput,
Interceptor,
)
from .worker import Worker, WorkerConfig

__all__ = [
Copy link
Member

Choose a reason for hiding this comment

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

I'm wondering if this is required since you just listed every import in this file.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not required, but greatly helps Sphinx autodoc and autocomplete and is needed for import * (though I don't expect that use case to emerge much)

"Worker",
"WorkerConfig",
"ExecuteActivityInput",
"Interceptor",
"ActivityInboundInterceptor",
"ActivityOutboundInterceptor",
"SharedStateManager",
"SharedHeartbeatSender",
]
Loading