-
Notifications
You must be signed in to change notification settings - Fork 65
/
pyproject.toml
356 lines (328 loc) · 10.8 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
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
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
[tool.poetry]
name = "runway"
version = "0.0.0"
authors = [
"Rackspace Technology, Inc. <[email protected]>",
]
classifiers = [
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.9",
"Topic :: Utilities",
]
description = "Simplify infrastructure/app testing/deployment"
documentation = "https://runway.readthedocs.io"
homepage = "https://github.com/rackspace/runway"
keywords = ["cli"]
license = "Apache-2.0"
maintainers = [
"Kyle Finley <[email protected]>",
"Sam Fakhreddine <[email protected]>",
]
packages = [
{include = "runway"},
]
readme = "README.md"
repository = "https://github.com/rackspace/runway"
[tool.poetry.dependencies]
python = ">=3.9, <3.13"
awacs = "*"
boto3 = "^1.34.50"
cfn-lint = "*"
cfn_flip = "^1.2" # only used in runway._cli.commands._gen_sample.utils
click = "^8.0"
coloredlogs = "*, !=15.0.1"
docker = ">=3.0.0" # used in runway.cfngin.hooks
eval-type-backport = {python = "< 3.10", version = "*"} # TODO (kyle): remove when dropping support for python 3.9
formic2 = "*" # only used in runway.cfngin.hooks.aws_lambda
gitpython = "*"
igittigitt = ">=2.0.5"
jinja2 = ">=2.7" # used in runway.cfngin.blueprints.raw
packaging = "*" # component of setuptools needed for version compare
pyOpenSSL = "*" # For embedded hook & associated script usage
pydantic = "^2.8.0"
pyhcl = "^0.4" # does not support HCL2, possibly move to extras_require in the future
python-hcl2 = ">=3.0.0"
pyyaml = ">5.4"
requests = "*"
tomli = ">=1.2.2"
troposphere = ">=2.4, <5"
typing_extensions = "*" # only really needed for < 3.8 but can still be used in >= 3.8
yamllint = "*"
[tool.poetry.group.dev.dependencies]
pre-commit = "^4.0.1"
[tool.poetry.group.docs.dependencies]
autodoc-pydantic = "^2.2.0"
doc8 = "^1.1.2"
furo = "^2024.8.6"
jsx-lexer = "^2.0.1"
sphinx = "^7.4.7"
sphinx-copybutton = "^0.5.2"
sphinx-design = "^0.6.1"
sphinx-github-changelog = "^1.4.0"
sphinx-notfound-page = "^1.0.4"
sphinxcontrib-apidoc = "^0.5.0"
sphinxcontrib-external-links = "^0.1.1"
sphinxcontrib-jquery = "^4.1"
sphinxcontrib-programoutput = "^0.17"
[tool.poetry.group.lint.dependencies]
black = "^24.10.0"
ruff = "^0.7.4"
[tool.poetry.group.test.dependencies]
coverage = {extras = ["toml"], version = "^7.6.9"}
moto = {extras = ["ec2", "ecs", "iam", "s3", "ssm"], version = "^5.0.23"}
pipenv = "^2024.4.0" # only used in tests
pytest = "^8.3.4"
pytest-cov = "^6.0.0"
pytest-mock = "^3.14.0"
pytest-order = "^1.3.0"
pytest-subprocess = "^1.5.2"
pytest-sugar = "^1.0.0"
pytest-xdist = {extras = ["psutil"], version = "^3.6.1"}
testfixtures = "^8.3.0" # TODO (kyle) remove use of this dependency - was inherited
tomli-w = "^1.1.0"
[tool.poetry.group.types.dependencies]
mypy-boto3 = "^1.35.70" # importable boto3 type annotations
[tool.poetry.group.types.dependencies.boto3-stubs]
extras = [
"acm",
"awslambda",
"cloudformation",
"cloudfront",
"cognito-idp",
"dynamodb",
"ec2",
"ecr",
"ecs",
"iam",
"kms",
"lambda",
"route53",
"s3",
"ssm",
"sts",
]
version = "^1.35.83"
[tool.poetry.scripts]
runway = "runway._cli.main:cli"
[tool.poetry.urls]
"Bug Tracker" = "https://github.com/rackspace/runway/issues"
[tool.black]
force-exclude = '''
/(
\.eggs
| \.git
| \.demo
| \.hg
| \.mypy_cache
| \.runway
| \.tox
| \.venv
| _build
| build
| dist
| runway/aws_sso_botocore
)/
'''
include = '\.pyi?$'
line-length = 100
target-version = ["py310", "py311", "py312", "py39"]
[tool.coverage.report]
exclude_lines = [
"@overload",
"cov: ignore", # standard exclude comment
"from pathlib import Path",
"if TYPE_CHECKING:", # excluded blocks
"if __name__ == .__main__.:",
"raise AssertionError", # defensive exceptions
"raise NotImplementedError",
]
fail_under = 85
precision = 2
show_missing = true
[tool.coverage.run]
concurrency = [
"multiprocessing",
"thread",
]
omit = [
"*/compat.py",
"*/runway/aws_sso_botocore/*", # TODO remove native support is added to botocore
"*/runway/cfngin/hooks/staticsite/auth_at_edge/templates/*",
"*/type_defs.py",
]
[tool.poetry-dynamic-versioning] # poetry self add "poetry-dynamic-versioning[plugin]"
bump = true
enable = true
fix-shallow-repository = true
metadata = false
strict = true
style = "pep440"
[tool.pyright]
exclude = [
"**/.demo",
"**/.eggs",
"**/.git",
"**/.runway",
"**/.venv",
"**/__pycache__",
"**/docs",
"**/node_modules",
"**/quickstarts",
"**/runway/aws_sso_botocore",
"**/runway/cfngin/hooks/staticsite/auth_at_edge/templates",
"**/runway/templates/cdk-py",
"**/tests/functional/cfngin/test_aws_lambda_hook/lambda_src",
"**/tests/unit",
"**/typings",
]
pythonPlatform = "All"
pythonVersion = "3.9"
reportDuplicateImport = "none"
reportImportCycles = "none"
reportMissingTypeStubs = "none"
reportPrivateUsage = "none"
reportUnknownMemberType = "none"
reportUnnecessaryIsInstance = "warning"
reportUnnecessaryTypeIgnoreComment = "error"
reportUnusedImport = "none"
reportUnusedVariable = "none"
strictParameterNoneValue = false
typeCheckingMode = "strict"
useLibraryCodeForTypes = true
venv = ".venv"
[tool.pytest.ini_options]
addopts = [
"--cov-config=pyproject.toml",
"--no-cov-on-fail",
]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::pytest_mock.PytestMockWarning",
]
markers = [
"wip: isolate tests currently being worked on.",
]
minversion = 6.0
python_classes = ["Test*"]
python_files = ["test_*.py"]
python_functions = ["test_*"]
testpaths = ["tests"]
[tool.ruff] # https://docs.astral.sh/ruff/settings/#top-level
extend-exclude = [
"runway/aws_sso_botocore", # NOTE (kyle): ignoring vendored code
"runway/cfngin/hooks/staticsite/auth_at_edge/templates", # TODO (kyle): resolve lint error
"typings",
]
force-exclude = true
line-length = 120
show-fixes = true
target-version = "py39" # important to set before applying fixes
[tool.ruff.lint] # https://docs.astral.sh/ruff/settings/#lint
extend-safe-fixes = [
"UP006",
"UP007",
"UP038",
"UP040",
]
ignore = [
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed # TODO (kyle): improve type annotations
"COM812", # Trailing comma missing
"D203", # 1 blank line required before class docstring
"D213", # Multi-line docstring summary should start at the second line
"D215", # Section underline is over-indented
"D403", # First word of the first line should be capitalized
"D406", # Section name should end with a newline
"D407", # Missing dashed underline after section
"D408", # Section underline should be in the line following the section's name
"D409", # Section underline should match the length of its name
"DTZ", # flake8-datetimez # NOTE (kyle): this is fine here
"EM", # flake8-errmsg
"ERA001", # Found commented-out code # NOTE (kyle): incorrectly detects cspell
"FA100", # Missing `from __future__ import annotations`, but uses `typing.Optional`
"FBT001", # Boolean positional arg in function definition
"FBT002", # Boolean default value in function definition
"FBT003", # Boolean positional value in function call
"FIX002", # Line contains TODO
"N818", # Exception name should be named with an Error suffix # TODO (kyle): resolve in next major release
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PGH003", # Use specific rule codes when ignoring type issues # TODO (kyle): resolve this eventually
"RUF012", # TODO (kyle): remove when resolved - https://github.com/astral-sh/ruff/issues/5243
"S105", # (hardcoded-password-string) Possible hardcoded password
"S106", # (hardcoded-password-func-arg) Possible hardcoded password
"S107", # (hardcoded-password-default) Possible hardcoded password
"S108", # Probable insecure usage of temporary file or directory
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data
"S60", # flake8-bandit # NOTE (kyle): most of these are for subprocess which we don't care about right now
"S604", # Function call with `shell=True` parameter identified # NOTE (kyle): required for runway
"TD003", # Missing issue link on the line following this TODO
"TID252", # Relative imports from parent modules are banned
"TRY", # tryceratops
]
select = ["ALL"]
[tool.ruff.lint.extend-per-file-ignores] # https://docs.astral.sh/ruff/settings/#lintextend-per-file-ignores
"*.py" = [
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple` # NOTE (kyle): should only apply to pyi
]
"runway/templates/*" = [
"N999", # Invalid module name # NOTE (kyle): these are fine here
]
"tests/*" = [
"PT004", # Fixture does not return anything, add leading underscore
"S101", # Use of `assert` detected # NOTE (kyle): this is fine here
"SLF001", # Private member accessed # NOTE (kyle): fine in tests
]
[tool.ruff.lint.flake8-annotations] # https://docs.astral.sh/ruff/settings/#lintflake8-annotations
allow-star-arg-any = true
[tool.ruff.lint.flake8-pytest-style] # https://docs.astral.sh/ruff/settings/#lintflake8-pytest-style
parametrize-names-type = "csv" # TODO (kyle): update tests to remove the need for this
[tool.ruff.lint.flake8-self]
ignore-names = [
"_Environ",
"_Hash",
"_session",
]
[tool.ruff.lint.flake8-type-checking] # https://docs.astral.sh/ruff/settings/#lint_flake8-type-checking_runtime-evaluated-base-classes
runtime-evaluated-base-classes = [
"pydantic.BaseModel",
"pydantic.BeforeValidator",
"runway.cfngin.hooks.base.HookArgsBaseModel",
"runway.config.models.base.ConfigProperty",
"runway.utils.BaseModel",
]
[tool.ruff.lint.isort] # https://docs.astral.sh/ruff/settings/#lintisort
known-local-folder = [
"jwks_rsa",
"shared",
"update_urls",
]
known-third-party = [
"docker", # NOTE (kyle): the `docker/` directory confuses isort
]
[tool.ruff.lint.pydocstyle] # https://docs.astral.sh/ruff/settings/#lintpydocstyle
convention = "google"
[tool.ruff.lint.pylint] # https://docs.astral.sh/ruff/settings/#lintpylint
allow-magic-value-types = ["bytes", "int", "str"]
max-args = 15
max-returns = 10
max-statements = 50
[tool.ruff.lint.pyupgrade] # https://docs.astral.sh/ruff/settings/#pyupgrade-keep-runtime-typing
keep-runtime-typing = true # TODO (kyle): remove when dropping support for python 3.9
[tool.tomlsort]
all = true
in_place = true
sort_first = ["tool", "tool.poetry"]
spaces_before_inline_comment = 2
trailing_comma_inline_array = true
overrides."tool.poetry".first = ["name", "version"]
overrides."tool.poetry.dependencies".first = ["python"]
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
requires = ["poetry-core", "poetry-dynamic-versioning>=1.2.0,<2.0.0"]