-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
147 lines (127 loc) · 3.18 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
[tool.poetry]
name = "hypermedia"
version = "5.3.2"
description = "An opinionated way to work with html in pure python with htmx support."
authors = ["Thomas Borgen <[email protected]>"]
readme = "README.md"
license = "MIT"
homepage = "https://github.com/thomasborgen/hypermedia"
repository = "https://github.com/thomasborgen/hypermedia"
keywords = ["HTML", "HTMX", "Extendable", "Partial HTML", "HTML Templating", "FastAPI"]
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Framework :: FastAPI",
"Topic :: Text Processing :: Markup :: HTML",
]
[tool.poetry.dependencies]
python = "^3.10"
typing-extensions = "^4.11.0"
[tool.poetry.group.dev.dependencies]
ruff = "^0.3.5"
mypy = "^1.9.0"
pytest = "^8.1.1"
pytest-cov = "^5.0.0"
safety = "^3.2.4"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
[tool.ruff]
line-length = 79
indent-width = 4
target-version = "py311"
[tool.ruff.lint]
exclude = [
".git",
".venv",
"__pycache__",
"alembic/*",
]
select = [
# Regular flake8 rules
"C", "E", "F", "W", "S",
# flake8-bugbear rules
"B",
# extra flake rules
"YTT",
# Import sorting rules (isort replacement)
"I",
# Pylint rules
"PLC", "PLE", "PLR", "PLW",
# ruff rules
"RUF",
# Docstyle
"D",
# Max camplexity
"C90",
]
ignore = [
"D100", # Docstring in modules
"D107", # Docstring in __init__
"D203", # Incompatible with D211
"D212", # Incompatible with D213
# FastApi uses a lot of dependency injection and performs calls/object inits
# in argument defaults.
"B008",
"PLC0105", # Let typevar covariants be named without _co suffix
]
fixable = ["ALL"]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["D104"]
"**/{tests}/*" = [
"D103", # Allow missing docstring in functions
"S101", # Allow asserts
"S106", # Allow hardcorded passwords in tests
]
"**/conftest.py" = [
"F811", # Allow redefinition (imported fixtures)
]
"tests/**" = [
"D101", # Allow missing docstring in class
"D102", # Allow missing docstring in method
]
[tool.ruff.lint.mccabe]
# Flag errors (`C901`) whenever the complexity level exceeds 6.
max-complexity = 6
[tool.ruff.lint.pylint]
max-public-methods = 8
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "parents"
[tool.ruff.lint.isort]
combine-as-imports = true
[tool.ruff.format]
quote-style = "double"
[tool.mypy]
plugins = [
"pydantic.mypy",
]
# follow_imports = "silent"
warn_redundant_casts = true
warn_unused_ignores = true
disallow_any_generics = true
check_untyped_defs = true
no_implicit_reexport = true
# for strict mypy: (this is the tricky one :-))
disallow_untyped_defs = true
[tool.pytest.ini_options]
# py.test options:
norecursedirs = ["*.egg", ".eggs", "dist", "build", "docs", ".tox", ".git", "__pycache__"]
testpaths = [
"tests",
]
addopts = [
"--doctest-modules",
"--cov=hypermedia",
"--cov-report=term",
"--cov-report=html",
"--cov-report=xml",
"--cov-branch",
"--cov-fail-under=80",
]
[tool.coverage.run]
branch = true
[tool.coverage.report]
exclude_lines = [
# Skip any pass lines such as may be used for @abstractmethod
"pass",
]