-
Notifications
You must be signed in to change notification settings - Fork 2
/
pyproject.toml
187 lines (160 loc) · 4.39 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
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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "domify"
description = "HTML generator using pure Python"
readme = "README.md"
requires-python = ">=3.9"
license = "MIT"
authors = [
{name="Parnassius", email="[email protected]"},
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Code Generators",
"Topic :: Text Processing :: Markup :: HTML",
"Typing :: Typed",
]
dynamic = ["version"]
[project.optional-dependencies]
lint = [
"domify[test]",
"darglint==1.8.1",
"mypy==1.13.0",
"ruff==0.8.1",
]
test = [
"pytest==8.3.3",
"pytest-cov==6.0.0",
]
[project.urls]
Homepage = "https://github.com/Parnassius/domify"
[tool.hatch.build]
packages = ["domify"]
[tool.hatch.envs.default]
skip-install = true
[tool.hatch.envs.default.scripts]
ruff-fix = "hatch run lint:ruff check domify tests --fix-only {args}"
ruff-format = "hatch run lint:ruff format domify tests {args}"
format = ["ruff-fix", "ruff-format"]
darglint = "hatch run lint:darglint domify tests -v 2 {args}"
mypy = "hatch run lint:mypy domify tests {args}"
ruff = "hatch run lint:ruff check domify tests {args}"
pytest = "hatch run test:pytest {args}"
pytest-ci = "hatch run +py={args} test:pytest --cov"
all = ["format", "darglint", "mypy", "ruff", "pytest"]
_check_uncommited_changes = [
"git diff --quiet",
"git diff --cached --quiet",
]
_check_not_dev_version = 'case "$(hatch version)" in *dev*) false; esac'
_create_tag = 'git tag "$(hatch version)"'
_create_dev_commit = [
"hatch version patch,dev",
'git commit domify/__about__.py --message "Bump version to $(hatch version)"',
]
release = [
"_check_uncommited_changes",
"_check_not_dev_version",
"all",
"_check_uncommited_changes",
"_create_tag",
"_create_dev_commit",
]
[tool.hatch.envs.lint]
template = "lint"
features = ["lint"]
[tool.hatch.envs.test]
template = "test"
features = ["test"]
[[tool.hatch.envs.test.matrix]]
python = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"pypy3.9",
"pypy3.10",
]
[tool.hatch.version]
path = "domify/__about__.py"
[tool.coverage.report]
exclude_lines = [
"# pragma: no cover",
"if TYPE_CHECKING:",
"@overload",
]
[tool.coverage.run]
relative_files = true
source = ["domify"]
omit = ["domify/__about__.py"]
[tool.mypy]
python_version = "3.9"
strict = true
# Disallow dynamic typing
disallow_any_unimported = true
disallow_any_expr = true
disallow_any_decorated = true
disallow_any_explicit = true
show_error_codes = true
warn_unreachable = true
[[tool.mypy.overrides]]
module = "tests.*"
# pytest decorators leave functions untyped after transformation
disallow_any_decorated = false
disallow_any_explicit = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
[tool.ruff.lint]
select = [
"A", # flake8-builtins
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"E", # pycodestyle
"EM", # flake8-errmsg
"F", # pyflakes
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PGH", # pygrep-hooks
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific rules
"T10", # flake8-debugger
"TID", # flake8-tidy-imports
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle
"YTT", # flake8-2020
]
ignore = [
"A003", # builtin-attribute-shadowing
]
fixable = [
"I", # isort
"F401", # unused-import
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
dummy-variable-rgx = "^_$"
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"
[tool.ruff.lint.isort]
required-imports = ["from __future__ import annotations"]
split-on-trailing-comma = false