forked from temporalio/sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
141 lines (129 loc) · 4.68 KB
/
Copy pathpyproject.toml
File metadata and controls
141 lines (129 loc) · 4.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
[tool.poetry]
name = "temporalio"
version = "0.1a2"
description = "Temporal.io Python SDK"
license = "MIT"
authors = ["Temporal Technologies Inc <sdk@temporal.io>"]
readme = "README.md"
homepage = "https://github.com/temporalio/sdk-python"
repository = "https://github.com/temporalio/sdk-python"
documentation = "https://docs.temporal.io/docs/python"
keywords = ["temporal", "workflow"]
# We need to include proto source that is otherwise excluded via .gitignore.
# We have chosen to keep all source including Rust source in precompiled wheels
# for easy viewing. It is also complicated to exclude certain pieces for wheels
# with Poetry (see https://github.com/python-poetry/poetry/issues/3380).
include = ["temporalio/api/**/*", "temporalio/bridge/proto/**/*"]
exclude = ["temporalio/bridge/**/target"]
# Known undocumented API for hooking into setup. Unfortunately Poetry does not
# support this script in a subdirectory like scripts/.
[tool.poetry.build]
script = "build.py"
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/temporalio/sdk-python/issues"
[tool.poetry.dependencies]
dacite = "^1.6.0"
# Due to grpcio binaries not supporting macOS ARM currently (see
# https://github.com/grpc/grpc/issues/27506,
# https://github.com/grpc/grpc/issues/28387, etc) we would have to use
# non-binary. But until Poetry 1.2 is released and
# https://github.com/python-poetry/poetry/pull/5609 merged, it is not supported.
# We cannot use a direct dependency because PyPI fails the upload.
grpcio = "^1.46.3"
protobuf = "^3.20.1"
python = "^3.7"
types-protobuf = "^3.19.21"
typing-extensions = "^4.2.0"
[tool.poetry.dev-dependencies]
black = "^22.3.0"
grpcio-tools = "^1.46.0"
isort = "^5.10.1"
mypy = "^0.961"
mypy-protobuf = "^3.2.0"
pydocstyle = "^6.1.1"
# TODO(cretz): Update when https://github.com/twisted/pydoctor/pull/595 released
# pydoctor = "^22.5.1"
pydoctor = { git = "https://github.com/cretz/pydoctor.git", branch = "overloads" }
pytest = "^7.1.2"
pytest-asyncio = "^0.18.3"
pytest-timeout = "^2.1.0"
setuptools = "^62.3.3"
setuptools-rust = "^1.3.0"
toml = "^0.10.2"
twine = "^4.0.1"
[tool.poe.tasks]
build-develop = ["build-bridge-develop"]
build-bridge-develop = "python scripts/setup_bridge.py develop"
fix-wheel = "python scripts/fix_wheel.py"
format = [{cmd = "black ."}, {cmd = "isort ."}]
gen-docs = "pydoctor"
gen-protos = "python scripts/gen_protos.py"
lint = [
{cmd = "black --check ."},
{cmd = "isort --check-only ."},
{ref = "lint-types"},
{ref = "lint-docs"},
]
# TODO(cretz): Why does pydocstyle complain about @overload missing docs after
# https://github.com/PyCQA/pydocstyle/pull/511?
lint-docs = "pydocstyle --ignore-decorators=overload"
lint-types = "mypy ."
test = "pytest"
# Install local, run single pytest with env var, uninstall local
[tool.poe.tasks.test-dist-single]
ignore_fail = "return_non_zero"
# Has to be a child table due to the Python TOML decoder in many default pips
# failing on inline table with "Invalid inline table value encountered" because
# there's a comma (see https://github.com/uiri/toml/issues/348).
[[tool.poe.tasks.test-dist-single.sequence]]
cmd = "pip install --no-index --find-links=./dist temporalio"
[[tool.poe.tasks.test-dist-single.sequence]]
cmd = "pytest -k test_activity_hello"
env = { TEMPORAL_INTEGRATION_TEST = "1" }
[[tool.poe.tasks.test-dist-single.sequence]]
cmd = "pip uninstall temporalio -y"
[tool.pytest.ini_options]
asyncio_mode = "auto"
log_cli = true
log_cli_level = "INFO"
log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
timeout = 600
timeout_func_only = true
[tool.isort]
profile = "black"
skip_gitignore = true
[tool.mypy]
ignore_missing_imports = true
exclude = [
# Ignore generated code
'temporalio/api',
'temporalio/bridge/proto',
]
[tool.pydocstyle]
convention = "google"
# https://github.com/PyCQA/pydocstyle/issues/363#issuecomment-625563088
match_dir = "^(?!(docs|scripts|tests|api|proto|\\.)).*"
add_ignore = [
# We like to wrap at a certain number of chars, even long summary sentences.
# https://github.com/PyCQA/pydocstyle/issues/184
"D205", "D415"
]
[tool.pydoctor]
add-package = ["temporalio"]
docformat = "google"
html-output = "build/apidocs"
intersphinx = ["https://docs.python.org/3/objects.inv", "https://googleapis.dev/python/protobuf/latest/objects.inv"]
privacy = [
"PRIVATE:temporalio.bridge",
"HIDDEN:temporalio.worker.activity",
"HIDDEN:temporalio.worker.interceptor",
"HIDDEN:temporalio.worker.worker",
"HIDDEN:temporalio.worker.workflow",
"HIDDEN:temporalio.worker.workflow_instance",
"HIDDEN:**.*_pb2*",
]
project-name = "Temporal"
sidebar-expand-depth = 2
[build-system]
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core>=1.0.0", "setuptools", "wheel", "setuptools-rust"]