diff --git a/sdks/python/examples/dependency_injection/dependency_annotations310.py b/sdks/python/examples/dependency_injection/dependency_annotations310.py new file mode 100644 index 0000000000..10cb8f02f0 --- /dev/null +++ b/sdks/python/examples/dependency_injection/dependency_annotations310.py @@ -0,0 +1,25 @@ +from hatchet_sdk.runnables.task import Depends +from hatchet_sdk import Context +from hatchet_sdk.runnables.types import EmptyModel +from typing import Annotated, TypeAlias + + +async def async_dep(input: EmptyModel, ctx: Context) -> bool: + return True + + +def sync_dep(input: EmptyModel, ctx: Context) -> bool: + return True + + +AsyncDepNoTypeAlias = Annotated[bool, Depends(async_dep)] +AsyncDepTypeAlias: TypeAlias = Annotated[bool, Depends(async_dep)] +AsyncDepTypeSyntax: TypeAlias = ( + AsyncDepTypeAlias # python <3.12 doesn't support `type` syntax for type alias so we use type alias again +) + +SyncDepNoTypeAlias = Annotated[bool, Depends(sync_dep)] +SyncDepTypeAlias: TypeAlias = Annotated[bool, Depends(sync_dep)] +SyncDepTypeSyntax: TypeAlias = ( + SyncDepTypeAlias # python <3.12 doesn't support `type` syntax for type alias so we use type alias again +) diff --git a/sdks/python/examples/dependency_injection/dependency_annotations312.py b/sdks/python/examples/dependency_injection/dependency_annotations312.py new file mode 100644 index 0000000000..963ba3bda1 --- /dev/null +++ b/sdks/python/examples/dependency_injection/dependency_annotations312.py @@ -0,0 +1,22 @@ +# type: ignore +from hatchet_sdk.runnables.task import Depends +from hatchet_sdk import Context +from hatchet_sdk.runnables.types import EmptyModel +from typing import Annotated, TypeAlias + + +async def async_dep(input: EmptyModel, ctx: Context) -> bool: + return True + + +def sync_dep(input: EmptyModel, ctx: Context) -> bool: + return True + + +AsyncDepNoTypeAlias = Annotated[bool, Depends(async_dep)] +AsyncDepTypeAlias: TypeAlias = Annotated[bool, Depends(async_dep)] +type AsyncDepTypeSyntax = Annotated[bool, Depends(async_dep)] + +SyncDepNoTypeAlias = Annotated[bool, Depends(sync_dep)] +SyncDepTypeAlias: TypeAlias = Annotated[bool, Depends(sync_dep)] +type SyncDepTypeSyntax = Annotated[bool, Depends(sync_dep)] diff --git a/sdks/python/examples/dependency_injection/test_dependency_injection.py b/sdks/python/examples/dependency_injection/test_dependency_injection.py index 8813977d25..6236b500ae 100644 --- a/sdks/python/examples/dependency_injection/test_dependency_injection.py +++ b/sdks/python/examples/dependency_injection/test_dependency_injection.py @@ -15,6 +15,7 @@ durable_sync_task_with_dependencies, sync_dep, sync_task_with_dependencies, + task_with_type_aliases, ) from hatchet_sdk import EmptyModel from hatchet_sdk.runnables.workflow import Standalone @@ -66,3 +67,11 @@ async def test_di_workflows() -> None: ) assert parsed.chained_dep == "chained_" + CHAINED_CM_VALUE assert parsed.chained_async_dep == "chained_" + CHAINED_ASYNC_CM_VALUE + + +@pytest.mark.asyncio(loop_scope="session") +async def test_type_aliases() -> None: + result = await task_with_type_aliases.aio_run(EmptyModel()) + assert result + for key in result: + assert result[key] is True diff --git a/sdks/python/examples/dependency_injection/worker.py b/sdks/python/examples/dependency_injection/worker.py index 7ddbcf4306..66821e9eea 100644 --- a/sdks/python/examples/dependency_injection/worker.py +++ b/sdks/python/examples/dependency_injection/worker.py @@ -1,5 +1,6 @@ from contextlib import asynccontextmanager, contextmanager from typing import Annotated, AsyncGenerator, Generator +import sys from pydantic import BaseModel @@ -14,6 +15,46 @@ CHAINED_CM_VALUE = "chained_cm_value" CHAINED_ASYNC_CM_VALUE = "chained_async_cm_value" +if sys.version_info >= (3, 12): + from examples.dependency_injection.dependency_annotations312 import ( + AsyncDepNoTypeAlias, + AsyncDepTypeAlias, + SyncDepNoTypeAlias, + AsyncDepTypeSyntax, + SyncDepTypeAlias, + SyncDepTypeSyntax, + ) +else: + from examples.dependency_injection.dependency_annotations310 import ( + AsyncDepNoTypeAlias, + AsyncDepTypeAlias, + SyncDepNoTypeAlias, + AsyncDepTypeSyntax, + SyncDepTypeAlias, + SyncDepTypeSyntax, + ) + + +@hatchet.task() +async def task_with_type_aliases( + _i: EmptyModel, + ctx: Context, + async_dep_no_type_alias: AsyncDepNoTypeAlias, + async_dep_type_alias: AsyncDepTypeAlias, + async_dep_type_syntax: AsyncDepTypeSyntax, + sync_dep_no_type_alias: SyncDepNoTypeAlias, + sync_dep_type_alias: SyncDepTypeAlias, + sync_dep_type_syntax: SyncDepTypeSyntax, +) -> dict[str, bool]: + return { + "async_dep_no_type_alias": async_dep_no_type_alias, + "async_dep_type_alias": async_dep_type_alias, + "async_dep_type_syntax": async_dep_type_syntax, + "sync_dep_no_type_alias": sync_dep_no_type_alias, + "sync_dep_type_alias": sync_dep_type_alias, + "sync_dep_type_syntax": sync_dep_type_syntax, + } + # > Declare dependencies async def async_dep(input: EmptyModel, ctx: Context) -> str: @@ -274,6 +315,7 @@ def main() -> None: durable_async_task_with_dependencies, durable_sync_task_with_dependencies, di_workflow, + task_with_type_aliases, ], ) worker.start() diff --git a/sdks/python/examples/worker.py b/sdks/python/examples/worker.py index 1a2cd8e9a2..f2a6122ef6 100644 --- a/sdks/python/examples/worker.py +++ b/sdks/python/examples/worker.py @@ -29,6 +29,7 @@ durable_async_task_with_dependencies, durable_sync_task_with_dependencies, sync_task_with_dependencies, + task_with_type_aliases, ) from examples.dict_input.worker import say_hello_unsafely from examples.durable.worker import durable_workflow, wait_for_sleep_twice @@ -103,6 +104,7 @@ def main() -> None: sync_task_with_dependencies, durable_async_task_with_dependencies, durable_sync_task_with_dependencies, + task_with_type_aliases, say_hello, say_hello_unsafely, serde_workflow, diff --git a/sdks/python/hatchet_sdk/runnables/task.py b/sdks/python/hatchet_sdk/runnables/task.py index d43b20df82..5a1b0534f5 100644 --- a/sdks/python/hatchet_sdk/runnables/task.py +++ b/sdks/python/hatchet_sdk/runnables/task.py @@ -24,6 +24,7 @@ ) from pydantic import BaseModel, ConfigDict, TypeAdapter +from typing_extensions import TypeAliasType from hatchet_sdk.conditions import ( Action, @@ -269,6 +270,8 @@ async def _parse_parameter( ) = None, ) -> DependencyToInject | None: annotation = param.annotation + if isinstance(annotation, TypeAliasType): + annotation = annotation.__value__ if get_origin(annotation) is Annotated: args = get_args(annotation) diff --git a/sdks/python/hatchet_sdk/runnables/types.py b/sdks/python/hatchet_sdk/runnables/types.py index e8f51c98ee..fb1b94e41d 100644 --- a/sdks/python/hatchet_sdk/runnables/types.py +++ b/sdks/python/hatchet_sdk/runnables/types.py @@ -1,4 +1,3 @@ -import asyncio import inspect import json from collections.abc import Callable, Mapping @@ -148,7 +147,7 @@ class StepType(str, Enum): def is_async_fn( fn: TaskFunc[TWorkflowInput, R], ) -> TypeGuard[AsyncFunc[TWorkflowInput, R]]: - return asyncio.iscoroutinefunction(fn) + return inspect.iscoroutinefunction(fn) def is_sync_fn( diff --git a/sdks/python/poetry.lock b/sdks/python/poetry.lock index 52e04fa206..30c59b9a6d 100644 --- a/sdks/python/poetry.lock +++ b/sdks/python/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "aiohappyeyeballs" @@ -153,7 +153,7 @@ propcache = ">=0.2.0" yarl = ">=1.17.0,<2.0" [package.extras] -speedups = ["Brotli (>=1.2)", "aiodns (>=3.3.0)", "backports.zstd", "brotlicffi (>=1.2)"] +speedups = ["Brotli (>=1.2) ; platform_python_implementation == \"CPython\"", "aiodns (>=3.3.0)", "backports.zstd ; platform_python_implementation == \"CPython\" and python_version < \"3.14\"", "brotlicffi (>=1.2) ; platform_python_implementation != \"CPython\""] [[package]] name = "aiosignal" @@ -201,7 +201,7 @@ idna = ">=2.8" typing_extensions = {version = ">=4.5", markers = "python_version < \"3.13\""} [package.extras] -trio = ["trio (>=0.31.0)", "trio (>=0.32.0)"] +trio = ["trio (>=0.31.0) ; python_version < \"3.10\"", "trio (>=0.32.0) ; python_version >= \"3.10\""] [[package]] name = "async-timeout" @@ -210,7 +210,7 @@ description = "Timeout context manager for asyncio programs" optional = false python-versions = ">=3.8" groups = ["main"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "async_timeout-5.0.1-py3-none-any.whl", hash = "sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c"}, {file = "async_timeout-5.0.1.tar.gz", hash = "sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3"}, @@ -325,21 +325,19 @@ version = "2025.11.12" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" -groups = ["main", "docs"] +groups = ["main", "docs", "test"] files = [ {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, ] -markers = {main = "extra == \"otel\""} [[package]] name = "charset-normalizer" version = "3.4.4" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." -optional = true +optional = false python-versions = ">=3.7" -groups = ["main"] -markers = "extra == \"otel\"" +groups = ["main", "test"] files = [ {file = "charset_normalizer-3.4.4-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:e824f1492727fa856dd6eda4f7cee25f8518a12f3c4a56a74e8095695089cf6d"}, {file = "charset_normalizer-3.4.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bd5d4137d500351a30687c2d3971758aac9a19208fc110ccb9d7188fbe709e8"}, @@ -509,7 +507,7 @@ files = [ ] [package.extras] -dev = ["docstring-parser[docs]", "docstring-parser[test]", "pre-commit (>=2.16.0)"] +dev = ["docstring-parser[docs]", "docstring-parser[test]", "pre-commit (>=2.16.0) ; python_version >= \"3.9\""] docs = ["pydoctor (>=25.4.0)"] test = ["pytest"] @@ -520,7 +518,7 @@ description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" groups = ["docs", "test"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, @@ -969,7 +967,7 @@ httpcore = "==1.*" idna = "*" [package.extras] -brotli = ["brotli", "brotlicffi"] +brotli = ["brotli ; platform_python_implementation == \"CPython\"", "brotlicffi ; platform_python_implementation != \"CPython\""] cli = ["click (==8.*)", "pygments (==2.*)", "rich (>=10,<14)"] http2 = ["h2 (>=3,<5)"] socks = ["socksio (==1.*)"] @@ -981,7 +979,7 @@ version = "3.11" description = "Internationalized Domain Names in Applications (IDNA)" optional = false python-versions = ">=3.8" -groups = ["main", "docs"] +groups = ["main", "docs", "test"] files = [ {file = "idna-3.11-py3-none-any.whl", hash = "sha256:771a87f49d9defaf64091e6e6fe9c18d4833f140bd19464795bc32d966ca37ea"}, {file = "idna-3.11.tar.gz", hash = "sha256:795dafcc9c04ed0c1fb032c2aa73654d8e8c5023a7df64a53f39190ada629902"}, @@ -1007,12 +1005,12 @@ files = [ zipp = ">=3.20" [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] perf = ["ipython"] -test = ["flufl.flake8", "importlib_resources (>=1.3)", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] +test = ["flufl.flake8", "importlib_resources (>=1.3) ; python_version < \"3.9\"", "jaraco.test (>=5.4)", "packaging", "pyfakefs", "pytest (>=6,!=8.1.*)", "pytest-perf (>=0.9.2)"] type = ["pytest-mypy"] [[package]] @@ -1416,7 +1414,7 @@ watchdog = ">=2.0" [package.extras] i18n = ["babel (>=2.9.0)"] -min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4)", "ghp-import (==1.0)", "importlib-metadata (==4.4)", "jinja2 (==2.11.1)", "markdown (==3.3.6)", "markupsafe (==2.0.1)", "mergedeep (==1.3.4)", "mkdocs-get-deps (==0.2.0)", "packaging (==20.5)", "pathspec (==0.11.1)", "pyyaml (==5.1)", "pyyaml-env-tag (==0.1)", "watchdog (==2.0)"] +min-versions = ["babel (==2.9.0)", "click (==7.0)", "colorama (==0.4) ; platform_system == \"Windows\"", "ghp-import (==1.0)", "importlib-metadata (==4.4) ; python_version < \"3.10\"", "jinja2 (==2.11.1)", "markdown (==3.3.6)", "markupsafe (==2.0.1)", "mergedeep (==1.3.4)", "mkdocs-get-deps (==0.2.0)", "packaging (==20.5)", "pathspec (==0.11.1)", "pyyaml (==5.1)", "pyyaml-env-tag (==0.1)", "watchdog (==2.0)"] [[package]] name = "mkdocs-autorefs" @@ -2231,12 +2229,12 @@ typing-extensions = {version = ">=4.6", markers = "python_version < \"3.13\""} tzdata = {version = "*", markers = "sys_platform == \"win32\""} [package.extras] -binary = ["psycopg-binary (==3.3.2)"] -c = ["psycopg-c (==3.3.2)"] +binary = ["psycopg-binary (==3.3.2) ; implementation_name != \"pypy\""] +c = ["psycopg-c (==3.3.2) ; implementation_name != \"pypy\""] dev = ["ast-comments (>=1.1.2)", "black (>=24.1.0)", "codespell (>=2.2)", "cython-lint (>=0.16)", "dnspython (>=2.1)", "flake8 (>=4.0)", "isort-psycopg", "isort[colors] (>=6.0)", "mypy (>=1.19.0)", "pre-commit (>=4.0.1)", "types-setuptools (>=57.4)", "types-shapely (>=2.0)", "wheel (>=0.37)"] docs = ["Sphinx (>=5.0)", "furo (==2022.6.21)", "sphinx-autobuild (>=2021.3.14)", "sphinx-autodoc-typehints (>=1.12)"] pool = ["psycopg-pool"] -test = ["anyio (>=4.0)", "mypy (>=1.19.0)", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] +test = ["anyio (>=4.0)", "mypy (>=1.19.0) ; implementation_name != \"pypy\"", "pproxy (>=2.7)", "pytest (>=6.2.5)", "pytest-cov (>=3.0)", "pytest-randomly (>=3.5)"] [[package]] name = "psycopg-pool" @@ -2276,7 +2274,7 @@ typing-inspection = ">=0.4.2" [package.extras] email = ["email-validator (>=2.0.0)"] -timezone = ["tzdata"] +timezone = ["tzdata ; python_version >= \"3.9\" and platform_system == \"Windows\""] [[package]] name = "pydantic-core" @@ -2778,10 +2776,9 @@ pyyaml = "*" name = "requests" version = "2.32.5" description = "Python HTTP for Humans." -optional = true +optional = false python-versions = ">=3.9" -groups = ["main"] -markers = "extra == \"otel\"" +groups = ["main", "test"] files = [ {file = "requests-2.32.5-py3-none-any.whl", hash = "sha256:2462f94637a34fd532264295e186976db0f5d453d1cdd31473c85a6a161affb6"}, {file = "requests-2.32.5.tar.gz", hash = "sha256:dbba0bac56e100853db0ea71b82b4dfd5fe2bf6d3754a8893c3af500cec7d7cf"}, @@ -2838,13 +2835,13 @@ files = [ ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)", "ruff (>=0.8.0)"] -core = ["importlib_metadata (>=6)", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1)", "wheel (>=0.43.0)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\"", "ruff (>=0.8.0) ; sys_platform != \"cygwin\""] +core = ["importlib_metadata (>=6) ; python_version < \"3.10\"", "jaraco.functools (>=4)", "jaraco.text (>=3.7)", "more_itertools", "more_itertools (>=8.8)", "packaging (>=24.2)", "platformdirs (>=4.2.2)", "tomli (>=2.0.1) ; python_version < \"3.11\"", "wheel (>=0.43.0)"] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "pygments-github-lexers (==0.0.5)", "pyproject-hooks (!=1.1)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-favicon", "sphinx-inline-tabs", "sphinx-lint", "sphinx-notfound-page (>=1,<2)", "sphinx-reredirects", "sphinxcontrib-towncrier", "towncrier (<24.7)"] enabler = ["pytest-enabler (>=2.2)"] -test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21)", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] -type = ["importlib_metadata (>=7.0.2)", "jaraco.develop (>=7.21)", "mypy (==1.14.*)", "pytest-mypy"] +test = ["build[virtualenv] (>=1.0.3)", "filelock (>=3.4.0)", "ini2toml[lite] (>=0.14)", "jaraco.develop (>=7.21) ; python_version >= \"3.9\" and sys_platform != \"cygwin\"", "jaraco.envs (>=2.2)", "jaraco.path (>=3.7.2)", "jaraco.test (>=5.5)", "packaging (>=24.2)", "pip (>=19.1)", "pyproject-hooks (!=1.1)", "pytest (>=6,!=8.1.*)", "pytest-home (>=0.5)", "pytest-perf ; sys_platform != \"cygwin\"", "pytest-subprocess", "pytest-timeout", "pytest-xdist (>=3)", "tomli-w (>=1.0.0)", "virtualenv (>=13.0.0)", "wheel (>=0.44.0)"] +type = ["importlib_metadata (>=7.0.2) ; python_version < \"3.10\"", "jaraco.develop (>=7.21) ; sys_platform != \"cygwin\"", "mypy (==1.14.*)", "pytest-mypy"] [[package]] name = "six" @@ -2923,7 +2920,7 @@ description = "A lil' TOML parser" optional = false python-versions = ">=3.8" groups = ["docs", "lint", "test"] -markers = "python_version < \"3.11\"" +markers = "python_version == \"3.10\"" files = [ {file = "tomli-2.3.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:88bd15eb972f3664f5ed4b57c1634a97153b4bac4479dcb6a495f41921eb7f45"}, {file = "tomli-2.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:883b1c0d6398a6a9d29b508c331fa56adbcdff647f6ace4dfca0f50e90dfd0ba"}, @@ -3130,17 +3127,17 @@ version = "2.6.3" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=3.9" -groups = ["main", "lint"] +groups = ["main", "lint", "test"] files = [ {file = "urllib3-2.6.3-py3-none-any.whl", hash = "sha256:bf272323e553dfb2e87d9bfd225ca7b0f467b919d7bbd355436d3fd37cb0acd4"}, {file = "urllib3-2.6.3.tar.gz", hash = "sha256:1b62b6884944a57dbe321509ab94fd4d3b307075e0c2eae991ac71ee15ad38ed"}, ] [package.extras] -brotli = ["brotli (>=1.2.0)", "brotlicffi (>=1.2.0.0)"] +brotli = ["brotli (>=1.2.0) ; platform_python_implementation == \"CPython\"", "brotlicffi (>=1.2.0.0) ; platform_python_implementation != \"CPython\""] h2 = ["h2 (>=4,<5)"] socks = ["pysocks (>=1.5.6,!=1.5.7,<2.0)"] -zstd = ["backports-zstd (>=1.0.0)"] +zstd = ["backports-zstd (>=1.0.0) ; python_version < \"3.14\""] [[package]] name = "uvicorn" @@ -3160,7 +3157,7 @@ h11 = ">=0.8" typing-extensions = {version = ">=4.0", markers = "python_version < \"3.11\""} [package.extras] -standard = ["colorama (>=0.4)", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.15.1)", "watchfiles (>=0.13)", "websockets (>=10.4)"] +standard = ["colorama (>=0.4) ; sys_platform == \"win32\"", "httptools (>=0.6.3)", "python-dotenv (>=0.13)", "pyyaml (>=5.1)", "uvloop (>=0.15.1) ; sys_platform != \"win32\" and sys_platform != \"cygwin\" and platform_python_implementation != \"PyPy\"", "watchfiles (>=0.13)", "websockets (>=10.4)"] [[package]] name = "watchdog" @@ -3456,7 +3453,7 @@ files = [ ] [package.extras] -check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1)"] +check = ["pytest-checkdocs (>=2.4)", "pytest-ruff (>=0.2.1) ; sys_platform != \"cygwin\""] cover = ["pytest-cov"] doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] enabler = ["pytest-enabler (>=2.2)"] @@ -3470,4 +3467,4 @@ v0-sdk = [] [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "258e0c23b44c9d791c366483aa941e1ffda6ae89af9f18e35b1adb8c70f139ff" +content-hash = "418d80219c5db27a8b6476a69256ca5fb51541ad9167ed991a848e7671216817" diff --git a/sdks/python/pyproject.toml b/sdks/python/pyproject.toml index 38c130a206..25db17a404 100644 --- a/sdks/python/pyproject.toml +++ b/sdks/python/pyproject.toml @@ -51,6 +51,7 @@ pytest-env = "^1.1.5" pytest-retry = "^1.7.0" psycopg = { extras = ["pool"], version = "^3.2.6" } pytest-xdist = "^3.7.0" +requests = "^2.32.5" [tool.poetry.group.docs.dependencies] @@ -100,6 +101,7 @@ exclude = [ "hatchet_sdk/clients/rest/rest.py", "hatchet_sdk/v0/*", "site/*", + "examples/dependency_injection/dependency_annotations312.py", ] strict = true enable_error_code = [ @@ -201,7 +203,7 @@ exclude = [ [tool.pydoclint] style = 'sphinx' -exclude = 'v0|clients/rest/*|contracts/*|.venv|site/*' +exclude = 'v0|clients/rest/*|contracts/*|.venv|site/*|examples/dependency_injection/dependency_annotations312.py' arg-type-hints-in-docstring = false # Automatically checked by mypy and mkdocs check-return-types = false # Automatically checked by mypy and mkdocs