-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
148 lines (129 loc) · 3.88 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
[project]
name = "fastapi-problem-details"
version = "0.1.4"
description = "Structure your FastAPI APIs error responses with consistent and machine readable format using the RFC 9457 \"Problem Details for HTTP APIs\" standard"
authors = [{ name = "g0di", email = "[email protected]" }]
dependencies = ["fastapi>=0.100.0", "pydantic>=2.0.0"]
requires-python = ">=3.10"
readme = "README.md"
license = { text = "MIT" }
keywords = ["fastapi", "problem", "plugin"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Plugins",
"Environment :: Web Environment",
"Framework :: FastAPI",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
"Intended Audience :: Telecommunications Industry",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Software Development :: Libraries",
]
[project.urls]
Homepage = "https://github.com/g0di/fastapi-problem-details"
Documentation = "https://github.com/g0di/fastapi-problem-details"
Source = "https://github.com/g0di/fastapi-problem-details"
Changelog = "https://github.com/g0di/fastapi-problem-details/blob/main/CHANGELOG.md"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm]
distribution = true
[tool.pdm.dev-dependencies]
lint = ["ruff>=0.0.13", "mypy>=0.1"]
test = [
"mypy>=1.11.0",
"ruff>=0.5.5",
"pytest>=8.3.2",
"faker>=26.0.0",
"pytest-cov>=5.0.0",
"tox-pdm>=0.7.2",
]
[tool.pdm.scripts]
lint = { composite = ["ruff format --check", "ruff check", "mypy"] }
test = "pytest"
qa = { composite = [
"ruff format",
"ruff check --fix --show-fixes",
"mypy",
"test",
] }
[tool.mypy]
strict = true
files = ["src", "tests"]
plugins = ["pydantic.mypy"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
[tool.ruff]
src = ["src", "tests"]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
# Disable rules conflicting with formatter. See: https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules
"COM812",
"COM819",
"D206",
"D300",
"E111",
"E114",
"E117",
"E501",
"ISC001",
"ISC001",
"Q000",
"Q001",
"Q002",
"Q003",
"W191",
# Disable required annotations for self and cls
"ANN1",
# Leave docstrings optional
"D1",
# Disable rules for TODO comments
"TD002",
"TD003",
# Do not raise errors when encountering TODOs
"FIX002",
]
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint.flake8-type-checking]
exempt-modules = ["typing", "typing_extensions"]
runtime-evaluated-base-classes = ["pydantic.BaseModel"]
strict = true
[tool.ruff.lint.flake8-pytest-style]
mark-parentheses = false
fixture-parentheses = false
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.pep8-naming]
classmethod-decorators = ["pydantic.field_validator"]
[tool.ruff.lint.per-file-ignores]
# Allow assert statements in tests folder
"tests/*" = ["S101"]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = ["--cov", "--cov-report=term-missing", "-vv"]
[tool.coverage.run]
branch = true
source = ["fastapi_problem_details"]
[tool.coverage.paths]
# Map src files with ones installed in venv.
# This is for properly combining coverages report when testing against installed version of the project
source = [
"src/fastapi_problem_details",
"*/site-packages/fastapi_problem_details",
]
[tool.coverage.report]
exclude_also = ["if TYPE_CHECKING:", "class .*\\bProtocol\\):", "@overload"]