Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
123 lines (97 loc) · 3.64 KB
/
Copy pathpyproject.toml
File metadata and controls
123 lines (97 loc) · 3.64 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
[project]
name = "bornal"
version = "0.1.0"
description = "kit for bitcoin related integration test tools"
readme = "README.md"
requires-python = ">=3.11,<3.13"
dependencies = [
"pytest>=9.1.1",
]
[project.scripts]
bornal = "bornal:main"
[project.entry-points."bornal.daemons"]
bitcoin-core = "bornal.plugins.bitcoind:CoreCompiler"
electrs = "bornal.plugins.electrs:ElectrsCompiler"
floresta = "bornal.plugins.floresta:FlorestaCompiler"
[project.entry-points.pytest11]
bornal = "bornal.fixtures"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/bornal"]
[dependency-groups]
dev = [
"poethepoet>=0.30",
"ruff>=0.8",
"pytest-cov>5.0",
"pre-commit>=3.7",
]
[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "-p pytester"
[tool.coverage.run]
source = ["src/bornal"]
[tool.coverage.report]
show_missing = true
fail_under = 90
[tool.poe.tasks.bornal]
help = "Run bornal CLI with virtualenv"
cmd = "python -m bornal"
[tool.poe.tasks.hooks]
help = "Install the git pre-commit and commit-msg hooks"
cmd = "pre-commit install --install-hooks"
[tool.poe.tasks.test-verbose]
help = "Run the whole suite verbosely (no coverage)"
cmd = "pytest -v ./tests"
[tool.poe.tasks.test-simple]
help = "Run the whole suite without coverage"
cmd = "pytest ./tests"
[tool.poe.tasks.build]
help = "Build wheel into dist/"
cmd = "uv build --wheel"
[tool.poe.tasks.format]
help = "Auto-format the source with ruff"
cmd = "ruff format src"
[tool.poe.tasks.format-check]
help = "Check formatting"
cmd = "ruff format --check src"
[tool.poe.tasks.lint]
help = "Lint the source with ruff"
cmd = "ruff check src"
[tool.poe.tasks.lint-fix]
help = "Lint check for issues with ruff"
cmd = "ruff check --fix src"
[tool.poe.tasks.lint-check]
help = "Run lint then format"
sequence = ["lint", "format"]
[tool.poe.tasks.test-clean]
help = "Erase coverage data and reports"
shell = "rm -rf htmlcov coverage.xml .coverage"
[tool.poe.tasks.test-unit]
help = "Run unit tests (with coverage data)"
cmd = "coverage run --append -m pytest ./tests/unit"
[tool.poe.tasks.test-functional]
help = "Run functional tests (with coverage data)"
cmd = "coverage run --append -m pytest ./tests/functional"
[tool.poe.tasks.coverage-report]
help = "Report accumulated coverage (gate: fail_under)"
cmd = "coverage report"
[tool.poe.tasks.test-cov]
help = "Full suite behind the coverage gate: clean, unit, functional, report"
sequence = ["test-clean", "test-unit", "test-functional", "coverage-report"]
[tool.poe.tasks.tests]
help = "Alias for `test-cov`"
ref = "test-cov"
[tool.poe.tasks.example]
help = "run example"
cmd = "pytest --nproc ${nproc} --build-bitcoin ${bitcoin} ${electrs:+--build-electrs ${electrs}} ${floresta:+--build-floresta ${floresta}} ${debug:+--show-capture all --capture tee-sys} ${wallet:+--wallet} ${test:+examples/test_${test}.py}"
args = [
{ name = "nproc", options = ["--nproc", "-j"], type = "integer", default = 8 },
{ name = "bitcoin", options = ["--bitcoin", "-B"], default = "latest"},
{ name = "electrs", options = ["--electrs", "-E"], help = "also build electrs at this revision (e.g. latest): required by examples/electrs"},
{ name = "floresta", options = ["--floresta", "-F"], help = "also build floresta at this revision (e.g. latest): required by examples/floresta"},
{ name = "wallet", options = ["--wallet", "-W"], type = "boolean", help = "have wallet support or not"},
{ name = "debug", options = ["--debug", "-d"], type = "boolean", help = "many verbose output"},
{ name = "test", options = ["--test", "-t"], help = "example path under examples/ (e.g. test_chain_check.py or electrs)"}
]