forked from jg-rp/liquid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
219 lines (193 loc) · 4.86 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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[project]
authors = [{name = "James Prior", email = "[email protected]"}]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = ["python-dateutil>=2.8.1", "typing-extensions>=4.2.0", "importlib-resources>=5.10.0"]
description = "A Python engine for the Liquid template language."
dynamic = ["version"]
license = "MIT"
name = "python-liquid"
readme = "README.md"
requires-python = ">=3.7"
[project.optional-dependencies]
autoescape = ["MarkupSafe>=2.0.0"]
[project.urls]
"Change Log" = "https://github.com/jg-rp/liquid/blob/main/CHANGES.md"
Documentation = "https://jg-rp.github.io/liquid/"
Homepage = "https://jg-rp.github.io/liquid/"
"Issue Tracker" = "https://github.com/jg-rp/liquid/issues"
"Source Code" = "https://github.com/jg-rp/liquid"
[tool.hatch.version]
path = "liquid/__init__.py"
[tool.hatch.build.targets.sdist]
exclude = ["/**/.mypy_cache/"]
packages = ["liquid"]
[tool.hatch.build.targets.wheel]
exclude = ["/**/.mypy_cache/"]
packages = ["liquid"]
[tool.hatch.envs.default]
dependencies = [
"pytest",
"pytest-cov",
"black",
"mypy",
"pyyaml",
"types-pyyaml",
"twine",
"ruff",
"mock",
"types-python-dateutil",
"MarkupSafe",
]
[tool.hatch.envs.default.scripts]
benchmark = "python -O scripts/performance.py"
cov = [
"hatch run noescape:cov",
"pytest --cov-append --cov-report= --cov-fail-under=97 --cov-config=pyproject.toml --cov=liquid --cov=tests {args}",
]
cov-html = [
"hatch run noescape:cov",
"pytest --cov-append --cov-report=html --cov-config=pyproject.toml --cov=liquid --cov=tests {args}",
]
lint = "ruff check ."
no-cov = "cov --no-cov {args}"
profile = "python -O scripts/performance.py --profile"
test = "pytest {args}"
typing = "mypy"
[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311", "312", "pypy38", "pypy39"]
[tool.hatch.envs.test.scripts]
test = "pytest {args}"
[tool.hatch.envs.noescape]
dependencies = ["pytest", "pytest-cov", "mock"]
features = []
template = "noescape"
[tool.hatch.envs.noescape.scripts]
cov = "pytest --cov-report= --cov-config=pyproject.toml --cov=liquid --cov=tests {args}"
test = "pytest {args}"
[tool.hatch.envs.docs]
dependencies = ["black", "mkdocs", "mkdocstrings[python]", "mkdocs-material"]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean --strict"
serve = "mkdocs serve --dev-addr localhost:8000"
[tool.coverage.run]
branch = true
omit = ["tests/mocks/**/*", "liquid/__about__.py"]
parallel = true
[tool.coverage.report]
exclude_lines = ["no cov", "if __name__ == .__main__.:", "if TYPE_CHECKING:"]
[tool.mypy]
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_defs = true
files = "liquid"
local_partial_types = true
no_implicit_optional = true
no_implicit_reexport = true
python_version = "3.10"
strict = true
warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
warn_unused_ignores = false
[tool.ruff]
select = [
"A",
"ARG",
"B",
"BLE",
"C4",
"D",
"E",
"F",
"I",
"ICN",
"ISC",
"N",
"PIE",
"PL",
"PT",
"Q",
"RET",
"RSE",
"S",
"SIM",
"SLF",
"T10",
"T20",
"TCH",
"YTT",
]
# TODO: review ignores
ignore = [
"S105",
"S101",
"D107",
"D105",
"PLR0913",
"D401",
"N818",
"PT009",
"B905",
"PT027",
]
fixable = ["I", "SIM", "D202"]
unfixable = []
# Exclude a variety of commonly ignored directories.
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".hg",
".mypy_cache",
".nox",
".pants.d",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"venv",
]
# Same as Black.
line-length = 88
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
# Assume Python 3.10.
target-version = "py310"
[tool.ruff.isort]
force-single-line = true
[tool.ruff.pydocstyle]
convention = "google"
[tool.ruff.per-file-ignores]
"liquid/__about__.py" = ["D100"]
"liquid/__init__.py" = ["D104", "I001"]
"liquid/builtin/filters/__init__.py" = ["D104", "I001"]
"liquid/builtin/loaders/__init__.py" = ["D104", "I001"]
"liquid/builtin/tags/__init__.py" = ["D104", "I001"]
"scripts/__init__.py" = ["D104", "I001"]
"tests/*" = ["D100", "D101", "D104", "D103", "D102", "D209", "D205", "SIM117"]