Files
hatchet/sdks/python/pyproject.toml
matt 9bd62b2eda [Python]: Flag to enable / disable gRPC fork support, modify valid task return type (#2057)
* feat: add flag to handle disabling fork support

* chore: version

* chore: changelog

* feat: allow TypedDict return from tasks

* chore: changelog

* feat: add poll strategy, change type
2025-07-30 13:48:38 -04:00

259 lines
6.9 KiB
TOML

[tool.poetry]
name = "hatchet-sdk"
version = "1.16.4"
description = ""
authors = ["Alexander Belanger <alexander@hatchet.run>"]
readme = "README.md"
include = ["hatchet_sdk/py.typed"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.10"
grpcio = [
{ version = ">=1.64.1, !=1.68.*", markers = "python_version < '3.13'" },
{ version = ">=1.69.0", markers = "python_version >= '3.13'" },
]
grpcio-tools = [
{ version = ">=1.64.1, !=1.68.*", markers = "python_version < '3.13'" },
{ version = ">=1.69.0", markers = "python_version >= '3.13'" },
]
protobuf = "^5.29.5"
pydantic = "^2.6.3"
python-dateutil = "^2.9.0.post0"
urllib3 = ">=1.26.20"
aiostream = "^0.5.2"
aiohttp = "^3.10.5"
aiohttp-retry = "^2.8.3"
tenacity = ">=8.4.1"
cel-python = "^0.2.0"
opentelemetry-api = { version = "^1.28.0", optional = true }
opentelemetry-sdk = { version = "^1.28.0", optional = true }
opentelemetry-instrumentation = { version = ">=0.49b0", optional = true }
opentelemetry-distro = { version = ">=0.49b0", optional = true }
opentelemetry-exporter-otlp = { version = "^1.28.0", optional = true }
opentelemetry-exporter-otlp-proto-http = { version = "^1.28.0", optional = true }
prometheus-client = "^0.21.1"
pydantic-settings = "^2.7.1"
[tool.poetry.group.lint.dependencies]
mypy = "^1.14.0"
types-protobuf = "^5.28.3.20241030"
black = "^24.10.0"
isort = "^5.13.2"
types-psutil = "^6.1.0.20241221"
ruff = "^0.9.7"
types-requests = "^2.32.0.20241016"
psutil = "^6.0.0"
grpc-stubs = "^1.53.0.5"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.5"
pytest-asyncio = "^0.25.3"
pytest-env = "^1.1.5"
pytest-retry = "^1.7.0"
psycopg = { extras = ["pool"], version = "^3.2.6" }
pytest-xdist = "^3.7.0"
[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.1"
mkdocstrings = { extras = ["python"], version = "^0.29.1" }
pydoclint = "^0.6.6"
markdownify = "^1.1.0"
openai = "^1.75.0"
bs4 = "^0.0.2"
types-beautifulsoup4 = "^4.12.0.20250204"
fastapi = "^0.115.14"
uvicorn = "^0.34.3"
[tool.poetry.extras]
otel = [
"opentelemetry-api",
"opentelemetry-sdk",
"opentelemetry-instrumentation",
"opentelemetry-distro",
"opentelemetry-exporter-otlp",
"opentelemetry-exporter-otlp-proto-http",
]
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
log_cli = true
env = ["HATCHET_CLIENT_WORKER_HEALTHCHECK_ENABLED=True"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
[tool.isort]
profile = "black"
known_third_party = [
"grpcio",
"grpcio_tools",
"loguru",
"protobuf",
"pydantic",
"python_dotenv",
"python_dateutil",
"pyyaml",
"urllib3",
]
extend_skip = ["hatchet_sdk/contracts/", "hatchet_sdk/v0/contracts/"]
[tool.black]
extend_exclude = "(hatchet_sdk/contracts/|hatchet_sdk/v0/contracts/|site)"
[tool.mypy]
files = ["."]
exclude = [
"hatchet_sdk/clients/rest/api/*",
"hatchet_sdk/clients/rest/models/*",
"hatchet_sdk/contracts",
"hatchet_sdk/clients/rest/api_client.py",
"hatchet_sdk/clients/rest/configuration.py",
"hatchet_sdk/clients/rest/exceptions.py",
"hatchet_sdk/clients/rest/rest.py",
"hatchet_sdk/v0/*",
"site/*",
]
strict = true
enable_error_code = [
"possibly-undefined",
"truthy-bool",
"redundant-expr",
"truthy-iterable",
]
[tool.ruff]
exclude = [
"hatchet_sdk/clients/rest/api/*",
"hatchet_sdk/clients/rest/models/*",
"hatchet_sdk/contracts",
"hatchet_sdk/clients/rest/api_client.py",
"hatchet_sdk/clients/rest/configuration.py",
"hatchet_sdk/clients/rest/exceptions.py",
"hatchet_sdk/clients/rest/rest.py",
"hatchet_sdk/v0/*",
"site/*",
]
target-version = "py310"
[tool.ruff.lint]
select = [
# Pyflakes
"F",
# pycodestyle errors
"E",
# pycodestyle warnings
"W",
# isort
"I",
# pep8-naming
"N",
# pyupgrade (modern Python idioms)
"UP",
# flake8-async (async/await)
"ASYNC",
# flake8-bugbear (likely bugs)
"B",
# flake8-simplify (code simplification)
"SIM",
# flake8-comprehensions (list/dict comprehensions)
"C4",
# flake8-pie (misc improvements)
"PIE",
# flake8-return (return statement improvements)
"RET",
# flake8-unused-arguments
"ARG",
# flake8-logging-format
"G",
# Ruff-specific rules
"RUF",
# Datetime (timezone) rules
"DTZ",
"FIX",
## Performance-related rules
"PERF",
# Print statements
"T201",
]
ignore = [
# Allow long lines
"E501",
# Allow complex variable names
"N806",
# Don't enforce specific exception types initially
"B008",
# Allow unused function arguments
"ARG001",
"ARG002",
# Allow empty returns
"RET503",
## FIXME (ironic) - re-enable this later
"FIX",
"RET506",
]
exclude = [
"examples/*",
"docs/*",
"hatchet_sdk/clients/rest/api/*",
"hatchet_sdk/clients/rest/models/*",
"hatchet_sdk/contracts",
"hatchet_sdk/clients/rest/api_client.py",
"hatchet_sdk/clients/rest/configuration.py",
"hatchet_sdk/clients/rest/exceptions.py",
"hatchet_sdk/clients/rest/rest.py",
"hatchet_sdk/v0/*",
"apply_patches.py",
"site/*",
"tests/*",
]
[tool.poetry.scripts]
api = "examples.api.api:main"
async = "examples.async.worker:main"
fanout = "examples.fanout.worker:main"
fanout_sync = "examples.fanout_sync.worker:main"
cancellation = "examples.cancellation.worker:main"
concurrency_limit = "examples.concurrency_limit.worker:main"
concurrency_limit_rr = "examples.concurrency_limit_rr.worker:main"
dag = "examples.dag.worker:main"
delayed = "examples.delayed.worker:main"
events = "examples.events.worker:main"
logger = "examples.logger.worker:main"
manual_trigger = "examples.manual_trigger.worker:main"
on_failure = "examples.on_failure.worker:main"
programatic_replay = "examples.programatic_replay.worker:main"
dynamic_rate_limit = "examples.rate_limit.dynamic:main"
rate_limit = "examples.rate_limit.worker:main"
simple = "examples.simple.worker:main"
timeout = "examples.timeout.worker:main"
blocked = "examples.blocked_async.worker:main"
existing_loop = "examples.worker_existing_loop.worker:main"
bulk_fanout = "examples.bulk_fanout.worker:main"
retries_with_backoff = "examples.retries_with_backoff.worker:main"
pydantic = "examples.pydantic.worker:main"
v2_simple = "examples.v2.simple.worker:main"
otel = "examples.opentelemetry_instrumentation.worker:main"
waits = "examples.waits.worker:main"
durable = "examples.durable.worker:main"
streaming = "examples.streaming.worker:main"
lifespans = "examples.lifespans.worker:main"
docs-gen = "docs.generator.generate:main"
[tool.pydoclint]
style = 'sphinx'
exclude = 'v0|clients/rest/*|contracts/*|.venv|site/*'
arg-type-hints-in-docstring = false # Automatically checked by mypy and mkdocs
check-return-types = false # Automatically checked by mypy and mkdocs
[tool.poetry.plugins."mkdocs.plugins"]
"markdown-export" = "docs.generator.markdown_export:MarkdownExportPlugin"