Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
108 lines (97 loc) · 3.27 KB
/
Copy pathpyproject.toml
File metadata and controls
108 lines (97 loc) · 3.27 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
# TESK has no Python package: this file holds the tools that its checks and
# its docs use (dependency groups, locked in `uv.lock`), so that CI, Read the
# Docs and local runs use the same versions, and their settings
[project]
name = "tesk"
version = "0.0.0"
description = "GA4GH Task Execution Service on Kubernetes: Helm chart and docs"
# The Python version of the tools only, as in CI (`.github/workflows/ci.yml`)
# and on Read the Docs (`.readthedocs.yaml`): the newest Python in its
# security phase, as in the org's other repos
requires-python = ">=3.13"
license = "Apache-2.0"
[dependency-groups]
# Checks of `.pre-commit-config.yaml` (the local hooks use these too) and the
# tests in `tests/`, which build the docs too
dev = [
"coverage>=7.10",
"mypy>=1.18",
"pre-commit>=4.6",
"pytest>=8.4",
"types-PyYAML>=6.0.12",
# Locks the version of uv that CI installs (`astral-sh/setup-uv`)
"uv>=0.13",
{include-group = "docs"},
]
# Documentation (`mkdocs.yml`, with the hooks in `docs/hooks.py`), built by
# Read the Docs (`.readthedocs.yaml`) and in CI, both from the lock. The
# packages that add warnings, which fail the strict build, are bounded by
# major version (new warnings of minor releases still fail it)
docs = [
"mkdocs>=1.6.1,<2",
"mkdocs-material>=9.6,<10",
"mkdocs-redirects>=1.2,<2",
# `docs/hooks.py` matches the `exclude_docs` of pulled docs (as MkDocs)
"pathspec>=0.11.1",
"pymdown-extensions>=10.16,<14",
"PyYAML>=6.0",
]
[tool.uv]
# Not a package: `uv sync` installs the dependency groups only
package = false
[tool.ruff]
line-length = 88
target-version = "py313"
[tool.ruff.lint]
# The rule set of the org's Python repos (as in cloud-registry); `D` applies
# everywhere, also to the tests and docs hooks
select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # pydocstyle (docstrings)
"E", # pycodestyle errors
"F", # Pyflakes
"G", # flake8-logging-format
"I", # isort
"PL", # Pylint
"RUF", # Ruff-specific rules
"S", # flake8-bandit (security)
"SIM", # flake8-simplify
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
# Complexity limits, as in cloud-registry
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0915", # too-many-statements
"PLR0917", # too-many-positional-arguments
# Flags literals (e.g., lengths), which are clear as is
"PLR2004", # magic-value-comparison
]
[tool.ruff.lint.isort]
force-sort-within-sections = true
known-first-party = ["tests"]
[tool.ruff.lint.per-file-ignores]
# pytest checks with `assert`
"tests/**" = ["S101"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
files = ["docs/hooks.py", "scripts", "tests"]
python_version = "3.13"
# Complete type hints: all functions annotated, generic types parametrized
disallow_untyped_defs = true
disallow_any_generics = true
warn_unused_ignores = true
[tool.pytest.ini_options]
testpaths = ["tests"]
[tool.coverage.run]
source = ["docs", "scripts"]
[tool.coverage.report]
# The entry point of the scripts, which the tests also run as a process
# (as in cloud-registry)
exclude_also = ['if __name__ == "__main__":']
# All code must be covered (see also `codecov.yml`)
fail_under = 100
show_missing = true