-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpyproject.toml
218 lines (202 loc) · 4.51 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
[project]
name = "evo-featureflags-server"
dynamic = ["version"]
description = "Feature flags server"
readme = "README.md"
authors = [
{ name = "d.zakharchuk", email = "[email protected]" },
{ name = "m.kindritskiy", email = "[email protected]" },
{ name = "Vladimir Magamedov", email = "[email protected]" },
]
dependencies = [
"grpclib==0.4.6",
"hiku==0.7.5",
"protobuf<4.0.0",
"sqlalchemy[mypy]==1.4.42",
"aiopg[sa]==1.4.0",
"psycopg2==2.9.7",
"graphql-core==3.2.3",
"prometheus-client==0.17.1",
"alembic==1.12.0",
"metricslog==0.1.3",
"pyyaml==6.0.1",
"pyjwt==2.8.0",
"ldap3==2.9.1",
"pydantic>=2.3.0",
"pydantic-settings>=2.0.3",
"setuptools==68.2.2",
"fastapi>=0.103.2",
"orjson>=3.9.8",
"uvloop>=0.17.0",
"httptools>=0.6.0",
"uvicorn[standart]>=0.23.2",
"typer>=0.9.0",
"jinja2>=3.1.2",
"dependency-injector>=4.41.0",
"grpcio>=1.59.0",
"prometheus-fastapi-instrumentator>=6.1.0",
]
requires-python = ">=3.11"
license = { text = "MIT" }
[project.optional-dependencies]
sentry = ["sentry-sdk[fastapi,grpcio]>=1.40.5"]
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool]
[tool.pdm.version]
source = "file"
path = "featureflags/__init__.py"
[tool.pdm.scripts]
release = "./scripts/release.sh"
test = "python -m pytest {args}"
docs = "sphinx-build -a -b html docs public"
ruff = "ruff check featureflags {args} --fix"
ruff-diff = "ruff check featureflags {args}"
mypy = "mypy featureflags {args}"
black = "black featureflags {args}"
fmt = { composite = ["black", "ruff"] }
[tool.pdm.dev-dependencies]
test = [
"pytest~=7.4",
"pytest-asyncio~=0.21",
"faker~=19.6.1",
"tox-pdm~=0.7.0",
]
lint = [
"black~=23.9.1",
"ruff>=0.0.292",
"mypy>=1.6.0",
"types-protobuf>=4.24.0.20240106",
"types-PyYAML>=6.0.12.12",
"sqlalchemy-stubs>=0.4",
]
dev = ["watchfiles~=0.20.0", "ipython~=8.15.0"]
docs = [
"sphinx==7.2.5",
"sphinx-rtd-theme==1.3.0",
"sphinxcontrib-asyncio==0.3.0",
]
[tool.pytest.ini_options]
addopts = "-p no:warnings -p no:cacheprovider -q --tb=native"
filterwarnings = ["ignore::DeprecationWarning:google.*"]
log_cli = true
testpaths = ["featureflags/tests"]
asyncio_mode = "auto"
[tool.black]
line-length = 80
target-version = ['py311']
extend-exclude = '''
/(
| .git
| __pycache__
| __pypackages__
| .venv
| venv
| .ve
| featureflags/protobuf
)/
'''
[tool.ruff]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # Pyflakes
"C90", # McCabe
"I", # isort
"N", # pep8-naming
"UP", # pyupgrade
"ASYNC", # flake8-async
"S", # bandit
"DTZ", # flake8-datetimez
"A", # flake8-builtins
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"T20", # flake8-print
"SIM", # flake8-simplify
"ERA", # eradicate
"PL", # pylint
"RUF", # ruff-specific
]
ignore = ["S101", "S104", "S105", "DTZ003", "DTZ006", "A003", "B008", "PLR0913"]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
".venv",
"venv",
".ve",
"__pycache__",
"featureflags/migrations",
"featureflags/protobuf",
]
line-length = 80
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py311"
[tool.ruff.per-file-ignores]
"featureflags/tests/*" = [
"A002",
"E501",
"S101",
"S105",
"S106",
"PLR2004",
"PLR0913",
"DTZ005",
"DTZ003",
]
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.isort]
known-first-party = ["featureflags"]
[tool.mypy]
python_version = "3.11"
follow_imports = "skip"
pretty = true
strict_optional = false
warn_no_return = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
ignore_missing_imports = true
plugins = ["sqlmypy", "sqlalchemy.ext.mypy.plugin"]
exclude = [
".git",
"__pycache__",
"__pypackages__",
".venv",
"venv",
".ve",
"featureflags/migrations",
"featureflags/protobuf",
"featureflags/tests",
]
[[tool.mypy.overrides]]
module = "hiku.*"
follow_imports = "skip"
[[tool.mypy.overrides]]
module = "featureflags.protobuf.*"
follow_imports = "skip"
disallow_untyped_decorators = false
disable_error_code = ["no-untyped-def", "attr-defined"]
[[tool.mypy.overrides]]
module = "featureflags.graph.proto_adapter"
disallow_untyped_decorators = false
disable_error_code = ["no-untyped-def", "attr-defined"]