-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
151 lines (137 loc) · 3.41 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
[project]
name = "fastapi-image"
version = "0.1.0"
description = "Add your description here"
authors = [{ name = "ccv", email = "[email protected]" }]
dependencies = ["fastapi>=0.111.0"]
readme = "README.md"
requires-python = ">=3.9"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.rye]
managed = true
virtual = true
dev-dependencies = [
"ruff>=0.4.6",
"pre-commit>=3.7.1",
"mypy>=1.10.0",
"pytest>=8.2.1",
"httpx>=0.27.0",
]
[tool.rye.scripts]
test = "python -m pytest"
dev = "fastapi dev src/fastapi_image/main.py"
build = "docker build -t fastapi-image ."
container = "docker run -d -p 8080:8080 fastapi-image"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/fastapi_image"]
[tool.ruff]
line-length = 88
target-version = "py39"
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint]
unfixable = ["E711"]
select = [
# pydocstyle
"D",
# pyflakes
"F",
# pycodestyle
"E",
"I",
"W",
# flake8-2020
"YTT",
# flake8-bugbear
"B",
# flake8-quotes
"Q",
# pylint
"PLE",
"PLR",
"PLW",
# misc lints
"PIE",
# flake8-pyi
"PYI",
# tidy imports
"TID",
# type-checking imports
"TCH",
]
ignore = [
# space before : (needed for how black formats slicing)
# "E203", # not yet implemented
# module level import not at top of file
"E402",
# do not assign a lambda expression, use a def
"E731",
# line break before binary operator
# "W503", # not yet implemented
# line break after binary operator
# "W504", # not yet implemented
# controversial
"B006",
# controversial
"B007",
# controversial
"B008",
# setattr is used to side-step mypy
"B009",
# getattr is used to side-step mypy
"B010",
# tests use assert False
"B011",
# tests use comparisons but not their returned value
"B015",
# false positives
"B019",
# Loop control variable overrides iterable it iterates
"B020",
# Function definition does not bind loop variable
"B023",
# zip()` without an explicit `strict=
"B905",
# Functions defined inside a loop must not use variables redefined in the loop
# "B301", # not yet implemented
# Too many arguments to function call
"PLR0913",
# Too many returns
"PLR0911",
# Too many branches
"PLR0912",
# Too many statements
"PLR0915",
# Global statements are discouraged
"PLW0603",
# Docstrings should not be included in stubs
"PYI021",
# Use typing_extensions.TypeAlias for type aliases
# "PYI026", # not yet implemented
# Use "collections.abc.*" instead of "typing.*" (PEP 585 syntax)
# "PYI027", # not yet implemented
# while int | float can be shortened to float, the former is more explicit
# "PYI041", # not yet implemented
# Additional checks that don't pass yet
# Within an except clause, raise exceptions with ...
"B904",
# Magic number
"PLR2004",
# Consider `elif` instead of `else` then `if` to remove indentation level
"PLR5501",
# Ignore "Use `float` instead of `int | float`."
"PYI041",
# Allow importing from parent modules
"TID252",
]
exclude = [".github", "tests/*"]
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.mypy]
ignore_missing_imports = true
explicit_package_bases = true
exclude = ["^tests/.*"]