forked from localstack/localstack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
310 lines (284 loc) · 10.9 KB
/
pyproject.toml
File metadata and controls
310 lines (284 loc) · 10.9 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
298
299
300
301
302
303
304
305
306
307
308
309
310
# LocalStack project configuration
[build-system]
requires = ['setuptools>=64', 'wheel', 'setuptools_scm>=8.1']
build-backend = "setuptools.build_meta"
[project]
name = "localstack-core"
authors = [
{ name = "LocalStack Contributors", email = "info@localstack.cloud" }
]
description = "The core library and runtime of LocalStack"
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = [
"asn1crypto>=1.5.1",
"click>=8.2.0",
"cachetools>=5.0",
"cryptography",
"dnslib>=0.9.10",
"dnspython>=1.16.0",
"plux>=1.14.0",
"psutil>=5.4.8",
"python-dotenv>=0.19.1",
"pyyaml>=5.1",
"rich>=12.3.0",
"requests>=2.20.0",
"semver>=2.10",
]
dynamic = ["version", "entry-points"]
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.13",
"Topic :: Internet",
"Topic :: Software Development :: Testing",
"Topic :: System :: Emulators",
]
[tool.setuptools_scm]
version_file = "localstack-core/localstack/version.py"
# pypi does not support local versions:
# https://setuptools-scm.readthedocs.io/en/latest/usage/#default-versioning-scheme
local_scheme = "no-local-version"
[project.urls]
Homepage = "https://localstack.cloud"
Documentation = "https://docs.localstack.cloud"
Repository = "https://github.com/localstack/localstack.git"
Issues = "https://github.com/localstack/localstack/issues"
[project.optional-dependencies]
# minimal required to actually run localstack on the host for services natively implemented in python
base-runtime = [
# pinned / updated by ASF update action
"boto3==1.42.54",
# pinned / updated by ASF update action
"botocore==1.42.54",
# transitive dependency of botocore, added to avoid specific version
"awscrt>=0.13.14,!=0.27.1",
"cbor2>=5.5.0",
"dill==0.3.6",
"dnspython>=1.16.0",
"docker>=6.1.1",
"jsonpatch>=1.24",
"jsonpointer>=3.0.0",
"jsonschema>=4.25.1",
"hypercorn>=0.14.4",
"localstack-twisted>=25.0",
"openapi-core>=0.19.2",
"pydantic>=2.11.9",
"pyopenssl>=23.0.0",
"python-dateutil>=2.9.0",
"readerwriterlock>=1.0.7",
"requests-aws4auth>=1.0",
# explicitly set urllib3 to force its usage / ensure compatibility
"urllib3>=2.0.7",
"Werkzeug>=3.1.3",
"xmltodict>=0.13.0",
"rolo>=0.8.1",
]
# required to actually run localstack on the host
runtime = [
"localstack-core[base-runtime]",
# pinned / updated by ASF update action
"awscli==1.44.44",
"airspeed-ext>=0.6.3",
# antlr4-python3-runtime: exact pin because antlr4 runtime is tightly coupled to the generated parser code
"antlr4-python3-runtime==4.13.2",
"apispec>=5.1.1",
# pinning it to a higher version than what moto-ext requires
"aws-sam-translator>=1.105.0",
"crontab>=0.22.6",
"cryptography>=41.0.5",
"jinja2>=3.1.6",
# allow Python programs full access to Java class libraries. Used for stepfunctions jsonata support
"jpype1>=1.6.0",
"jsonpath-ng>=1.6.1",
"jsonpath-rw>=1.4.0",
# version that has a built wheel
"kclpy-ext>=3.0.0",
"moto-ext[all]>=5.1.22",
"opensearch-py>=2.4.1",
"pymongo>=4.2.0",
"pyopenssl>=23.0.0",
"responses>=0.25.8",
]
# for running tests and coverage analysis
test = [
# runtime dependencies are required for running the tests
"localstack-core[runtime]",
"coverage[toml]>=5.5",
"httpx[http2]>=0.25",
"json5>=0.12.1",
"pluggy>=1.3.0",
"pytest>=7.4.2",
"pytest-split>=0.8.0",
"pytest-httpserver>=1.1.2",
"pytest-rerunfailures>=12.0",
"pytest-tinybird>=0.5.0",
"aws-cdk-lib>=2.88.0",
"websocket-client>=1.7.0",
"localstack-snapshot>=0.1.1",
]
# for developing localstack
dev = [
# test dependencies are required for developing localstack
"localstack-core[test]",
"coveralls>=3.3.1",
"deptry>=0.13.0",
"Cython",
"networkx>=2.8.4",
"openapi-spec-validator>=0.7.1",
"pandoc",
"pre-commit>=3.5.0",
"pypandoc",
"ruff>=0.3.3",
"rstr>=3.2.0",
"mypy",
"watchdog>=6",
]
# not strictly necessary for development, but provides type hint support for a better developer experience
typehint = [
# typehint is an optional extension of the dev dependencies
"localstack-core[dev]",
# pinned / updated by ASF update action
"boto3-stubs[acm,acm-pca,amplify,apigateway,apigatewayv2,appconfig,appconfigdata,application-autoscaling,appsync,athena,autoscaling,backup,batch,ce,cloudcontrol,cloudformation,cloudfront,cloudtrail,cloudwatch,codebuild,codecommit,codeconnections,codedeploy,codepipeline,codestar-connections,cognito-identity,cognito-idp,dms,docdb,dynamodb,dynamodbstreams,ec2,ecr,ecs,efs,eks,elasticache,elasticbeanstalk,elbv2,emr,emr-serverless,es,events,firehose,fis,glacier,glue,iam,identitystore,iot,iot-data,iotwireless,kafka,kinesis,kinesisanalyticsv2,kms,lakeformation,lambda,logs,managedblockchain,mediaconvert,mq,mwaa,neptune,opensearch,organizations,pi,pipes,pinpoint,rds,rds-data,redshift,redshift-data,resource-groups,resourcegroupstaggingapi,route53,route53resolver,s3,s3control,sagemaker,sagemaker-runtime,secretsmanager,serverlessrepo,servicediscovery,ses,sesv2,sns,sqs,ssm,sso-admin,stepfunctions,sts,timestream-query,timestream-write,transcribe,verifiedpermissions,wafv2,xray]",
]
[tool.setuptools]
include-package-data = false
# TODO using this is discouraged by setuptools, `project.scripts` should be used instead
# However, `project.scripts` does not support non-python scripts.
script-files = [
"bin/localstack-supervisor",
]
package-dir = { "" = "localstack-core" }
[tool.setuptools.dynamic]
readme = { file = ["README.md"], content-type = "text/markdown" }
entry-points = { file = ["plux.ini"] }
[tool.setuptools.packages.find]
where = ["localstack-core/"]
include = ["localstack*"]
exclude = ["tests*"]
[tool.setuptools.package-data]
"*" = [
"*.md",
"Makefile",
]
"localstack" = [
"aws/**/*.json",
"services/**/*.html",
"services/**/resource_providers/**/*.schema.json",
"utils/kinesis/java/cloud/localstack/*.*",
"openapi.yaml",
"http/resources/swagger/templates/index.html"
]
[tool.ruff]
# Generate code compatible with version defined in .python-version
target-version = "py313"
line-length = 100
src = ["localstack-core", "tests"]
exclude = [
".venv*",
"venv*",
"dist",
"build",
"target",
"*.egg-info",
"localstack-core/*.egg-info",
".filesystem",
"localstack-core/.filesystem",
".git",
"localstack-core/localstack/services/stepfunctions/asl/antlr/runtime"
]
[tool.ruff.per-file-target-version]
# Only allow minimum version for code used in the CLI
"localstack-core/localstack/cli/**" = "py310"
"localstack-core/localstack/packages/**" = "py310"
"localstack-core/localstack/config.py" = "py310"
"localstack-core/localstack/constants.py" = "py310"
"localstack-core/localstack/utils/**" = "py310" # imported by CLI tests
"localstack-core/localstack/testing/pytest/**" = "py310" # imported by CLI tests
"localstack-core/localstack/aws/connect.py" = "py310" # imported by CLI tests
[tool.deptry]
known_first_party = [
"vosk", # managed by localstack package manager
"debugpy", # managed by localstack package manager
]
extend_exclude = [
"scripts/**", # dependencies not handled by pyproject.toml
"localstack-core/localstack/testing/**", # utilities for testing
"localstack-core/localstack/aws/mocking.py", # not used at runtime
"localstack-core/localstack/aws/scaffold.py", # not used at runtime
"localstack-core/localstack/dev/**", # internal dev tooling
"localstack-core/localstack/services/stepfunctions/asl/antlr/runtime/**" # generated code
]
pep621_dev_dependency_groups = ["dev", "typehint", "test"]
[tool.deptry.package_module_name_map]
"localstack-core" = ["localstack"]
[tool.deptry.per_rule_ignores]
DEP001 = [
"com", # This appears in jpype code and imports actual java packages like com.fasterxml.jackson.databind
"stevedore", # used for CLI plugin debugging - TODO move this debugging CLI into plux
]
DEP002 = [
"awscli", # necessary for python init scripts - TODO deprecate python init scripts and remove this
"awscrt", # defined to ignore a specific version - TODO evaluate and clean up
]
[tool.ruff.lint]
ignore = [
"B007", # TODO Loop control variable x not used within loop body
"B019", # TODO Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks
"B022", # TODO No arguments passed to `contextlib.suppress`. No exceptions will be suppressed and therefore this context manager is redundant
"B023", # TODO Function definition does not bind loop variable `server`
"B024", # TODO x is an abstract base class, but it has no abstract methods
"B027", # TODO `Server.do_shutdown` is an empty method in an abstract base class, but has no abstract decorator
"B904", # TODO Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling
"C901", # TODO function is too complex
"E402", # TODO Module level import not at top of file
"E501", # E501 Line too long - handled by black, see https://docs.astral.sh/ruff/faq/#is-ruff-compatible-with-black
"T201", # TODO `print` found
"T203", # TODO `pprint` found
]
select = ["B", "C", "E", "F", "I", "W", "T", "B9", "G", "UP"]
extend-safe-fixes = [
"UP006", # unsafe-fix for py39
"UP035", # unsafe-fix for py39
]
# The rules below fill fix the code in a way that leaves multiple unused imports.
# Since F401 (removing unused imports) is currently an unsafe fix, these imports cannot be automatically removed.
# Therefore, we temporarily disable the rules below for __init__ files.
[tool.ruff.lint.per-file-ignores]
"tests/aws/services/lambda_/functions/**" = ["UP"] # lambda tests parametrize the runtime
[tool.ruff.lint.pyupgrade]
# Avoid PEP 604 rewrites (e.g. Union[str, int] -> str | int), even with the `from __future__ import annotations`
# import. It only affects py39 and can be removed after we drop it.
keep-runtime-typing = true
[tool.coverage.run]
relative_files = true
source = [
"localstack",
]
omit = [
"*/aws/api/*",
"*/extensions/api/*",
"*/services/stepfunctions/asl/antlr/runtime/*"
]
dynamic_context = "test_function"
[tool.coverage.paths]
source = [
"localstack-core"
]
[tool.coverage.report]
exclude_lines = [
"if __name__ == .__main__.:",
"raise NotImplemented.",
"return NotImplemented",
"def __repr__",
]
[tool.pytest.ini_options]
log_cli = false
log_level = "DEBUG"
log_cli_format = "%(asctime)s.%(msecs)03d %(levelname)5s --- [%(threadName)12s] %(name)-26s : %(message)s"
log_cli_date_format = "%Y-%m-%dT%H:%M:%S"
[tool.pip-tools]
# adding localstack-core itself here because it is referenced in the pyproject.toml for stacking the extras
# pip, setuptools, and distribute are pip-tools defaults which need to be set again here
unsafe-package = ["localstack-core", "pip", "setuptools", "distribute"] # packages that should not be pinned
[tool.plux]
entrypoint_build_mode = "manual"