-
Notifications
You must be signed in to change notification settings - Fork 462
/
Copy pathpyproject.toml
224 lines (209 loc) · 7.42 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
[project]
name = "unstract"
version = "0.1.0"
requires-python = ">=3.12,<3.13"
dependencies = []
[dependency-groups]
dev = [
"docutils~=0.20.1",
"mypy~=1.9.0",
"pre-commit~=3.6.2",
"yamllint>=1.35.1",
"ruff<1.0.0,>=0.2.2",
"pytest>=8.0.1",
"pycln>=2.5.0",
"types-PyMySQL~=1.1.0.1",
"types-pyOpenSSL~=24.0.0.20240311",
"types-PyYAML~=6.0.12.12",
"types-redis~=4.6.0.3",
"types-requests~=2.31.0.6",
"types-tzlocal~=5.1.0.1",
]
hook-check-django-migrations = [
"celery>=5.3.4",
"cron-descriptor==1.4.0",
"django==4.2.1",
"djangorestframework==3.14.0",
# Pinning django-celery-beat to avoid build issues
"django-celery-beat==2.5.0",
"django-cors-headers>=4.3.1",
"django-redis==5.4.0",
"django-tenants==3.5.0",
"drf-yasg==1.21.7",
"social-auth-app-django==5.3.0",
"psycopg2-binary==2.9.9",
"python-dotenv==1.0.0",
"python-magic==0.4.27",
"unstract-sdk~=0.70.0",
"unstract-connectors",
"unstract-core",
"unstract-flags",
"unstract-tool-registry",
"unstract-tool-sandbox",
"unstract-workflow-execution",
"unstract-filesystem",
]
[tool.uv.sources]
unstract-filesystem = { path = "./unstract/filesystem", editable = true }
unstract-workflow-execution = { path = "./unstract/workflow-execution", editable = true }
unstract-tool-sandbox = { path = "./unstract/tool-sandbox", editable = true }
unstract-tool-registry = { path = "./unstract/tool-registry", editable = true }
unstract-flags = { path = "./unstract/flags", editable = true }
unstract-core = { path = "./unstract/core", editable = true }
unstract-connectors = { path = "./unstract/connectors", editable = true }
# === Development tool configurations ===
[tool.ruff]
line-length = 90
target-version = "py312"
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",
".*migrations/.*.py",
"tests",
]
[tool.ruff.lint]
select = [
"E", # pycodestyle (formatting)
"F", # Pyflakes (static analysis)
"I", # isort (import sorting)
"B", # bugbear (security/performance)
"W", # warnings
"C90", # mccabe complexity
"N", # pep8-naming
"D", # pydocstyle
"UP", # pyupgrade
"ANN", # flake8-annotations
"TCH", # flake8-type-checking
"PYI", # flake8-pyi
]
fixable = ["ALL"]
ignore = [
"ANN001", # Missing type annotation for function argument `value`
"ANN002", # Missing type annotation for `*args`"
"ANN003", # Missing type annotation for `**kwargs`"
"ANN101", # Missing type annotation for self
"ANN102", # Missing type annotation for cls
"ANN201", # Missing return type annotation for public function
"ANN204", # Missing return type annotation for special method `__init__`,
"ANN205", # Missing return type annotation for staticmethod `list`
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in `user_login`
"B006", # Do not use mutable data structures for argument defaults
"B007", # Loop control variable `dirs` not used within loop body
"B008", # Do not perform function call `FileStorage`"
"B015", # Pointless comparison. Did you mean to assign a value? Otherwise, prepend `assert` or remove it."
"B018", # Found useless expression. Either assign it to a variable or remove it.
"B024", # `AuthService` is an abstract base class, but it has no abstract methods or properties"
"B904", # Within an `except` clause, raise exceptions with
"C901", # `handle_output` is too complex (11 > 10)"
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D105", # Missing docstring in magic method
"D106", # Missing docstring in public nested class
"D107", # Missing docstring in `__init__`
"D205", # 1 blank line required between summary line and description
"D402", # First line should not be the function's signature"
"D415", # First line should end with a period, question mark, or exclamation point"
"D417", # Missing argument description in the docstring for `user_organizations`: `request`
"E501", # Line too long (91 > 90)
"N806", # Variable `organizationData` in function should be lowercase
"N802", # Function name `makeSignupRequestParams` should be lowercase
"N804", # First argument of a class method should be named `cls`"
"N805", # First argument of a method should be named `self`"
"N812", # Lowercase `exceptions` imported as non-lowercase `GoogleApiException`"
"N813", # Camelcase `Common` imported as lowercase `common`
"N816", # Variable `zipProject` in global scope should not be mixedCase"
"N817", # CamelCase `FieldLengthConstants` imported as acronym `FLC`,
"N818", # Exception name `InvalidToolPropertiesException` should be named with an Error suffix
"N999", # Invalid module name: 'FileValidator'"
"TCH001", #Move application import xxx into a type-checking block
"TCH002", # Move third-party import `rest_framework.serializers.Serializer` into a type-checking block
"TCH003", # Move standard library import `uuid` into a type-checking block"
# "TC006", # [*] Add quotes to type expression in `typing.cast()"
"ANN206", #Missing return type annotation
"ANN202", # Missing return type annotation for private function"
"B027", # `NotificationProvider.validate` is an empty method in an abstract base class, but has no abstract decorator"
"F405", # `os` may be undefined, or defined from star imports"
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)`"
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
docstring-code-format = true
[tool.pycln]
all = true
expand-stars = true
no-gitignore = false
verbose = true
[tool.pyupgrade]
keep-runtime-typing = true
py39-plus = true
keep-dict-typing = true
[tool.pytest.ini_options]
python_files = ["tests.py", "test_*.py", "*_tests.py"]
DJANGO_SETTINGS_MODULE = "backend.settings.test_cases"
testpaths = ["tests"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration (deselect with '-m \"not integration\"')",
]
[tool.mypy]
python_version = "3.12"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
check_untyped_defs = true
disallow_untyped_decorators = false
no_implicit_optional = true
strict_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
allow_untyped_globals = false
allow_redefinition = false
local_partial_types = true
implicit_reexport = true
follow_imports = "silent"
ignore_missing_imports = true
pretty = true
show_column_numbers = true
show_error_codes = true
strict = true
exclude = '''(?x)^(
.*migrations/.*\.py|
backend/prompt/.*|
unstract/connectors/tests/.*|
unstract/core/.*|
unstract/flags/src/unstract/flags/.*|
__pypackages__/.*|
)$'''
[tool.yamllint]
relaxed = true