-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
359 lines (327 loc) · 9 KB
/
pyproject.toml
File metadata and controls
359 lines (327 loc) · 9 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
358
359
# ===================================
# ======= BUILD ========
# ===================================
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[dependency-groups]
dev = [
"pkg_infra"
]
# ===================================
# ======= PROJECT ========
# ===================================
[project]
authors = [
{name = "Edwin Carreño", email = "edwin.carreno@iwr.uni-heidelberg.de"}
]
classifiers = [
# How mature is this project? Common values are
# 2 - Pre-Alpha
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Bio-Informatics"
]
dependencies = [
"pronto",
"pooch[progress]",
"pyyaml",
"appdirs>=1.4.4",
"python-graphblas[default]>=2025.2.0",
"download-manager"
]
description = "A lightweight Python package for loading, representing, and efficiently querying biological ontologies as graph structures."
license = "MIT"
maintainers = [
{name = "Edwin Carreño", email = "edwin.carreno@iwr.uni-heidelberg.de"}
]
name = "ontograph"
readme = "README.md"
requires-python = ">=3.10"
version = "0.0.1"
[project.optional-dependencies]
dev = [
"distlib",
"pre-commit",
"bump2version",
"twine",
"ipykernel"
]
docs = [
"mkdocs-material>=9.6.14",
"pymdown-extensions>=10.15",
"mkdocstrings[python]>=0.29.1,<0.30"
]
security = [
"bandit"
]
semantic = [
"rdflib>=6.0.0"
]
tests = [
"pytest>=6.0",
"pytest-cov",
"tox>=3.20.1",
"tox-gh>=1.5.0",
"coverage>=6.0",
"codecov-cli>=10.2.0",
"diff_cover",
"ruff"
]
[project.urls]
Documentation = "https://saezlab.github.io/ontograph"
Homepage = "https://github.com/saezlab/ontograph"
Issues = "https://github.com/saezlab/ontograph/issues"
Repository = "https://github.com/saezlab/ontograph"
# ===================================
# ======= TOOL ========
# ===================================
# ---- Bandit: tool for security analysis
[tool.bandit]
exclude_dirs = [".venv", "venv", ".tox", "build", "dist"]
skips = [
"B101" # Name: assert_used
]
# ---- Coverage: a tool used to measure code coverage of Python programs
[tool.coverage]
[tool.coverage.run]
omit = [
"**/test_*.py"
]
source = ["ontograph"]
# ---- Cruft: a tool to manage and update projects based on templates
[tool.cruft]
skip = [
"tests",
"ontograph/__init__.py",
"ontograph/_metadata.py",
"docs/api.md",
"docs/changelog.md",
"docs/references.bib",
"docs/references.md",
"docs/notebooks/example.ipynb"
]
# ---- Hatch: a modern Python project manager for builds, environments, and publishing
[tool.hatch]
[tool.hatch.build.targets.wheel]
packages = ["ontograph"]
# --- Pytest: a lightweight and scalable testing tool using the pytest framework
[tool.pytest]
[tool.pytest.ini_options]
addopts = [
# "-Werror", # if 3rd party libs raise DeprecationWarnings, just use filterwarnings below
"--import-mode=importlib" # allow using test files with same name
]
filterwarnings = [
]
python_files = "test_*.py"
testpaths = [
"tests"
]
xfail_strict = true
# ---- RSTcheck: a tool to lint reStructuredText (.rst) files.
[tool.rstcheck]
ignore_directives = [
"automodule",
"toctree"
]
ignore_messages = '(Unknown target name:.*|No (directive|role) entry for "(auto)?(class|method|property|function|func|mod|attr)" in module "docutils\.parsers\.rst\.languages\.en"\.)'
ignore_roles = ["ref"]
report_level = "INFO"
# ---- Ruff: a fast Python linter and formatter.
[tool.ruff]
exclude = [
"sandbox/"
]
extend-include = ["*.ipynb"]
line-length = 80
target-version = "py312"
[tool.ruff.format]
quote-style = "single"
[tool.ruff.lint]
exclude = [
"docs/_build",
"tests/",
"test_*.py",
"*/test_*.py",
"notebooks/",
"examples/",
"*.ipynb",
"**/*.ipynb"
]
ignore = [
# flake8-bugbear (B)
"B008", # Name: function-call-in-default-argument
"B024", # Name: abstract-base-class-without-abstract-method
# pydocstyle (D)
"D100", # Name: undocumented-public-module
"D104", # Name: undocumented-public-package
"D105", # Name: undocumented-magic-method
"D107", # Name: undocumented-public-init
"D200", # Name: unnecessary-multiline-docstring
"D202", # Name: blank-line-after-function
"D203", # Name: incorrect-blank-line-before-class
"D213", # Name: multi-line-summary-second-line
"D400", # Name: missing-trailing-period
"D401", # Name: non-imperative-mood
# Error (E)
"E251", # Name: unexpected-spaces-around-keyword-parameter-equals
"E303", # Name: too-many-blank-lines
"E501", # Name: line too long
"E731", # Name: lambda-assignment
"E741" # allow I, O, l as variable names -> I is the identity matrix
]
select = [
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C4", # flake8-comprehensions
"D", # pydocstyle
"E", # Error detected by Pycodestyle
"F", # Errors detected by Pyflakes
"I", # isort
"RUF100", # Report unused noqa directives
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"W", # Warning detected by Pycodestyle
"Q", # Consistent quotes
"S307", # eval() detection
"ANN" # flake8-annotations
]
unfixable = ["UP"]
[tool.ruff.lint.flake8-quotes]
inline-quotes = "single"
[tool.ruff.lint.isort]
case-sensitive = false
combine-as-imports = true
force-sort-within-sections = true
force-wrap-aliases = true
known-first-party = ["ontograph"]
known-third-party = ["numpy", "pandas"]
length-sort = true
lines-after-imports = 1
no-lines-before = ["local-folder"]
order-by-type = true
section-order = [
"future",
"standard-library",
"third-party",
"first-party",
"local-folder"
]
[tool.ruff.lint.per-file-ignores]
"*/__init__.py" = ["D104", "F401"]
"docs/*" = ["I"]
"docs/src/conf.py" = ["D100"]
"tests/*" = ["D", "ANN", "I"]
"tests/conftest.py" = ["D101", "D102", "D103", "E402"]
[tool.ruff.lint.pydocstyle]
convention = "google"
# ---- tox: a tool to automate testing in multiple environments.
[tool.tox]
envlist = [
"covclean",
"lint",
"py{39,310,311,312,313}",
"coverage",
"readme",
"docs"
]
isolated_build = true
min_version = "3.20.0"
skip_missing_interpreters = true
[tool.tox.envs]
base_python = [
"py39: python3.9",
"py310: python3.10",
"py311: python3.11",
"py312: python3.12",
"py313: python3.13"
]
commands = [
"pytest --cov --cov-append --cov-config={toxinidir}/.coveragerc --ignore docs/ {posargs:-vv {env:_PYTEST_TOX_POSARGS:}}"
]
deps = [
".[tests]"
]
passenv = "TOXENV,CI,CODECOV_*,GITHUB_ACTIONS"
platform = [
"linux: linux",
"macos: (macos|osx|darwin)"
]
usedevelop = true
[tool.tox.envs.clean-docs]
allowlist_externals = ["make"]
changedir = "{toxinidir}/docs"
commands = [
"make clean"
]
description = "Clean the documentation artifacts."
skip_install = true
[tool.tox.envs.covclean]
commands = [
"coverage erase"
]
deps = [".[tests]"]
description = "Clean coverage files."
skip_install = true
[tool.tox.envs.coverage]
commands = [
"coverage report --omit=\"tox/*\"",
"coverage xml --omit=\"tox/*\" -o {toxinidir}/coverage.xml",
"diff-cover --compare-branch origin/main {toxinidir}/coverage.xml"
]
depends = "py{39,310,311,312,313}"
deps = [".[tests]"]
description = "Report the coverage difference."
parallel_show_output = true
skip_install = true
[tool.tox.envs.docs]
allowlist_externals = ["uv"]
commands = [
"uv sync --extra docs",
"uv run sphinx-build --color -b html {toxinidir}/docs/source {toxinidir}/docs/build/html",
"python -c 'import pathlib; print(f\"Documentation is available under:\", pathlib.Path(f\"{toxinidir}\") / \"docs\" / \"build\" / \"html\" / \"index.html\")'"
]
description = "Build the documentation."
skip_install = true
[tool.tox.envs.lint]
commands = [
"pre-commit run --all-files --show-diff-on-failure {posargs:}"
]
deps = [".[dev]"]
description = "Perform linting."
skip_install = true
[tool.tox.envs.py313]
setenv = "_PYTEST_TOX_POSARGS=--log-cli-level=ERROR"
[tool.tox.envs.readme]
allowlist_externals = ["uv"]
commands = [
"uv build --wheel --out-dir {envtmpdir}/build",
"twine check {envtmpdir}/build/*"
]
deps = [".[dev]"]
description = "Check if README renders on PyPI."
skip_install = true
[tool.tox-gh-actions]
env = [
"py313: covclean, lint, coverage, readme, docs"
]
python = [
"3.9: py39",
"3.10: py310",
"3.11: py311",
"3.12: py312",
"3.13: py313"
]
[tool.uv.sources]
download-manager = {git = "https://github.com/saezlab/download-manager.git", rev = "feat/migration-logger"}
jupyter-contrib-nbextensions = {git = "https://github.com/deeenes/jupyter_contrib_nbextensions.git", branch = "master"}
nbsphinx = {git = "https://github.com/deeenes/nbsphinx", branch = "timings"}
pkg_infra = {git = "https://github.com/saezlab/pkg_infra.git", rev = "main"}