-
-
Notifications
You must be signed in to change notification settings - Fork 312
/
hatch.toml
128 lines (112 loc) · 3.64 KB
/
hatch.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
# https://hatch.pypa.io/latest/config/environment/overview/
# ---------------------------------------------------------
[envs.default]
description = "Development environment"
installer = "uv pip install"
features = [
"tests",
"types",
"docs",
"dev",
]
# ---------------------------------------------------------
[envs.pkg]
description = "package information"
features = [
"tests",
"dev",
]
[envs.pkg.scripts]
show = [
"uv pip list --format=columns",
'python -c "import sys; print(sys.version); print(sys.executable)"',
]
# ---------------------------------------------------------
[envs.lint]
template = "lint"
installer = "uv pip install"
description = "lint and format"
detached = true
dependencies = ["pre-commit"]
[envs.lint.scripts]
run = "pre-commit run --all-files --show-diff-on-failure"
# ---------------------------------------------------------
[envs.types]
template = "types"
installer = "uv pip install"
description = "Run the type checker"
dev-mode = false
features = ["tests", "types"]
[envs.types.scripts]
run = "mypy --install-types --non-interactive --ignore-missing-imports --config-file={root}/pyproject.toml {args:src tests}"
# ---------------------------------------------------------
[envs.docs]
template = "docs"
installer = "uv pip install"
description = "build and check documentation"
features = ["docs"]
# Keep in sync with CI.yaml/docs, tox/docs and .readthedocs.yaml.
python = "3.12"
[envs.docs.scripts]
build = "sphinx-build -W --keep-going --color -b html docs docs/_build"
linkcheck = "sphinx-build -W --keep-going --color -b linkcheck docs docs/_build"
doctest = "sphinx-build -W --keep-going --color -b doctest docs docs/_build"
run = ["build", "linkcheck"]
all = ["build", "linkcheck", "doctest"]
# ---------------------------------------------------------
[envs.changelog]
template = "changelog"
installer = "uv pip install"
description = "build changelog with towncrier"
dev-mode = false
dependencies = ["towncrier"]
[envs.changelog.scripts]
run = "towncrier build --version main --draft"
# ---------------------------------------------------------
[envs.tests]
template = "tests"
#installer = "uv pip install"
description = "Run the tests suite"
dev-mode = false
features = ["tests"]
[[envs.tests.matrix]]
python = ["3.9", "3.10", "3.11", "3.12", "3.13"]
[envs.tests.env-vars]
COVERAGE_PROCESS_START = "pyproject.toml"
COVERAGE_FILE = "report/.coverage.{matrix:python}"
[envs.tests.overrides]
# To allow environment variable overwrite
env.COVERAGE_FILE.env-vars = "COVERAGE_FILE"
env.COVERAGE_PROCESS_START.env-vars = "COVERAGE_PROCESS_START"
[envs.tests.scripts]
run = "pytest {args:-n auto}"
test-cov = "python -m pytest --cov=subliminal --cov-report= --cov-fail-under=0 {args:-n auto}"
test-cov-core = "python -m pytest -m core --cov=subliminal --cov-report= --cov-fail-under=0 {args:-n auto}"
run-cov = [
"test-cov",
"coverage report --skip-covered --show-missing --fail-under=80",
]
run-cov-core = [
"test-cov-core",
"""\
coverage report --skip-covered --show-missing --fail-under=100 \
--omit='src/subliminal/cli.py,src/subliminal/converters/*,src/subliminal/providers/*,src/subliminal/refiners/*' \
""",
]
# ---------------------------------------------------------
[envs.coverage]
template = "coverage"
installer = "uv pip install"
description = "combine coverage files"
detached = true
dependencies = [
"coverage[toml]>=7.3.2",
]
env-vars = { COVERAGE_FILE = "report/.coverage" }
# To allow environment variable overwrite
overrides = { env.COVERAGE_FILE.env-vars = "COVERAGE_FILE" }
[envs.coverage.scripts]
run = [
"- coverage combine report",
"coverage report --sort=-Cover --show-missing --skip-covered --skip-empty",
]