-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpyproject.toml
144 lines (120 loc) · 3.32 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
[project]
name = "app"
version = "0.1.0"
description = "Default template for PDM package"
authors = [{ name = "Aryan Iyappan", email = "[email protected]" }]
dependencies = [
"gradio>=4.42.0",
"PyMuPDF>=1.24.9",
"pydantic>=2.8.2",
"pytesseract>=0.3.13",
"pillow>=10.4.0",
"pdf2image>=1.17.0",
"transformers>=4.44.2",
"torch>=2.4.0",
]
requires-python = "==3.12.*"
readme = "README.md"
license = { text = "MIT" }
[tool.pdm.dev-dependencies]
dev = ["black>=24.8.0", "mypy>=1.11.2", "ruff>=0.6.2"]
[tool.pdm.scripts]
app = "gradio app/__init__.py"
lint = { composite = ["black .", "ruff check --fix .", "black .", "mypy ."] }
[tool.pdm]
distribution = false
[tool.coverage.run]
source = ["app"]
omit = []
command_line = "-m pytest -vv"
concurrency = ["greenlet"]
branch = true
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"class .*\\(.*\\bProtocol\\b.*\\):",
"@(?:typing\\.)?overload",
"if TYPE_CHECKING:",
"raise NotImplementedError",
]
show_missing = true
skip_covered = true
skip_empty = true
precision = 2
fail_under = 85
[tool.setuptools.packages.find]
where = ["."] # list of folders that contain the packages (["."] by default)
include = [
"*",
] # package names should match these glob patterns (["*"] by default)
exclude = [] # exclude packages matching these glob patterns (empty by default)
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
[tool.mypy]
plugins = ["pydantic.mypy"]
exclude = ["^.venv/"]
strict = true
follow_imports = "normal"
ignore_missing_imports = false
disallow_untyped_calls = false
allow_redefinition = false
disallow_any_explicit = false
ignore_errors = false
local_partial_types = true
no_implicit_optional = true
strict_optional = true
warn_no_return = true
warn_unused_ignores = false
warn_return_any = false
warn_unreachable = true
pretty = true
show_column_numbers = true
show_error_codes = true
[[tool.mypy.overrides]]
module = ["fitz.*", "gradio.*"]
ignore_missing_imports = true
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
[tool.ruff]
src = ["app", "tests"]
lint.fixable = ["F", "E", "W", "I", "COM", "UP", "RUF"]
lint.unfixable = [
"F841", # variable is assigned to but never used
]
lint.select = ["ALL"]
lint.ignore = [
"E501", # line length
"ANN101",
"ANN102",
"D10", # disable mandatory docstrings
"D203", # one-blank-line-before-class
"D212", # multi-line-summary-first-line
"PD", # pandas-vet
"PLR0913", # too many arguments
"TCH001",
"TCH002",
"TCH003",
"EXE",
"COM812",
"ISC001",
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*" = ["S101", "S105", "S106", "E712"]
"migrations/*" = ["INP001"]
"migrations/versions/*" = ["D400", "D415"]
[tool.ruff.lint.flake8-pytest-style]
fixture-parentheses = false
mark-parentheses = false
[tool.ruff.lint.mccabe]
max-complexity = 6
[tool.ruff.lint.flake8-bugbear]
extend-immutable-calls = []
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["classmethod"]
staticmethod-decorators = ["staticmethod"]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.lint.flake8-tidy-imports.banned-api]
"starlette.status".msg = "Use http.HTTPStatus instead."
"fastapi.status".msg = "Use http.HTTPStatus instead."
"httpx.codes".msg = "Use http.HTTPStatus instead."