forked from linkml/linkml
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
357 lines (339 loc) · 10.6 KB
/
pyproject.toml
File metadata and controls
357 lines (339 loc) · 10.6 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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
[build-system]
requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"
[project]
name = "linkml"
description = "Linked Open Data Modeling Language"
authors = [
{name = "Chris Mungall", email = "cjmungall@lbl.gov"},
{name = "Sierra Moxon", email = "smoxon@lbl.gov"},
{name = "Harold Solbrig", email = "solbrig@jhu.edu"},
{name = "Sujay Patil", email = "spatil@lbl.gov"},
{name = "Harshad Hegde", email = "hhegde@lbl.gov"},
{name = "Mark Andrew Miller", email = "MAM@lbl.gov"},
{name = "Deepak Unni"},
{name = "Gaurav Vaidya", email = "gaurav@renci.org"},
{name = "Kevin Schaper", email = "kevin@tislab.org"},
]
license = "Apache-2.0"
license-files = ["LICENSE"]
homepage = "https://linkml.io/"
repository = "https://github.com/linkml/linkml"
documentation = "https://linkml.io/linkml/"
readme = "README.md"
keywords = ["schema", "linked data", "data modeling", "rdf", "owl", "biolink"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Intended Audience :: Healthcare Industry",
"Topic :: Software Development :: Libraries :: Python Modules",
"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",
]
include = ["linkml"]
requires-python = ">=3.9"
dynamic = ["version"]
dependencies = [ # Specifier syntax: https://peps.python.org/pep-0631/
"antlr4-python3-runtime >= 4.9.0, < 4.10",
"click >= 8.0, < 8.2",
"graphviz >= 0.10.1",
"hbreader",
"isodate >= 0.6.0",
"jinja2 >= 3.1.0",
"jsonasobj2 >= 1.0.3, < 2.0.0",
"jsonschema[format] >= 4.0.0",
"linkml-runtime >= 1.9.5, < 2.0.0",
"openpyxl",
"parse",
"prefixcommons >= 0.1.7",
"prefixmaps >= 0.2.2",
"pydantic >= 1.0.0, < 3.0.0",
"pyjsg >= 0.11.6",
"pyshex >= 0.7.20",
"pyshexc >= 0.8.3",
"python-dateutil",
"pyyaml",
"rdflib >=6.0.0",
"requests >= 2.22",
"sqlalchemy >= 1.4.31",
"watchdog >= 0.9.0",
"typing-extensions >= 4.6.0; python_version < '3.12'",
"sphinx-click (>=6.0.0)",
]
[dependency-groups]
lint = [
"black >= 24.0.0",
]
typing = [
"numpydantic >= 1.6.1",
]
shacl = [
"pyshacl >= 0.25.0",
]
tests = [
{ include-group = "lint" },
{ include-group = "typing" },
{ include-group = "shacl" }
]
dev = [
{include-group = "tests" },
{include-group = "pandera"},
"pytest >= 7.4.0",
"chardet",
"ipykernel",
"ipython-genutils",
"jupyter",
"nbconvert",
"nbformat",
"coverage >= 6.4.1",
"tox >= 4",
"tox-uv",
"requests-cache >= 1.2.0",
"myst-nb >= 1.0.0; python_version >= '3.9'",
"sphinx-design >= 0.5.0",
"rich >= 13.7.1"
]
pandera = [
"pandera >= 0.19.0",
"polars-lts-cpu >= 1.0.0",
"pandas"
]
tests-extra = [
"pytest >= 7.4.0",
"pytest-subtests >= 0.11.0",
"pytest-xdist >= 3.6.1",
"numpy >= 1.24.3; python_version < '3.12'",
"numpy >= 1.25.2; python_version >= '3.12'",
"requests-cache >= 1.2.0",
"mock >= 5.1.0",
"testcontainers == 3.7.1",
"jsonpatch >= 1.33",
]
docs = [
"furo >= 2023.03.27",
"sphinxcontrib-mermaid >= 0.7.1",
"sphinx",
"sphinx-click",
"sphinx-rtd-theme",
"myst-parser",
"matplotlib >= 3.7",
"sphinx-jinja >= 2.0.2",
"sphinxcontrib-programoutput >= 0.17",
]
[project.scripts]
linkml = "linkml.cli.main:linkml"
gen-jsonld-context = "linkml.generators.jsonldcontextgen:cli"
gen-prefix-map = "linkml.generators.prefixmapgen:cli"
gen-csv = "linkml.generators.csvgen:cli"
gen-graphviz = "linkml.generators.dotgen:cli"
gen-golang = "linkml.generators.golanggen:cli"
gen-golr-views = "linkml.generators.golrgen:cli"
gen-graphql = "linkml.generators.graphqlgen:cli"
gen-java = "linkml.generators.javagen:cli"
gen-jsonld = "linkml.generators.jsonldgen:cli"
gen-json-schema = "linkml.generators.jsonschemagen:cli"
gen-markdown = "linkml.generators.markdowngen:cli"
gen-dbml = "linkml.generators.dbmlgen:cli"
gen-doc = "linkml.generators.docgen:cli"
gen-namespaces = "linkml.generators.namespacegen:cli"
gen-owl = "linkml.generators.owlgen:cli"
gen-plantuml = "linkml.generators.plantumlgen:cli"
gen-proto = "linkml.generators.protogen:cli"
gen-py-classes = "linkml.generators.pythongen:cli"
gen-python = "linkml.generators.pythongen:cli"
gen-pydantic = "linkml.generators.pydanticgen:cli"
gen-pandera = "linkml.generators.panderagen:cli"
gen-rdf = "linkml.generators.rdfgen:cli"
gen-shex = "linkml.generators.shexgen:cli"
gen-shacl = "linkml.generators.shaclgen:cli"
gen-sparql = "linkml.generators.sparqlgen:cli"
gen-typescript = "linkml.generators.typescriptgen:cli"
gen-terminusdb = "linkml.generators.terminusdbgen:cli"
gen-yuml = "linkml.generators.yumlgen:cli"
gen-yaml = "linkml.generators.yamlgen:cli"
gen-erdiagram = "linkml.generators.erdiagramgen:cli"
gen-sqla = "linkml.generators.sqlalchemygen:cli"
gen-sqlddl = "linkml.generators.sqltablegen:cli"
gen-sqltables = "linkml.generators.sqltablegen:cli"
gen-summary = "linkml.generators.summarygen:cli"
gen-project = "linkml.generators.projectgen:cli"
run-tutorial = "linkml.utils.execute_tutorial:cli"
linkml-convert = "linkml.utils.converter:cli"
linkml-lint = "linkml.linter.cli:main"
linkml-sqldb = "linkml.utils.sqlutils:main"
linkml-validate = "linkml.validator.cli:cli"
linkml-jsonschema-validate = "linkml.validators.jsonschemavalidator:cli"
linkml-sparql-validate = "linkml.validators.sparqlvalidator:cli"
linkml-run-examples = "linkml.workspaces.example_runner:cli"
gen-excel = "linkml.generators.excelgen:cli"
gen-sssom = "linkml.generators.sssomgen:cli"
gen-linkml = "linkml.generators.linkmlgen:cli"
gen-mermaid-class-diagram = "linkml.generators.mermaidclassdiagramgen:cli"
linkml-schema-fixer = "linkml.utils.schema_fixer:main"
[tool.codespell]
skip = [
".git", "*.pdf", "*.svg", "*.dill",
"./tests", # TODO: bring in tests in too
"pyproject.toml",
"uv.lock",
"./notebooks/DistributedModels.ipynb",
"./docs/LinkML-logo/LinkML-Revised-Round-Logo-MASTER-FILE.ai",
"./tests/data/hp.ttl",
"./tests/data/hp_f.ttl",
"tests/test_generators/input/jsonschema_value_constraints.yaml",
]
# Ignore table where words could be split across rows
ignore-regex = '(\|.*\|.*\|.*\||\[[A-Z][a-z]\][a-z][a-z])'
ignore-words-list = [
"acsess",
"AGS",
"amination",
"anc",
"brite",
"CrossReference",
"crossReference",
"connexion",
"EHR",
"infarction",
"linke",
"mater",
"mor",
"Stye",
"TE",
"thirdparty",
"Vas",
# These are temp exemptions because they are coming from
# upstream repos linkml-runtime and linkml-model
# we should remove these once the upstream repos are fixed
# and changes are propagated to linkml
"GENERARE",
"re-used",
"doesnt"
]
quiet-level = 3
[tool.black]
line-length = 120
target-version = ["py39", "py310", "py311", "py312", "py313"]
force-exclude = '''
/(
# default exclude
\.direnv|\.eggs|\.git|\.hg|\.ipynb_checkpoints|\.mypy_cache|\.nox|\.pytest_cache|\.ruff_cache|\.tox|\.svn|\.venv|\.vscode|__pypackages__|_build|buck-out|build|dist|venv
# additional exclude
| tests.*/output
| __snapshots__
| docs
| examples
| notebooks
| linkml/linter/config/datamodel
)/
'''
[tool.pytest.ini_options]
filterwarnings = [
# https://github.com/RDFLib/rdflib/issues/1830
"ignore:.*_pytestfixturefunction is not defined in namespace:UserWarning"
]
markers = [
"network: mark tests that make external network requests",
"slow: mark test as slow to run",
"no_asserts: tests that don't have meaningful asserts, but are only snapshot comparisons, or historically had print statements, or other non-erroring behavior",
"strcmp: tests that compare stringified values rather than the values themselves",
"biolink: tests that validate that the biolink model is unchanged",
"docker: tests that require a running docker server",
"plantumlgen: Tests for the plantuml generator",
"pydanticgen_split: Split module generation in pydanticgen",
"pydanticgen_npd: tests for the numpydantic array generator",
"panderagen: tests for the pandera generator",
"pythongen: Tests for python generator",
"pydanticgen: Tests for pydantic generator",
"javagen: Tests for java generator",
"jsonschemagen: Tests for Json Schema generator",
"shaclgen: Tests for shacl generator",
"shexgen: Tests for shex generator",
"jsonldgen: Test for JSON-LD generator",
"jsonldcontextgen: Test for JSON-LD context generator",
"rdfgen: Tests for the RDFGenerator",
"sqlalchemygen: Tests for SQL Alchemy generator",
"sqlddlgen: Tests for SQL DDL generator",
"sqlddlpostgresgen: Tests for SQL DDL postgres generator",
"owlgen: Tests for OWL generator",
"yamlgen: Tests for the YAML generator"
]
# https://docs.astral.sh/ruff/settings/
[tool.ruff]
extend-exclude = [
"tests/output",
"tests/**/output",
"tests/**/__snapshots__",
"examples/",
"docs/",
"notebooks/",
# Auto-generated files that may not conform to current linting rules
"linkml/linter/config/datamodel/config.py"
]
force-exclude = true
line-length = 120
# Assume Python 3.9
target-version = "py39"
[tool.ruff.lint]
extend-ignore = ["E203"]
select = [
"E", # pycodestyle errors
"F", # Pyflakes
"I", # isort
"UP", # pyupgrade
]
[tool.ruff.lint.per-file-ignores]
# These templates can have long lines
"linkml/generators/sqlalchemy/sqlalchemy_declarative_template.py" = ["E501"]
"linkml/generators/sqlalchemy/sqlalchemy_imperative_template.py" = ["E501"]
"linkml/linter/config/datamodel/config.py" = ["E501", "F401", "I001", "UP035"]
# Notebooks can have unsorted imports
"tests/test_notebooks/input/*" = ["E402"]
[tool.tox]
requires = ["tox>=4", "tox-uv"]
env_list = ["lint", "py{39,310,311,312,313}"]
[tool.tox.env_run_base]
runner = "uv-venv-lock-runner"
deps = ["pytest"]
commands = [
["pytest", "{posargs}"],
]
[tool.tox.env.codespell]
description = "Run spell checkers."
runner = "uv-venv-runner"
skip_install = true
deps = [
"codespell",
"tomli", # required for getting config from pyproject.toml
]
commands = [
["codespell", "{posargs}"]
]
[tool.tox.env.format]
description = "Run code formatter and code-fixing linter."
runner = "uv-venv-runner"
skip_install = true
deps = ["pre-commit"]
commands = [
["pre-commit", "run", "--all-files", "--show-diff-on-failure", { replace = "posargs", extend = true }]
]
[tool.tox.env.lint]
description = "Run code linter and formatter (no fixes)."
runner = "uv-venv-runner"
skip_install = true
deps = ["ruff==0.11.13"]
commands = [
["ruff", "check", "{posargs:.}"],
["ruff", "format", "{posargs:.}"],
]
[tool.uv-dynamic-versioning]
vcs = "git"
style = "pep440"
fallback-version = "0.0.0"
[tool.hatch.version]
source = "uv-dynamic-versioning"