-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpyproject.toml
More file actions
280 lines (247 loc) · 7.61 KB
/
Copy pathpyproject.toml
File metadata and controls
280 lines (247 loc) · 7.61 KB
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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
[build-system]
requires = ["hatchling>=1.27", "hatch-vcs"]
build-backend = "hatchling.build"
[project]
# Storing project metadata in pyproject.toml https://peps.python.org/pep-0621/
name = "voc4cat"
description = "SKOS vocabulary management tool by NFDI4Cat."
authors = [
# Authors sorted by number of commits as of 2023-07-04
{name = "David Linke", email = "david.linke@catalysis.de"},
{name = "Peter Philips", email = "peter.philips@surroundaustralia.com"},
{name = "Nicholas Car", email = "nick@kurrawong.net"},
{name = "Jamie Feiss", email = "jamie.feiss@surroundaustralia.com"},
]
maintainers = [
{name = "David Linke", email = "david.linke@catalysis.de"},
]
license = "BSD-3-Clause"
license-files = [ "LICENSE" ]
readme = "README.md"
requires-python = ">=3.10"
keywords = ["SKOS", "vocabulary", "spreadsheet", "xlsx", "linked data", "rdf"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Programming Language :: Python",
"Environment :: Console",
"Intended Audience :: Science/Research",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dependencies = [
"base32-crockford",
"colorama",
"curies",
"jinja2",
"openpyxl >= 3.1.5",
"pillow", # for supporting images in xlsx files
"pydantic >= 2.10",
"pyshacl",
"rdflib",
"tomli>=1.1.0; python_version < '3.11'",
"isodate >=0.7.2, <1.0.0; python_version < '3.11'",
]
dynamic = ["version"]
[project.urls]
Homepage = "https://github.com/nfdi4cat/voc4cat-tool/"
Documentation = "https://github.com/nfdi4cat/voc4cat-tool/"
Changelog = "https://github.com/nfdi4cat/voc4cat-tool/blob/main/CHANGELOG.md"
[project.optional-dependencies]
tests = [
"pytest",
"pytest-subprocess",
"coverage",
]
lint = [
"ruff",
"mypy",
]
docs = [
"sphinx",
"myst-parser",
"furo",
"sphinx-sitemap",
]
dev = [
# Recursively including the project's own optional dependencies requires pip>=21.2
"voc4cat[tests,lint,docs]",
]
assistant = [
"click",
"sentence-transformers",
"torch",
"levenshtein",
]
[project.scripts]
voc4cat = "voc4cat.cli:run_cli_app"
voc4cat-merge = "voc4cat.merge_vocab:main_cli"
voc-assistant = "voc4cat.assistant:cli"
[tool.hatch.metadata]
# Hatch disallows direct references for dependencies by default.
# We need to enable them to allow installing NFDI4Cat's vocexcel from github.
allow-direct-references = true
# Build targets for hatch are defined as sections within tool.hatch.build.targets:
[tool.hatch.build.targets.sdist]
include = [
"/src",
"/templates",
]
[tool.hatch.build.targets.wheel]
packages = ["src/voc4cat"]
# integrates git-tag-based versions into hatch, https://github.com/ofek/hatch-vcs
[tool.hatch.version]
source = "vcs"
[tool.hatch.build.hooks.vcs]
version-file = "src/voc4cat/_version.py"
[tool.pytest.ini_options]
# pytest configuration:
# https://docs.pytest.org/en/stable/customize.html
# Sets directories to be searched for tests. Useful when all project tests are
# in a known location to speed up test collection and to avoid picking up
# undesired tests by accident. (related: issue #95)
testpaths = [
"tests",
]
# Directories that are not visited by pytest collector:
norecursedirs = "dist build .tox .git .cache __pycache__ .venv"
# Execute doctests in classes, functions, and test modules (pytest)
# --doctest-modules
addopts = [
"-ra",
"--strict-config", # Raise an error instead of a warning for pytest config issues
"--strict-markers", # Treat typos in function markers as an error
"--tb=short",
"--durations=10", # Show 10 slowest tests
"--durations-min=1.0", # Only show tests >1s
]
# Filter warnings from third-party dependencies (show each type only once)
# Deprecations added in rdflib 7.5.0 get triggered pyshacl 0.30.1
filterwarnings = [
"once:Dataset.default_context is deprecated:DeprecationWarning:pyshacl",
"once:Dataset.default_context is deprecated:DeprecationWarning:rdflib",
"once:Dataset.contexts is deprecated:DeprecationWarning:rdflib",
"once:Dataset.identifier is deprecated:DeprecationWarning:rdflib",
]
[tool.coverage]
[tool.coverage.run]
# https://coverage.readthedocs.io/en/latest/config.html
parallel = true
branch = true
# dynamic_context = "test_function"
source = ["voc4cat"]
source_dirs = ["tests"]
omit = [
"**/voc4cat/_version.py",
"**/voc4cat/assistant.py", # no tests yet
]
[tool.coverage.paths]
# Specify where coverage combine should look for source files.
source = [
"src",
"**/site-packages", # for not using tox
# ".tox/**/site-packages",
]
[tool.coverage.report]
# Show in report which lines are not covered
show_missing = false
# Any line of the source code that matches one of these regexes is excluded
skip_covered = true
# from being reported as missing.
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
"return NotImplemented",
"if __name__ == .__main__.:",
]
[tool.coverage.html]
# Directory where to write the HTML report files.
directory = ".htmlcov"
title = "voc4cat coverage report"
[tool.ruff]
# https://beta.ruff.rs/docs/configuration/
exclude = [
"__pycache__",
"*.egg",
".*",
"_version.py",
]
# Assume Python 3.10 syntax and semantics for linting.
target-version = "py310"
# Same as Black.
line-length = 88
[tool.ruff.lint]
ignore = [
"B905", # zip() without an explicit strict= parameter set. (requires python >= 3.10)
"E501", # line too long
]
# Avoid trying to fix these violations
unfixable = [
"B", # flake8-bugbear
]
# Rule selection https://beta.ruff.rs/docs/rules/
select = [
# sort order as in ruff docs
"F", # Pyflakes
"E", # pycodestyle (errors)
"W", # pycodestyle (warnings)
"C90", # mccabe
"I", # isort
"N", # pep8-naming
# "D", # pydocstyle
"UP", # pyupgrade
"YTT", # flake8-2020
# flake8-annotations (ANN)
# flake8-async (ASYNC)
"S", # flake8-bandit
"B", # flake8-bugbear
"A", # flake8-builtins
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
# "DJ", # flake8-django
"EM", # flake8-errmsg
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
# "ARG", # flake8-unused-arguments (ARG)
# "PTH", # flake8-use-pathlib (PTH)
# "ERA", # eradicate (ERA) - commented out code
# pandas-vet (PD)
"PGH", # pygrep-hooks
"PL", # whole Pylint (Convention, Error, Refactor, Warning)
"TRY", # tryceratops (TRY)
# NumPy-specific rules (NPY)
"RUF", # Ruff-specific rules
]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = [
"PLR2004", # Allow numbers instead of named constants in tests
"S101", # assert in tests is OK
]
"example/*.py" = [
"PLR0915", # allow many statements in functions in example scripts
"S101", # assert in example scripts is OK
]
[tool.ruff.lint.mccabe]
# Flake8-mccabe uses a default level of 7, ruff of 10.
max-complexity = 10
[tool.ruff.lint.pep8-naming]
# Allow Pydantic's `@validator` decorator to trigger class method treatment.
classmethod-decorators = [
"classmethod",
]
[tool.mypy]
# https://mypy.readthedocs.io/en/latest/config_file.html#using-a-pyproject-toml-file
# Suppress all missing import errors for all untyped libraries
ignore_missing_imports = true