-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
254 lines (222 loc) · 6.87 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
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
[build-system]
requires = ["hatchling", "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 of 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 = {text = "BSD-3-Clause"}
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",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dependencies = [
"base32-crockford >= 0.3.0",
"colorama",
"curies >= 0.6.6",
"networkx >= 2.8",
"openpyxl >= 3.1.5",
"pillow >= 9.1.0",
"pydantic < 2.0.0",
"pyLODE < 3.0.0",
"pyshacl >= 0.18.1",
"rdflib >= 6.1.1",
"tomli>=1.1.0; python_version < '3.11'",
]
#dynamic = ["version", "readme"]
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 = [
"black",
]
dev = [
# Recursively including the project's own optional dependencies requires pip>=21.2
"voc4cat[tests,lint]",
"ruff",
]
[project.scripts]
voc4cat = "voc4cat.cli:run_cli_app"
merge_vocab = "voc4cat.merge_vocab:main_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"
# Treat typos in function markers as an error (pytest)
# --strict-markers
# Raise an error instead of a warning for pytest related config issues (pytest)
# --strict-config
# Degree of detail of trace-backs (pytest)
# --tb=short
# Execute doctests in classes, functions, and test modules (pytest)
# --doctest-modules
addopts = "--strict-markers --strict-config --tb=short"
[tool.coverage]
[tool.coverage.run]
# https://coverage.readthedocs.io/en/latest/config.html
parallel = true
branch = true
source = ["voc4cat"]
omit = [
"**/voc4cat/_version.py",
]
[tool.coverage.paths]
# Specify where coverage schould 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
# 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",
".*",
]
# 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" = [
"S101", # assert in tests 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",
# for pydantic 1.x
"pydantic.validator", "pydantic.class_validators.root_validator"
]
[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
[tool.codespell]
skip = "*.xlsx,pyproject.toml,./vocabularies,./example,./tests/data,./tmp"
# Note: words have to be lowercased for the ignore-words-list
ignore-words-list = "linke"
quiet-level = 3