-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
166 lines (148 loc) · 4.45 KB
/
pyproject.toml
File metadata and controls
166 lines (148 loc) · 4.45 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
[build-system]
requires = ["hatchling", "hatch-vcs", "hatch-build-scripts", "ruff>=0.9.0"]
build-backend = "hatchling.build"
[project]
name = "zae-limiter"
dynamic = ["version"]
description = "Rate limiting library backed by DynamoDB with token bucket algorithm"
readme = {file = "README.md", content-type = "text/markdown"}
license = {file = "LICENSE"}
requires-python = ">=3.11"
authors = [
{ name = "ZeroAE", email = "dev@zeroae.com" },
]
keywords = ["rate-limiting", "dynamodb", "token-bucket", "aws", "llm", "api-rate-limit"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries :: Python Modules",
]
dependencies = [
"aioboto3>=12.0.0",
"aws-lambda-builders>=1.40.0",
"boto3>=1.34.0",
"click>=8.0.0",
"pip",
"python-ulid>=3.0.0",
"pyyaml>=6.0",
"questionary>=2.0",
]
[project.optional-dependencies]
dev = [
"boto3-stubs[dynamodb,s3,lambda,cloudformation,sts]>=1.34.0",
"cfn-lint>=1.43.3",
"diff-cover>=9.0.0",
"mypy>=1.8.0",
"moto[dynamodb]>=5.0.0",
"openapi-spec-validator>=0.7.1", # Required by moto but not declared
"pre-commit>=4.0.0",
"pytest>=8.0.0",
"pytest-asyncio>=0.23.0",
"pytest-benchmark>=4.0.0",
"pytest-cov>=4.0.0",
"pytest-repeat>=0.9.4",
"pytest-examples>=0.0.18",
"pytest-xdist>=3.5.0",
"ruff>=0.1.0",
"types-aiobotocore[dynamodb,s3]>=2.0.0",
"types-docker>=7.0.0",
"types-gevent>=24.0.0",
"types-PyYAML>=6.0",
]
lambda = [
"aws-lambda-powertools>=2.0.0",
]
plot = [
"asciichartpy>=1.5.25",
]
local = [
"docker>=7.0.0",
]
bench = [
"docker>=7.0.0",
"locust>=2.20",
"gevent>=23.0",
]
cdk = [
"aws-cdk-lib>=2.0.0",
"constructs>=10.0.0",
]
docs = [
"mkdocs>=1.6.0",
"mkdocs-click>=0.8.0",
"mkdocs-material>=9.5.0",
"mkdocstrings[python]>=0.27.0",
"mike>=2.1.0",
]
[project.urls]
Homepage = "https://github.com/zeroae/zae-limiter"
Documentation = "https://zeroae.github.io/zae-limiter/"
Repository = "https://github.com/zeroae/zae-limiter"
[project.scripts]
zae-limiter = "zae_limiter.cli:cli"
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/zae_limiter/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/zae_limiter", "src/zae_limiter_aggregator", "src/zae_limiter_provisioner"]
[[tool.hatch.build.hooks.build-scripts.scripts]]
commands = ["python scripts/generate_sync.py"]
[tool.hatch.envs.default.scripts]
generate-sync = "python scripts/generate_sync.py"
[tool.pytest.ini_options]
asyncio_mode = "auto"
testpaths = ["tests"]
pythonpath = ["."]
addopts = "-v --tb=short -n auto --dist loadscope --import-mode=importlib --benchmark-disable"
markers = [
"integration: marks tests as integration tests (require Docker or AWS)",
"benchmark: marks tests as performance benchmarks",
"aws: marks tests as real AWS tests (require --run-aws flag)",
"e2e: marks tests as end-to-end tests (full stack lifecycle)",
"slow: marks tests with significant wait times (>30s sleeps)",
"monitoring: marks tests that verify CloudWatch alarms, metrics, DLQ",
"snapshots: marks tests that verify usage snapshot creation",
"doctest: marks tests that validate documentation code examples",
"gevent: marks tests that trigger gevent monkey-patching (incompatible with xdist)",
]
filterwarnings = [
"ignore:StackOptions is deprecated:DeprecationWarning",
]
[tool.ruff]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "I", "N", "W", "UP"]
[tool.ruff.lint.per-file-ignores]
# Generated sync files: ast.unparse doesn't preserve line breaks in strings
"src/zae_limiter/sync_*.py" = ["E501"]
"src/zae_limiter/infra/sync_*.py" = ["E501"]
"tests/unit/test_sync_*.py" = ["E501"]
[tool.mypy]
python_version = "3.11"
strict = true
warn_return_any = true
warn_unused_ignores = true
exclude = ["tests/"]
[[tool.mypy.overrides]]
module = [
"aws_lambda_builders.*",
"aioboto3",
"aioboto3.*",
"ulid",
"zae_limiter._version",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["locust.*", "locustfile"]
ignore_missing_imports = true
[tool.coverage.run]
omit = [
# Generated sync files - coverage measured on async source only
"*/sync_*.py",
]