Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
297 lines (266 loc) · 11.4 KB
/
Copy pathpyproject.toml
File metadata and controls
297 lines (266 loc) · 11.4 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
[project]
name = "aws-durable-execution-sdk-python-monorepo"
version = "0.0.0"
requires-python = ">=3.11"
[tool.hatch.envs.default]
workspace.members = ["packages/*"]
[tool.hatch.envs.test]
detached = true
workspace.members = ["packages/*"]
dependencies = [
"coverage[toml]",
"pytest",
"pytest-cov",
"pytest-xdist",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
"aws-durable-execution-sdk-python-testing",
"PyYAML==6.0.2",
]
[tool.hatch.envs.test.scripts]
all = "pytest {args}"
cov = "pytest --cov-report=term-missing --cov {args}"
examples-integration = "pytest --runner-mode=cloud -m example packages/aws-durable-execution-sdk-python-examples/test/ -v {args}"
[tool.pytest.ini_options]
# Declare custom markers to avoid warnings with --strict-markers
addopts = "-v --strict-markers --import-mode=importlib"
testpaths = [
"packages/aws-durable-execution-sdk-python/tests",
"packages/aws-durable-execution-sdk-python-extras/tests",
"packages/aws-durable-execution-sdk-python-telemetry-exporter/tests",
"packages/aws-durable-execution-sdk-python-microvm-worker/tests",
"packages/aws-durable-execution-sdk-python-otel/tests",
"packages/aws-durable-execution-sdk-python-testing/tests",
"packages/aws-durable-execution-sdk-python-examples/test",
"packages/aws-durable-execution-sdk-python-conformance-tests/tests",
"packages/aws-durable-execution-sdk-python-conformance-tests-otel/tests",
"packages/aws-durable-execution-sdk-python-conformance-tests-telemetry/tests",
]
markers = [
# Used for test selection with -m example
"example: marks tests as example tests (deselect with '-m \"not example\"')",
# Used for configuration - passes handler and lambda_function_name to durable_runner fixture
"durable_execution: marks tests that use the durable_runner fixture (not used for test selection)",
]
[tool.hatch.envs.types]
detached = true
workspace.members = ["packages/*"]
extra-dependencies = [
"mypy>=1.0.0",
"pytest",
"boto3-stubs[lambda,lambda-microvms]",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
]
[tool.hatch.envs.types.scripts]
check = "bash .github/scripts/type-checks.sh"
[tool.hatch.envs.dev-core]
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-testing",
]
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"aws-durable-execution-sdk-python-testing",
"mypy>=1.0.0",
"boto3-stubs[lambda]",
]
[tool.hatch.envs.dev-core.scripts]
test = "pytest packages/aws-durable-execution-sdk-python/tests {args}"
cov = "pytest --cov-report=term-missing --cov-config=packages/aws-durable-execution-sdk-python/pyproject.toml --cov=packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python --cov-fail-under=98 packages/aws-durable-execution-sdk-python/tests {args}"
typecheck = "mypy --install-types --non-interactive packages/aws-durable-execution-sdk-python/src/aws_durable_execution_sdk_python packages/aws-durable-execution-sdk-python/tests"
[tool.hatch.envs.dev-otel]
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-otel",
"packages/aws-durable-execution-sdk-python-testing",
]
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
"mypy>=1.0.0",
]
[tool.hatch.envs.dev-otel.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-otel/tests {args}"
cov = "pytest --cov-report=term-missing --cov-config=packages/aws-durable-execution-sdk-python-otel/pyproject.toml --cov=packages/aws-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel packages/aws-durable-execution-sdk-python-otel/tests {args}"
typecheck = "mypy --install-types --non-interactive packages/aws-durable-execution-sdk-python-otel/src/aws_durable_execution_sdk_python_otel packages/aws-durable-execution-sdk-python-otel/tests"
[tool.hatch.envs.dev-extras]
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-extras",
"packages/aws-durable-execution-sdk-python-microvm-worker",
"packages/aws-durable-execution-sdk-python-testing",
]
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"mypy>=1.0.0",
"boto3-stubs[lambda,lambda-microvms]",
]
[tool.hatch.envs.dev-extras.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-extras/tests {args}"
cov = "pytest --cov-report=term-missing --cov-config=packages/aws-durable-execution-sdk-python-extras/pyproject.toml --cov=packages/aws-durable-execution-sdk-python-extras/src/aws_durable_execution_sdk_python_extras packages/aws-durable-execution-sdk-python-extras/tests {args}"
typecheck = "mypy --install-types --non-interactive packages/aws-durable-execution-sdk-python-extras/src/aws_durable_execution_sdk_python_extras packages/aws-durable-execution-sdk-python-extras/tests"
[tool.hatch.envs.dev-microvm-worker]
workspace.members = ["packages/aws-durable-execution-sdk-python-microvm-worker"]
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"mypy>=1.0.0",
"boto3-stubs[lambda,lambda-microvms]",
]
[tool.hatch.envs.dev-microvm-worker.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-microvm-worker/tests {args}"
cov = "pytest --cov-report=term-missing --cov-config=packages/aws-durable-execution-sdk-python-microvm-worker/pyproject.toml --cov=packages/aws-durable-execution-sdk-python-microvm-worker/src/aws_durable_execution_sdk_python_microvm_worker packages/aws-durable-execution-sdk-python-microvm-worker/tests {args}"
typecheck = "mypy --install-types --non-interactive packages/aws-durable-execution-sdk-python-microvm-worker/src/aws_durable_execution_sdk_python_microvm_worker packages/aws-durable-execution-sdk-python-microvm-worker/tests"
[tool.hatch.envs.dev-testing]
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-testing",
]
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"mypy>=1.0.0",
# .github/scripts/js_examples/run.py reads the JS examples' SAM template.
"PyYAML==6.0.2",
]
[tool.hatch.envs.dev-testing.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-testing/tests {args}"
cov = "pytest --cov-report=term-missing --cov-config=packages/aws-durable-execution-sdk-python-testing/pyproject.toml --cov=packages/aws-durable-execution-sdk-python-testing/src/aws_durable_execution_sdk_python_testing --cov-fail-under=95 packages/aws-durable-execution-sdk-python-testing/tests {args}"
typecheck = "mypy --install-types --non-interactive packages/aws-durable-execution-sdk-python-testing/src/aws_durable_execution_sdk_python_testing packages/aws-durable-execution-sdk-python-testing/tests"
js-examples = "python .github/scripts/js_examples/run.py {args}"
[tool.hatch.envs.dev-examples]
# The MicroVM examples import the extras. test-pypi-examples is meant to run
# the examples against the packages on PyPI. The extras are not published
# there. So the examples package does not depend on the extras. The
# environments that run the examples from this checkout add the extras as a
# workspace member instead. test-pypi-examples sets no workspace. So it
# inherits the default members and installs the extras from this checkout
# too. The MicroVM test modules call pytest.importorskip. So an environment
# without the extras skips them.
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-examples",
"packages/aws-durable-execution-sdk-python-extras",
"packages/aws-durable-execution-sdk-python-otel",
"packages/aws-durable-execution-sdk-python-testing",
]
dependencies = [
"pytest",
"aws-durable-execution-sdk-python-testing",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
]
[tool.hatch.envs.dev-examples.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-examples/test {args}"
# Install immutable artifacts built from this checkout, including before the
# first compatible core is published. No editable workspace packages in this lane.
[tool.hatch.envs.test-wheel-otel]
detached = true
workspace.members = []
dependencies = [
"aws-durable-execution-sdk-python-testing>=1.2.1",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
"pytest",
"packaging",
]
[tool.hatch.envs.test-wheel-otel.scripts]
test = [
"python .github/scripts/install_otel_test_wheels.py",
"pytest packages/aws-durable-execution-sdk-python-otel/tests {args}",
"pytest .github/tests/otel_lifecycle_compatibility_test.py {args}",
]
# Core 3 requires factories. Verify that real released OTel 1 registrations
# fail clearly instead of silently running with the incompatible lifecycle API.
[tool.hatch.envs.test-wheel-otel-legacy]
template = "test-wheel-otel"
detached = true
workspace.members = []
dependencies = [
"aws-durable-execution-sdk-python-otel==1.0.0",
"aws-durable-execution-sdk-python-testing>=1.2.1",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
"pytest",
"packaging",
]
[tool.hatch.envs.test-wheel-otel-legacy.env-vars]
OTEL_COMPAT_LEGACY = "1"
[tool.hatch.envs.test-wheel-otel-legacy.scripts]
test = [
"python .github/scripts/install_otel_test_wheels.py --legacy-plugin",
"pytest .github/tests/otel_legacy_registration_rejection_test.py {args}",
]
[tool.hatch.envs.test-pypi-examples]
dependencies = [
"aws-durable-execution-sdk-python",
"aws-durable-execution-sdk-python-testing",
"opentelemetry-sdk>=1.20.0",
"opentelemetry-propagator-aws-xray",
"pytest",
]
pre-install-commands = [
"pip install -e packages/aws-durable-execution-sdk-python-examples",
]
[tool.hatch.envs.test-pypi-examples.scripts]
test = "pytest packages/aws-durable-execution-sdk-python-examples/test {args}"
[tool.hatch.envs.examples]
workspace.members = [
"packages/aws-durable-execution-sdk-python",
"packages/aws-durable-execution-sdk-python-examples",
"packages/aws-durable-execution-sdk-python-extras",
"packages/aws-durable-execution-sdk-python-otel",
]
[tool.hatch.envs.examples.scripts]
generate-sam-template = "python packages/aws-durable-execution-sdk-python-examples/scripts/generate_sam_template.py"
build = "python packages/aws-durable-execution-sdk-python-examples/scripts/build_examples.py"
ensure-microvm-image = "python packages/aws-durable-execution-sdk-python-examples/scripts/ensure_microvm_image.py {args}"
clean = "rm -rf packages/aws-durable-execution-sdk-python-examples/build packages/aws-durable-execution-sdk-python-examples/template.generated.json packages/aws-durable-execution-sdk-python-examples/.microvm-image-build .aws-sam"
[tool.ruff]
line-length = 88
target-version = "py311"
exclude = [".github/scripts/*.sh", ".github/workflows"]
[tool.ruff.lint]
preview = true
select = ["E4", "E7", "E9", "F", "TID252"] # pycodestyle (E4/E7/E9) + Pyflakes + absolute imports
[tool.ruff.lint.isort]
known-first-party = [
"aws_durable_execution_sdk_python",
"aws_durable_execution_sdk_python_extras",
"aws_durable_execution_sdk_python_telemetry_exporter",
"aws_durable_execution_sdk_python_microvm_worker",
"aws_durable_execution_sdk_python_otel",
"aws_durable_execution_sdk_python_testing",
]
force-single-line = false
lines-after-imports = 2
[tool.ruff.lint.per-file-ignores]
"**/tests/**" = [
"ARG001",
"ARG002",
"ARG005",
"S101",
"PLR2004",
"PLR6301",
"SIM117",
"TRY301",
]
"**/test/**" = [
"ARG001",
"ARG002",
"ARG005",
"S101",
"PLR2004",
"SIM117",
"TRY301",
]