-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
74 lines (57 loc) · 1.94 KB
/
Justfile
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
default: tests
version := `pipx run hatch version`
_assert_no_dev_version:
#!/usr/bin/env python3
if "dev" in "{{version}}":
raise SystemExit(1)
# run benchmarks
benchmarks:
pipx run hatch run benchmarks:run
# normalize Python code
black:
pipx run black benchmarks _delb delb tests
# runs tests and reports coverage
coverage-report:
pipx run hatch run unit-tests:coverage-report
# generate Sphinx HTML documentation, including API docs
docs:
pipx run hatch run docs:clean
pipx run hatch run docs:build-html
# verifies testable code snippets in the HTML documentation
doctest:
pipx run hatch run docs:clean
pipx run hatch run docs:doctest
# code & data & document linting with doc8 & flake8 & yamllint
lint:
pipx run doc8 --ignore-path docs/build --max-line-length=80 docs
pipx run hatch run linting:check
pipx run yamllint $(find . -name "*.yaml" -or -name "*.yml")
# run static type checks with mypy
mypy:
pipx run hatch run mypy:check
# run the complete testsuite
pytest:
pipx run hatch run unit-tests:check
# release the current version on github & (transitively) the PyPI
release: _assert_no_dev_version tests
{{just_executable()}} -f {{justfile()}} update-citation-file
git add CITATION.cff
git commit -m "Updates CITATION.cff"
git tag {{version}}
git push origin main
git push origin {{version}}
# watch, build and serve HTML documentation at 0.0.0.0:8000
serve-docs:
mkdir -p {{ justfile_directory() }}/docs/build/html || true
pipx run hatch run docs:serve
# build and open HTML documentation
show-docs: docs
xdg-open docs/build/html/index.html
# run all tests on normalized code
tests: black lint mypy pytest doctest
# run the testsuite against a wheel (installed from $WHEEL_PATH); intended to run on a CI platform
test-wheel $WHEEL_PATH:
pipx run hatch run test-wheel:check
# Generates and validates CITATION.cff
update-citation-file:
pipx run cff-from-621