-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
212 lines (185 loc) · 4.97 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
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
#
[project]
name = "delb"
version = "0.5-rc1"
description = "A library that provides an ergonomic model for XML encoded text documents (e.g. with TEI-XML)."
authors = [
{ name = "Frank Sachsenheim", email = "delb-project@posteo.net" }
]
license = "AGPL-3.0-or-later"
readme = "README.rst"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)",
"Natural Language :: English",
"Programming Language :: Python :: 3.8",
"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",
"Topic :: Text Processing :: Markup :: XML",
]
keywords = ["xml", "markup", "tei", "text processing"] # TODO one more
dependencies = [
"cssselect",
"lxml",
# DROPWITH Python3.9
"importlib-metadata; python_version < '3.10'",
"typing-extensions; python_version < '3.10'"
]
[project.entry-points.delb]
https-loader = "_delb.plugins.https_loader"
[project.optional-dependencies]
https-loader = ["httpx[http2]"]
[project.urls]
Changelog = "https://delb.readthedocs.io/latest/changes.html"
Documentation = "https://delb.readthedocs.io/"
Issues = "https://github.com/delb-xml/delb-py/issues"
Repository = "https://github.com/delb-xml/delb-py"
#
[tool.cff-from-621]
order = ["title", "abstract", "version", "date-released"]
[tool.cff-from-621.static]
message = "🔥🌍🔥"
#
[tool.coverage.run]
source = ["_delb", "delb"]
omit = [
"_delb/typing.py",
"delb/exceptions.py",
"delb/names.py",
"delb/nodes.py",
"delb/parser.py",
"delb/typing.py",
]
[tool.coverage.report]
exclude_also = [
"def __repr__",
"if TYPE_CHECKING:",
"pass",
"raise InvalidCodePath",
"raise NotImplementedError",
"raise TypeError",
"raise ValueError"
]
fail_under = 96
#
[tool.flake8]
# E203: https://github.com/PyCQA/pycodestyle/issues/373
# PEA001: DROPWITH Python3.8
# PT019: https://github.com/m-burst/flake8-pytest-style/issues/202
extend-ignore = ["E203", "PEA001", "PT019"]
extend-select = ["TC", "TC1"]
ban-relative-imports = "true"
max-annotations-complexity = 4
max-complexity = 10
max-line-length = 88
pytest-parametrize-values-type = "tuple"
pytest-parametrize-values-row-type = "tuple"
rst-directives = "testcode,testoutput"
rst-roles = "attr,class,doc,exc,func,meth,obj,ref,term"
#
[tool.hatch.build.targets.sdist]
only-include = [
"benchmarks",
"_delb",
"delb",
"docs",
"tests",
".editorconfig",
"CHANGES.rst",
"CITATION.cff",
"delb_logo.svg",
"Justfile",
"LICENSE.txt",
"pyproject.toml",
"README.rst",
]
[tool.hatch.build.targets.wheel]
packages = ["_delb", "delb"]
[tool.hatch.envs.default]
features = ["https-loader"]
[tool.hatch.envs.benchmarks]
dependencies = [
"pytest-benchmark",
]
[tool.hatch.envs.benchmarks.scripts]
run = """
python -m pytest \
--benchmark-autosave --benchmark-group-by=name \
--benchmark-timer=time.process_time benchmarks
"""
[tool.hatch.envs.docs]
dependencies = [
"autodocsumm",
"furo",
"sphinx-autobuild",
"sphinx-copybutton",
"sphinx-design"
]
[tool.hatch.envs.docs.scripts]
build-html = "make -C docs html"
clean = "make -C docs clean"
doctest = "make -C docs doctest"
linkcheck = "make -C docs linkcheck"
serve = "sphinx-autobuild --open-browser --delay 2 --watch _delb --watch delb docs docs/build/html/"
[tool.hatch.envs.linting]
dependencies = [
"flake8-absolute-import",
"flake8-annotations-complexity",
"flake8-black",
"flake8-comprehensions",
"flake8-eradicate",
"flake8-pep585",
"flake8-pep604",
"flake8-pyprojecttoml",
"flake8-pytest-style",
"flake8-use-fstring",
# FIXME? this needs an update (uses pkg_resources), but isn't pressing
# "flake8-use-pathlib",
"flake8-rst-docstrings",
"flake8-simplify",
"flake8-sphinx-links",
"flake8-tidy-imports",
"flake8-type-checking",
"pep8-naming"
]
detached = true
[tool.hatch.envs.linting.scripts]
check = "flake8 benchmarks _delb delb tests"
[tool.hatch.envs.mypy]
dependencies = [
"lxml-stubs",
"mypy"
]
skipinstall = true
[tool.hatch.envs.mypy.scripts]
check = "mypy _delb delb"
[tool.hatch.envs.unit-tests]
dependencies = [
"pytest-cov",
"pytest-httpx",
]
[tool.hatch.envs.unit-tests.scripts]
check = "python -m pytest --cov=_delb --cov=delb tests"
coverage-report = """
python -m pytest \
--cov-report term-missing:skip-covered \
--cov=_delb --cov=delb \
tests
"""
[tool.hatch.envs.test-wheel]
template = "unit-tests"
skip-install = true
extra-dependencies = [
"delb @ {root:uri}/{env:WHEEL_PATH}",
]
[tool.hatch.envs.test-wheel.scripts]
check = "python -m pytest tests"