-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathpyproject.toml
143 lines (128 loc) · 3.46 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
[tool.poetry]
name = "operationcode-pybot"
version = "0.9.0"
description = "Slack bot for Operation Code Slack."
authors = ["Judson Stevens <judson@operationcode.org>"]
[tool.poetry.dependencies]
aiohttp = "~3"
APScheduler = "~3"
fastapi = "~0"
pydantic = "~2"
pyairtable = "~1"
pytesseract = "~0"
python = "~3.10"
requests = "~2"
sentence-transformers = "~2"
sentry-sdk = "~1"
slack-bolt = "~1"
tensorboard = "~2"
unstructured = "~0"
uvicorn = {extras = ["standard"], version = "~0"}
weaviate-client = "~3"
pdf2image = "^1.16.3"
pypdf = "^3.8.1"
[tool.poetry.group.dev.dependencies]
black = "~23"
mypy = "~1"
pyaml = "~21"
pylint = "~2"
pytest = "~7"
pytest-vcr = "~1"
ruff = "~0"
[build-system]
requires = ["poetry>=1.3"]
build-backend = "poetry.masonry.api"
[tool.ruff]
# All rules to be enabled - https://beta.ruff.rs/docs/rules/
select = ["E", "F", "W", "B", "C90", "I", "N", "D", "UP", "YTT", "ANN", "S", "BLE", "FBT",
"B", "A", "COM", "C4", "DTZ", "T10", "DJ", "EM", "EXE", "ISC", "ICN", "G", "INP", "PIE",
"T20", "PYI", "PT", "Q", "RSE", "RET", "SLF", "SIM", "TID", "TCH", "ARG", "PTH", "ERA",
"PD", "PGH", "PL", "TRY", "RUF"]
ignore = [
"B008", # Ignore B008 because it complains about how FastAPI handles Depends
"D213", # We want the multi-line summary on the first line
"D203", # We want no blank line before class docstring
]
# Allow autofix for all enabled rules (when `--fix`) is provided.
fixable = ["A", "B", "C", "D", "E", "F", "I", "COM812"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
# Exclude the one off script file
"one_offs.py",
# Exclude the vector search testing
"**/vector*",
# Exclude the databases folder
"**/databases/**",
]
# Same as Black.
line-length = 119
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Python 3.10.
target-version = "py310"
[tool.ruff.mccabe]
max-complexity = 10
[tool.ruff.per-file-ignores]
"**/database/*" = [
"A003", # We should allow shadowing
"ANN002", # We don't want to type *args
"ANN003", # We don't want to type **kwargs
]
"**/schemas/*" = [
"A003", # We should allow shadowing
"D106", # We should allow missing docstring
]
"**/models/*" = [
"A003", # We should allow shadowing
"D106", # We should allow missing docstring
]
"**/routers/*" = [
"BLE001", # We use broad exceptions
"TRY300", # We don't want to use if/else in returns
"FBT001", # We are fine with Boolean positional args in function definition
]
"**/actions/*" = [
"BLE001", # We use broad exceptions
"TRY300", # We don't want to use if/else in returns
]
"**/alembic/*" = [
"ANN201", # We don't want return type annotation
"D103", # We don't care about docstrings
"INP001", # We don't want an __init__ in the root directory
"PLR0915", # We don't care about too many statements
"PTH120", # We want to use os.path for now
"PTH100", # we want to use os.path for now
]
"**/tests/*" = [
"S101", # We use assert in tests
"ANN101", # We don't need to type self in tests
]
[tool.black]
line-length = 119
exclude = [".idea", "docs/"]
[tool.mypy]
exclude = [
"/.idea/",
".idea/*.py"
]