-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
215 lines (193 loc) · 6.33 KB
/
Copy pathpyproject.toml
File metadata and controls
215 lines (193 loc) · 6.33 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
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
[project]
name = "ml-test"
version = "0.1.0"
description = """Test for ML job"""
authors = [
{name = "Mateus Furquim", email = "mfurquimdev@gmail.com"},
]
requires-python = ">=3.11,<3.12"
classifiers = [
"Development Status :: 1 - Planning",
"Framework :: FastAPI",
"Framework :: Pydantic :: 2",
"Framework :: Pydantic",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Topic :: Education",
"Topic :: Internet",
"Topic :: Scientific/Engineering",
"Topic :: Software Development",
"Topic :: System :: Installation/Setup",
"Typing :: Typed",
]
readme = "README.md"
license = {text = "MIT"}
dependencies = [
"pandas==1.5.3",
"numpy==1.25.0",
"scipy==1.11.3",
"scikit-learn==1.3.1",
"fastapi==0.104.1",
"python-multipart==0.0.6",
"httpx==0.25.1",
"typer>=0.9.0",
"rich>=13.7.0",
"pydantic-settings>=2.1.0",
"orjson>=3.9.10",
]
[project.optional-dependencies]
docs = [
"mkdocs>=1.5.3",
"mkdocs-material>=9.4.14",
"mkautodoc>=0.2.0",
"mkdocstrings[python]>=0.24.0",
"mkdocs-macros-plugin>=1.0.5",
]
[tool.pdm.dev-dependencies]
dev = [
"black",
"isort",
"mypy",
"pre-commit",
"pyright",
"ruff",
"uvicorn",
"ipython>=8.18.0",
"ipdb>=0.13.13",
]
[tool.pdm.scripts]
server.cmd = "python src/server/main.py"
cli.cmd = "python src/cli/main.py"
env_file.override = ".env"
[tool.mypy]
plugins = [
"pydantic.mypy"
]
# From cookiecutter
# https://github.com/cjolowicz/cookiecutter-hypermodern-python/blob/main/%7B%7Bcookiecutter.project_name%7D%7D/pyproject.toml
strict = true
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_context = true
# From Pydantic
# https://docs.pydantic.dev/latest/integrations/mypy/#configuring-the-plugin
follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = false
disallow_any_generics = true
check_untyped_defs = false
no_implicit_reexport = true # specify __all__ = ['FunctionToExport']
# for strict mypy, turn this on
disallow_untyped_defs = false
# for less strict mypy, turn this on instead
disallow_incomplete_defs = true
# when it doesn't find stubs
ignore_missing_imports = true
ignore_unused_allowlist = ["reportGeneralTypeIssues", "no-redef"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.pyright]
reportMissingImports = false
[tool.ruff]
line-length = 100
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
target-version = "py38"
# Enable by default.
# See [Ruff Rules](https://beta.ruff.rs/docs/rules) for more information
select = [
"A", # [flake8-builtins](https://pypi.org/project/flake8-builtins/)
"B", # [flake8-bugbear](https://pypi.org/project/flake8-bugbear/)
"F", # [pyflake](https://pypi.org/project/pyflakes/)
"W", # [pycodestyle](https://pypi.org/project/pycodestyle/)
"UP", # [pyupgrade](https://pypi.org/project/pyupgrade/)
# "ARG", # [flake8-unused-arguments](https://pypi.org/project/flake8-unused-arguments/)
# "BLE", # [flake8-blind-except](https://pypi.org/project/flake8-blind-except/)
# "C4", # [flake8-comprehensions](https://pypi.org/project/flake8-comprehensions/)
# "C90", # [mccabe complexity](https://pypi.org/project/mccabe/)
# "COM", # [flake8-commas](https://pypi.org/project/flake8-commas/)
# "D", # [pydocstyle](https://pypi.org/project/pydocstyle/)
# "DTZ", # [flake8-datetimez](https://pypi.org/project/flake8-datetimez/)
# "E", # [pycodestyle](https://pypi.org/project/pycodestyle/)
# "EM", # [flake8-errmsg](https://pypi.org/project/flake8-errmsg/)
# "ERA", # [eradicate](https://pypi.org/project/eradicate/)
# "FBT", # [flake8-boolean-trap](https://pypi.org/project/flake8-boolean-trap/)
# "FLY", # [flynt](https://pypi.org/project/flynt/)
# "ICN", # [flake8-import-conventions](https://github.com/joaopalmeiro/flake8-import-conventions)
# "ISC", # [flake8-implicit-str-concat](https://pypi.org/project/flake8-implicit-str-concat/)
# "N", # [pep8-naming](https://pypi.org/project/pep8-naming/)
# "NPY", # [NumPy-specific rules](https://beta.ruff.rs/docs/rules/#numpy-specific-rules-npy)
# "PD", # [pandas-vet](https://pypi.org/project/pandas-vet/)
# "PERF", # [Perflint](https://pypi.org/project/perflint/)
# "PIE", # [flake8-pie](https://pypi.org/project/flake8-pie/)
# "PT", # [flake8-pytest-style](https://pypi.org/project/flake8-pytest-style/)
# "PTH", # [flake8-use-pathlib](https://pypi.org/project/flake8-use-pathlib/)
# "PYI", # [flake8-pyi](https://pypi.org/project/flake8-pyi/)
# "Q", # [flake8-quotes](https://pypi.org/project/flake8-quotes/)
# "RET", # [flake8-return](https://pypi.org/project/flake8-return/)
# "RSE", # [flake8-raise](https://pypi.org/project/flake8-raise/)
# "RUF", # [Ruff-specific rules](https://beta.ruff.rs/docs/rules/#ruff-specific-rules-ruf)
# "S", # [flake8-bandit](https://pypi.org/project/flake8-bandit/)
# "SIM", # [flake8-simplify](https://pypi.org/project/flake8-simplify/)
# "SLF", # [flake8-self](https://pypi.org/project/flake8-self/)
# "SLOT", # [flake8-slots](https://pypi.org/project/flake8-slots/)
# "T10", # [flake8-debugger](https://pypi.org/project/flake8-debugger/)
# "T20", # [flake8-print](https://pypi.org/project/flake8-print/)
# "TD", # [flake8-todos](https://github.com/orsinium-labs/flake8-todos/)
# "TID", # [flake8-tidy-imports](https://pypi.org/project/flake8-tidy-imports/)
# "TRY", # [tryceratops](https://pypi.org/project/tryceratops/)
]
extend-ignore = [
"D203",
"D204",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
]
# Exclude a variety of commonly ignored directories.
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",
]
# Ignore `E402` (import violations) in all `__init__.py` files
[tool.ruff.per-file-ignores]
"__init__.py" = ["E402", "I001", "F401"]
[tool.ruff.isort]
force-single-line = true
[tool.isort]
py_version = 3
profile = "black"
force_single_line = true
line_length = 100
[tool.black]
line-length = 100
safe = true