forked from aws-deadline/deadline-cloud-worker-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
256 lines (218 loc) · 6.31 KB
/
pyproject.toml
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
[build-system]
requires = ["hatchling", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
name = "deadline-cloud-worker-agent"
authors = [
{name = "Amazon Web Services"},
]
dynamic = ["version"]
readme = "README.md"
license = "Apache-2.0"
dependencies = [
"requests ~= 2.31",
"boto3 >= 1.34.75",
"deadline == 0.48.*",
"openjd-sessions == 0.7.*",
# tomli became tomllib in standard library in Python 3.11
"tomli == 2.0.* ; python_version<'3.11'",
"typing_extensions ~= 4.8",
"psutil ~= 5.9",
"pydantic ~= 1.10.0",
"pywin32 == 306; platform_system == 'Windows'",
"requests == 2.31.*",
]
requires-python = ">=3.9"
description = "The AWS Deadline Cloud worker agent can be used to run a worker in an AWS Deadline Cloud fleet"
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: End Users/Desktop",
]
[project.urls]
Homepage = "https://github.com/aws-deadline/deadline-cloud-worker-agent"
Source = "https://github.com/aws-deadline/deadline-cloud-worker-agent"
[project.scripts]
deadline-worker-agent = "deadline_worker_agent:entrypoint"
install-deadline-worker = "deadline_worker_agent:install"
[tool.hatch.build]
artifacts = [
"*_version.py",
]
[tool.hatch.version]
source = "vcs"
# https://setuptools-scm.readthedocs.io/en/latest/extending/#version-number-construction
# Using "no-guess-dev", GitHub workflows are handling versioning.
raw-options = { version_scheme = "no-guess-dev", local_scheme = "no-local-version" }
[tool.hatch.build.hooks.vcs]
version-file = "_version.py"
[tool.hatch.build.hooks.custom]
path = "hatch_version_hook.py"
[[tool.hatch.build.hooks.custom.copy_map]]
sources = [
"_version.py",
]
destinations = [
"src/deadline_worker_agent",
]
[tool.hatch.build.targets.sdist]
include = [
"src/*",
"hatch_version_hook.py",
]
[tool.hatch.build.targets.wheel]
packages = [
"src/deadline_worker_agent",
]
[tool.mypy]
# See https://mypy.readthedocs.io/en/latest/config_file.html for more mypy options.
# Enables the type-checker on the interior of functions without type annotations.
check_untyped_defs = true
# Displaying specific error codes makes it easier to silence specific errors
# See also https://mypy.readthedocs.io/en/latest/error_codes.html
show_error_codes = true
# Show source code snippets and location markers in error messages
pretty = true
# Declare mypy plugins
plugins = [
"pydantic.mypy",
]
files = [ "src/**/*.py" ]
python_version = 3.9
ignore_missing_imports = true
# Ignore missing type annotations for the following packages
# See https://mypy.readthedocs.io/en/stable/config_file.html#using-a-pyproject-toml-file
[[tool.mypy.overrides]]
module = [
"requests",
"requests.exceptions",
"boto3.*",
"botocore.client",
"botocore.exceptions",
"botocore.*"
]
[tool.ruff]
line-length = 100
[tool.ruff.lint]
ignore = [
"E501",
"E722",
"F811",
]
[tool.ruff.lint.per-file-ignores]
# We need to use a platform assertion to short-circuit mypy type checking on non-Windows platforms
# https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks
# This causes imports to come after regular Python statements causing flake8 rule E402 to be flagged
"src/deadline_worker_agent/**/*windows*.py" = ["E402"]
"test/**/*windows*.py" = ["E402"]
[tool.ruff.lint.isort]
known-first-party = [
"deadline_worker_agent",
"deadline",
"openjd",
]
[tool.black]
line-length = 100
# Configuration for pytest; enable coverage for deadline_worker_agent, emit
# XML, HTML, and terminal reports.
[tool.pytest.ini_options]
xfail_strict = true
addopts = [
"--durations=5",
"--color=yes",
"--cov=src/deadline_worker_agent",
"--cov-report=html:build/coverage",
"--cov-report=xml:build/coverage/coverage.xml",
"--cov-report=term-missing",
]
testpaths = [ "test" ]
looponfailroots = [ "src", "test" ]
filterwarnings = [
"default",
"error::pytest.PytestUnhandledThreadExceptionWarning"
]
# Print live logs during test run. This will only take effect if tests are not run
# concurrently, since pytest-xdist does not support live logging.
log_cli = true
log_cli_level = "INFO"
[tool.coverage.run]
branch = true
parallel = false
source_pkgs = [ "deadline_worker_agent" ]
omit = [
# the mock boto implementation doesn't require tests
"*/boto/shim.py",
# TODO: Remove these once we have session test coverage
"*/api_models.py",
"*/errors.py",
"*/queue.py",
"*/scheduler/**/*.py",
"*/worker.py",
]
plugins = [
"coverage_conditional_plugin"
]
[tool.coverage.paths]
source = [ "src/" ]
[tool.coverage.report]
show_missing = true
fail_under = 78
# https://github.com/wemake-services/coverage-conditional-plugin
[tool.coverage.coverage_conditional_plugin.omit]
"sys_platform != 'win32'" = [
"src/deadline_worker_agent/windows/*.py",
"src/deadline_worker_agent/installer/win_installer.py"
]
[tool.coverage.coverage_conditional_plugin.rules]
# This cannot be empty otherwise coverage-conditional-plugin crashes with:
# AttributeError: 'NoneType' object has no attribute 'items'
#
# =========== WARNING TO REVIEWERS ============
#
# Any rules added here are ran through Python's
# eval() function so watch for code injection
# attacks.
#
# =========== WARNING TO REVIEWERS ============
[tool.semantic_release]
# Can be removed or set to true once we are v1
major_on_zero = false
tag_format = "{version}"
[tool.semantic_release.commit_parser_options]
allowed_tags = [
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"style",
"refactor",
"test",
]
minor_tags = []
patch_tags = [
"chore",
"feat",
"fix",
"refactor",
]
[tool.semantic_release.publish]
upload_to_vcs_release = false
[tool.semantic_release.changelog]
template_dir = ".semantic_release"
[tool.semantic_release.changelog.environment]
trim_blocks = true
lstrip_blocks = true
[tool.semantic_release.branches.release]
match = "(mainline|release)"