-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
179 lines (164 loc) · 4.58 KB
/
pyproject.toml
File metadata and controls
179 lines (164 loc) · 4.58 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
[project]
name = "lomas"
version = "0.5.0b1"
requires-python = '>=3.11'
dependencies = [
"lomas-core",
"lomas-client",
"lomas-server[all]",
]
[project.optional-dependencies]
test = [
"ruff>=0.11",
"mypy>=1.15",
"pydocstringformatter>=0.7",
"coverage>=7.6",
"pytest>=8.3",
"pytest-cov>=6.0",
"pytest-timeout>=2.4.0",
]
docs = [
"pandoc>=2.4",
"sphinx>=8.1",
"nbsphinx>=0.9.6",
"sphinx-rtd-theme>=3.0",
"sphinxcontrib.napoleon>=0.7",
"myst-parser>=4.0",
]
# workspace setup for uv
[tool.uv.sources]
lomas-core = { workspace = true }
lomas-client = { workspace = true }
lomas-server = { workspace = true }
[tool.uv.workspace]
members = [ "core", "client", "server" ]
# workspace setup for setuptools (uv build)
[tool.setuptools.package-dir]
lomas-core = "core/lomas_core"
lomas-client = "client/lomas_client"
lomas-server = "server/lomas_server"
[tool.ruff]
line-length = 110
exclude = [ "*.ipynb", "*api_pb2*" ]
[tool.ruff.lint]
# ruff linter -> get available linter list
select = [
"I", # isort
# E,F,W together cover Flake8
"E", "W", # pycodestyle
"F", # Pyflakes
"PL", # Pylint Full
"PLC", # Pylint Convention
"PLE", # Pylint Error
"UP", # pyupgrade
"D", # pydocstyle see @pydocstyle.convention
"B", # flake8-bugbear
"FAST001", "FAST003", # FastAPI lint
"DTZ", # flake8-datetimez
"ICN", # flake8-import-conventions (numpy as np, pandas as pd, etc.)
"PYI", # flake8-pyi
"LOG",
"PT", # Pytest-style (lots of fixes todo)
"RSE", # flake8-raise
"FLY", # flynt
# "C90", # maccabe do we want it ?
"NPY", # NumPy-specific rules
"PD", # Pandas-specific rules
"RUF", # Ruff-specific rules
"FURB", # Refurbishing and modernizing Python codebases
"PGH004", # blanket noqa comments
"RET501", "RET502", # better return None handling
]
ignore = [
"E501",
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR2004", # Magic value used in comparison
"D10", # Missing docstring in public module/package/__init__
"D301", # Esacpe Sequence in docstring
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"PT011", # FIXME
]
pydocstyle.convention = "pep257"
[tool.ruff.lint.isort]
combine-as-imports = true
split-on-trailing-comma = true
extra-standard-library = ["test"]
known-first-party = ["lomas_core", "lomas_server", "lomas_client"]
[tool.mypy]
plugins = ['pydantic.mypy']
disable_error_code = ["import-untyped", "import-not-found"]
enable_error_code = ["truthy-bool"]
no_site_packages = true
show_error_codes = true
show_column_numbers = true
follow_imports = "silent"
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_reexport = true
disallow_untyped_defs = true
pretty = true
[[tool.mypy.overrides]]
module = [
"lomas_client.tests.*",
"lomas_server.tests.*",
"lomas_server.administration.tests.*"
]
disallow_untyped_defs = false
disable_error_code = [ "attr-defined" ]
[[tool.mypy.overrides]]
module = [
"lomas_server.administration.dex.api.*"
]
ignore_errors = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pydocstringformatter]
max-line-length = 110
write = true
exclude = [ ".devenv/**/*.py", "**/api_pb2*" ] # pydocstringformatter uses a wierd full path matching from glob.iglob
[tool.pytest.ini_options]
log_cli_level = "INFO" # can be overridden in pytest --log-cli-level=DEBUG ...
#syntax = action:message:category:module:line (@docs.python.org/3/library/warnings.html)
filterwarnings = [
"ignore::DeprecationWarning:(jupyter_client|aio_pika).*:",
"ignore::EncodingWarning:jupyter_client:",
]
addopts = [
"--import-mode=importlib",
]
markers = [
"long: marks test as long (deselect with '-m \"not long\"')",
]
[tool.coverage.run]
source = [
"./core/lomas_core",
"./server/lomas_server",
"./client/lomas_client"
]
relative_files = true
# https://coverage.readthedocs.io/en/latest/source.html#source-glob
# > A pattern with no directory separators matches the file name in any directory.
omit = [
"*/administration/dashboard/*.py",
"uvicorn_serve.py",
"api_pb2*.py",
# FIXME: remove on opendb.mbi switch
"*smartnoise_synth.py"
]
[tool.coverage.report]
exclude_also = [
# Don't complain if tests don't hit defensive assertion code:
"raise (AssertionError|NotImplementedError|TimeoutError)",
'(except|raise) InternalServerException',
'except (KNOWN_EXCEPTIONS|Exception|yaml.YAMLError)',
'case _:',
# Don't complain about missing debug-only code:
"def __repr__",
# Don't complain if non-runnable code isn't run:
"if __name__ == .__main__.:",
]